-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJustfile
More file actions
57 lines (48 loc) · 1.86 KB
/
Copy pathJustfile
File metadata and controls
57 lines (48 loc) · 1.86 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
53
54
55
56
57
# python-tools on Hyperlight
#
# just run - Run once
# just run-5 - Run 5x (snapshot/restore)
# just rootfs - Build rootfs via Docker (cross-platform)
# just build - Build/pull kernel
# just clean - Remove build artifacts
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
export DOCKER_BUILDKIT := "0"
kernel := ".unikraft/build/python-tools-hyperlight_hyperlight-x86_64"
initrd := "initrd.cpio"
memory := "96Mi"
image := "python-tools-hyperlight"
ghcr_kernel := "ghcr.io/hyperlight-dev/hyperlight-unikraft/python-tools-kernel:latest"
# Run the example
run:
hyperlight-unikraft {{kernel}} --initrd {{initrd}} --memory {{memory}} --enable-tools -- /test_tools.py
# Run 5 times via snapshot/restore
run-5:
hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 4 --memory {{memory}} --enable-tools -- /test_tools.py
# Build rootfs via Docker (cross-platform)
rootfs:
docker build --platform linux/amd64 --target cpio -t {{image}}-cpio .
- docker rm -f {{image}}-tmp
docker create --name {{image}}-tmp {{image}}-cpio /bin/true
docker cp {{image}}-tmp:/output.cpio ./{{initrd}}
docker rm -f {{image}}-tmp
# Build kernel via kraft (Linux)
[unix]
build:
-kraft-hyperlight build --plat hyperlight --arch x86_64
# Pull pre-built kernel from GHCR (Windows)
[windows]
build:
docker pull {{ghcr_kernel}}
- docker rm -f {{image}}-kernel-tmp
docker create --name {{image}}-kernel-tmp {{ghcr_kernel}} /kernel
New-Item -ItemType Directory -Force -Path (Split-Path {{kernel}}) | Out-Null
docker cp {{image}}-kernel-tmp:/kernel ./{{kernel}}
docker rm -f {{image}}-kernel-tmp
# Clean build artifacts
[unix]
clean:
rm -rf .unikraft {{initrd}}
[windows]
clean:
if (Test-Path .unikraft) { Remove-Item -Recurse -Force .unikraft }
if (Test-Path {{initrd}}) { Remove-Item -Force {{initrd}} }