-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add a python container to wasmtime shim for testing
this commit adds a python container in the test directory. It also adds a few commands in the makefile to build the python flask app into a container, load into the kind cluster for testing. Eventually the wasmtime tests will have both python container and a wasm contaienr running in a pod. Signed-off-by: jiaxiao zhou <[email protected]>
- Loading branch information
Showing
5 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt /app | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip3 install -r requirements.txt | ||
|
||
COPY . /app | ||
|
||
ENTRYPOINT ["python3"] | ||
CMD ["app.py"] | ||
|
||
FROM builder as dev-envs | ||
|
||
RUN <<EOF | ||
apk update | ||
apk add git | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from flask import Flask | ||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def hello(): | ||
return "Hello World!" | ||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0', port=8000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flask |