forked from fermyon/wagi-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (20 loc) · 977 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
LOGDIR := _scratch/logs
CACHEDIR := _scratch/cache
.PHONY: serve
serve:
RUST_LOG=wagi=trace wagi -e 'PYTHONHOME=/opt/wasi-python/lib/python3.11' -e 'PYTHONPATH=/opt/wasi-python/lib/python3.11' -c modules.toml --log-dir ${LOGDIR} --module-cache ${CACHEDIR}
.PHONY: run-wasmtime
run-wasmtime:
wasmtime run opt/wasi-python/bin/python3.wasm --mapdir /::./ --env 'PYTHONHOME=/opt/wasi-python/lib/python3.11' --env 'PYTHONPATH=/opt/wasi-python/lib/python3.11' -- code/env.py
# Until 1.0, install via: go install github.com/tetratelabs/wazero/cmd/wazero@latest
#
# Notes:
#
# * add `-hostlogging=filesystem` to see how WASI behaves underneath.
# * add `-cachedir=$HOME/.wazero` to reduce time running python the second time.
.PHONY: run-wazero
run-wazero:
wazero run -mount=.:/ -env=PYTHONHOME=/opt/wasi-python/lib/python3.11 -env=PYTHONPATH=/opt/wasi-python/lib/python3.11 opt/wasi-python/bin/python3.wasm -- code/env.py
.PHONY: tail-logs
tail-logs:
tail -f ${LOGDIR}/*/*