Skip to content

Optimize distro QEMU tests to be more efficient#228

Closed
gnurizen wants to merge 5 commits intomainfrom
ci-improv
Closed

Optimize distro QEMU tests to be more efficient#228
gnurizen wants to merge 5 commits intomainfrom
ci-improv

Conversation

@gnurizen
Copy link
Copy Markdown
Collaborator

@gnurizen gnurizen commented Mar 9, 2026

See commits

@gnurizen gnurizen changed the title ci improv Optimize distro QEMU tests to be more efficient Mar 10, 2026
gnurizen and others added 5 commits March 10, 2026 17:40
- Use native ARM64 runners (ubuntu-24.04-arm) for arm64 jobs instead
  of emulating arm64 on x86 via QEMU without KVM acceleration
- Remove heavy env action from distro-qemu tests (was installing Rust,
  protoc, cross-compile tools - none needed for these tests)
- Cache kernel images to avoid Docker pulls on every run
- Add --no-install-recommends to debootstrap installation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
run-tests.sh had an inverted KVM check (enabled KVM when vmx/svm was
NOT found), causing arm64 integration tests to fail on ARM runners that
lack /dev/kvm. Switch both scripts to check /dev/kvm directly, which
works correctly on both x86 and ARM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The distro-qemu tests only need a handful of shared libraries (libc,
libm, ld-linux, libgcc_s) and basic shell utilities. Replace the full
debootstrap rootfs (~150-300MB) with a minimal rootfs that copies just
the needed shared libraries from the host and uses busybox-static for
shell/utilities. This reduces the initramfs from ~50MB to ~5MB and
eliminates the debootstrap download/install step entirely.

The rootfs now contains only:
- busybox (static) for sh, mount, dmesg, poweroff, etc.
- Shared libraries detected via ldd on the test binaries
- libm.so (explicitly copied for rtld dlopen test)
- Test binaries and parcagpu .so

Also removes the DISTRO/RELEASE/MIRROR configuration and sudo
requirements (no more chroot operations).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ::> timing markers to build-and-run.sh to profile where time is
spent: parcagpu download, go test -c, rootfs creation, initramfs
creation, QEMU execution, and per-test timing inside the VM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The initramfs (test binaries + busybox + shared libs) is arch-specific
but kernel-independent. Split into:
- build-distro-qemu-initramfs: builds once per arch, uploads artifact
- distro-qemu-tests: downloads initramfs + kernel, runs QEMU only

This avoids rebuilding Go test binaries and the rootfs for every kernel
version (was ~46s per job on amd64: 27s go build + 15s rootfs + 4s
initramfs). Each test job now only needs QEMU + kernel download.

The build-and-run.sh wrapper is kept for local development convenience.
@gnurizen gnurizen closed this Mar 10, 2026
This was referenced Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant