feat: enable Paketo builders for Python functions (#979)

This commit changes the Python functions to use the open source Paketo
builders. The Paketo builders allow the use of a Procfile to indicate
the desired default start process for the container, so this has been
added to invoke Parliament at startup.

Also, there were no README.md files for Python, so I added them too.

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2022-04-19 20:09:28 -04:00 committed by GitHub
parent 67b43ee5d1
commit 5af934be8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13942 additions and 13843 deletions

View File

@ -25,6 +25,7 @@ var DefaultBuilderImages = map[string]string{
"node": "gcr.io/paketo-buildpacks/builder:base",
"typescript": "gcr.io/paketo-buildpacks/builder:base",
"go": "gcr.io/paketo-buildpacks/builder:base",
"python": "gcr.io/paketo-buildpacks/builder:base",
}
//Builder holds the configuration that will be passed to

View File

@ -0,0 +1 @@
web: python -m parliament .

View File

@ -0,0 +1,29 @@
# Python CloudEvents Function
Welcome to your new Python function project! The boilerplate function
code can be found in [`func.py`](./func.py). This function is meant
to respond to [Cloud Events](https://cloudevents.io/).
## Endpoints
Running this function will expose three endpoints.
* `/` The endpoint for your function.
* `/health/readiness` The endpoint for a readiness health check
* `/health/liveness` The endpoint for a liveness health check
The health checks can be accessed in your browser at
[http://localhost:8080/health/readiness]() and
[http://localhost:8080/health/liveness]().
You can use `func invoke` to send an event to the function endpoint.
## Testing
This function project includes a [unit test](./test_func.py). Update this
as you add business logic to your function in order to test its behavior.
```console
python test_func.py
```

View File

@ -0,0 +1 @@
web: python -m parliament .

View File

@ -0,0 +1,29 @@
# Python HTTP Function
Welcome to your new Python function project! The boilerplate function
code can be found in [`func.py`](./func.py). This function will respond
to incoming HTTP GET and POST requests.
## Endpoints
Running this function will expose three endpoints.
* `/` The endpoint for your function.
* `/health/readiness` The endpoint for a readiness health check
* `/health/liveness` The endpoint for a liveness health check
The health checks can be accessed in your browser at
[http://localhost:8080/health/readiness]() and
[http://localhost:8080/health/liveness]().
You can use `func invoke` to send an HTTP request to the function endpoint.
## Testing
This function project includes a [unit test](./test_func.py). Update this
as you add business logic to your function in order to test its behavior.
```console
python test_func.py
```

View File

@ -1,2 +0,0 @@
builders:
default: quay.io/boson/faas-python-builder:v0.9.2

27722
zz_filesystem_generated.go generated

File diff suppressed because it is too large Load Diff