Skip to content

Commit 96e12cf

Browse files
committed
ci: Exercise the urunc VM path in critest via a qemu Linux guest
Swap critest's web server image for nginx-qemu-linux-raw with --test-images-file, so the port-mapping specs boot a real qemu guest through CRI and curl the nginx inside it. Uses a separate urunc-devmapper handler, as the guest image needs a block rootfs. Signed-off-by: Anastassios Nanos <ananos@nofire.ai>
1 parent 1075698 commit 96e12cf

2 files changed

Lines changed: 48 additions & 6 deletions

File tree

‎.github/workflows/critest.yml‎

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
# apparmor provides apparmor_parser, needed by the critest AppArmor
9999
# specs; it must be present before containerd starts, as containerd
100100
# probes AppArmor support once at startup.
101-
sudo apt-get install -y git wget build-essential libseccomp-dev pkg-config bc make apparmor
101+
sudo apt-get install -y git wget build-essential libseccomp-dev pkg-config bc make apparmor qemu-system-x86
102102
103103
- name: Install runc
104104
env:
@@ -164,15 +164,33 @@ jobs:
164164
syslog = true
165165
EOT
166166
167-
- name: Configure containerd with the urunc runtime handler
167+
- name: Configure containerd with the urunc runtime handlers
168168
run: |
169+
sudo mkdir -p /usr/local/bin/scripts
170+
sudo cp script/dm_create.sh /usr/local/bin/scripts/dm_create.sh
171+
sudo chmod 755 /usr/local/bin/scripts/dm_create.sh
172+
sudo /usr/local/bin/scripts/dm_create.sh
169173
sudo mkdir -p /etc/containerd/
170174
sudo containerd config default | sudo tee /etc/containerd/config.toml > /dev/null
175+
sudo sed -i "/\[plugins\.'io\.containerd\.snapshotter\.v1\.devmapper'\]/,/^$/d" /etc/containerd/config.toml
176+
# Two handlers: "urunc" (default snapshotter) exercises the full
177+
# generic suite on the runc-delegation path, "urunc-devmapper"
178+
# provides the block rootfs the guest VM images need.
171179
sudo tee -a /etc/containerd/config.toml > /dev/null <<'EOT'
180+
[plugins.'io.containerd.snapshotter.v1.devmapper']
181+
pool_name = "containerd-pool"
182+
root_path = "/var/lib/containerd/io.containerd.snapshotter.v1.devmapper"
183+
base_image_size = "10GB"
184+
fs_type = "ext2"
172185
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.urunc]
173186
runtime_type = "io.containerd.urunc.v2"
174187
container_annotations = ["com.urunc.unikernel.*"]
175188
pod_annotations = ["com.urunc.unikernel.*"]
189+
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.urunc-devmapper]
190+
runtime_type = "io.containerd.urunc.v2"
191+
container_annotations = ["com.urunc.unikernel.*"]
192+
pod_annotations = ["com.urunc.unikernel.*"]
193+
snapshotter = "devmapper"
176194
EOT
177195
sudo systemctl restart containerd
178196
sleep 3
@@ -204,6 +222,22 @@ jobs:
204222
--ginkgo.junit-report "$PWD/critest-report/junit.xml" \
205223
--ginkgo.timeout 40m
206224
225+
- name: Run critest against the urunc VM path (qemu Linux guest)
226+
run: |
227+
# The web-server specs boot a real guest VM: critest's web server
228+
# image is swapped for urunc's qemu Linux nginx image, so the
229+
# port-mapping specs curl an nginx served from inside the guest.
230+
tee /tmp/urunc-test-images.yaml > /dev/null <<'EOT'
231+
webServerTestImage: harbor.nbfc.io/nubificus/urunc/nginx-qemu-linux-raw:latest
232+
EOT
233+
sudo /usr/local/bin/critest \
234+
--runtime-endpoint unix:///run/containerd/containerd.sock \
235+
--runtime-handler urunc-devmapper \
236+
--test-images-file /tmp/urunc-test-images.yaml \
237+
--ginkgo.focus='port mapping' \
238+
--ginkgo.junit-report "$PWD/critest-report/junit-vmpath.xml" \
239+
--ginkgo.timeout 20m
240+
207241
- name: Upload critest report
208242
if: always()
209243
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0

‎tests/critest/README.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ To validate urunc's CRI surface against something upstream, we run
55
against containerd with `--runtime-handler=urunc`. The workflow lives in
66
`.github/workflows/critest.yml`.
77

8-
critest drives generic Linux images. Under the urunc handler these hit the
9-
runc-delegation path, not the unikernel path. This is exactly the plumbing
10-
Kubernetes exercises for the sandbox and sidecar containers -- unikernel
11-
behavior is covered by the e2e suite in `tests/e2e`.
8+
The workflow runs critest twice:
9+
10+
1. **Full suite, generic images.** These hit the runc-delegation path, not
11+
the VM path. This is exactly the plumbing Kubernetes exercises for the
12+
sandbox and sidecar containers of every urunc pod.
13+
2. **VM path.** Via `--test-images-file` we swap critest's web server image
14+
for `nginx-qemu-linux-raw` (a Linux nginx guest for qemu), so the two
15+
port-mapping specs boot a real guest VM through CRI and curl the nginx
16+
inside it. This needs the devmapper snapshotter (block rootfs), hence the
17+
separate `urunc-devmapper` handler in the containerd config.
18+
19+
Unikernel behavior beyond that is covered by the e2e suite in `tests/e2e`.
1220

1321
There is no official CRI conformance badge. The ecosystem norm is
1422
"passes critest vX.Y with documented skips" -- for reference, Kata runs an

0 commit comments

Comments
 (0)