-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJustfile
More file actions
52 lines (44 loc) · 1.8 KB
/
Copy pathJustfile
File metadata and controls
52 lines (44 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# python-agent-driver — Python workloads with a persistent
# warmed interpreter via hl_pydriver.
#
# just rootfs — build the CPIO (pip deps + hl_pydriver against
# the local-python-base ABI)
# just build — build the kernel via kraft-hyperlight
# just run — run agent.py once (first call includes warmup)
# just run-5 — run 5× with snapshot-after-warmup (run 1 slow,
# runs 2..5 are warm-path only)
# just clean
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
export DOCKER_BUILDKIT := "0"
kernel := ".unikraft/build/python-agent-driver-hyperlight_hyperlight-x86_64"
initrd := "python-agent-driver-initrd.cpio"
memory := "2560Mi"
image := "python-agent-driver-hyperlight"
script := "../python-agent/agent.py"
[unix]
run:
cargo run -q --manifest-path ../../host/Cargo.toml --bin pydriver-run -- \
$(pwd)/{{kernel}} $(pwd)/{{initrd}} $(realpath {{script}})
[unix]
run-5:
cargo run -q --manifest-path ../../host/Cargo.toml --bin pydriver-run -- \
$(pwd)/{{kernel}} $(pwd)/{{initrd}} $(realpath {{script}}) --repeat 4
[unix]
rootfs:
docker build --target base -t local-python-base-dev:latest \
-f ../../runtimes/python.Dockerfile ../../runtimes/
docker build -t local-python-base:latest \
-f ../../runtimes/python.Dockerfile ../../runtimes/
docker build --platform linux/amd64 --build-arg BASE=local-python-base:latest \
--target cpio -t {{image}}-cpio .
- docker rm -f {{image}}-tmp
docker create --name {{image}}-tmp --entrypoint /bogus {{image}}-cpio
docker cp {{image}}-tmp:/output.cpio ./{{initrd}}
docker rm -f {{image}}-tmp
[unix]
build:
-kraft-hyperlight build --plat hyperlight --arch x86_64
rebuild: clean build rootfs
[unix]
clean:
rm -rf .unikraft {{initrd}}