mirror of https://github.com/knative/func.git
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:
parent
67b43ee5d1
commit
5af934be8d
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
web: python -m parliament .
|
|
@ -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
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
web: python -m parliament .
|
|
@ -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
|
||||
```
|
|
@ -1,2 +0,0 @@
|
|||
builders:
|
||||
default: quay.io/boson/faas-python-builder:v0.9.2
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue