Skip to content

Commit 4608bc4

Browse files
committed
ci: port Vagrant Fedora Rawhide test to GitHub Actions
Cirrus CI reports "Failed to start an instance: FAILED_PRECONDITION: Monthly compute limit exceeded!" making the Vagrant Fedora Rawhide test unusable. Replace the Cirrus CI Vagrant-based Fedora Rawhide test with a Lima VM-based equivalent in GitHub Actions. This follows the same pattern used by the runc project (lima-vm/lima-actions). The new vagrant-fedora-rawhide-test job: - Starts a Lima Fedora VM with KVM acceleration - Installs the latest vanilla kernel - Reboots the VM to activate the new kernel - Runs the fedora-rawhide CI target inside a podman container The existing fedora-rawhide-test job is kept unchanged as it tests against rawhide userspace on the host kernel, while the new job tests against both rawhide userspace and a vanilla Fedora kernel. Generated with Claude Code (https://claude.ai/code) Signed-off-by: Adrian Reber <areber@redhat.com>
1 parent bce0a3c commit 4608bc4

File tree

3 files changed

+77
-20
lines changed

3 files changed

+77
-20
lines changed

.cirrus.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,6 @@ task:
4848
build_script: |
4949
make -C scripts/ci local SKIP_CI_PREP=1 CC=gcc CD_TO_TOP=1 ZDTM_OPTS="-x zdtm/static/socket-raw"
5050
51-
task:
52-
name: Vagrant Fedora Rawhide based test
53-
environment:
54-
HOME: "/root"
55-
CIRRUS_WORKING_DIR: "/tmp/criu"
56-
57-
compute_engine_instance:
58-
image_project: cirrus-images
59-
image: family/docker-kvm
60-
platform: linux
61-
cpu: 4
62-
memory: 16G
63-
nested_virtualization: true
64-
65-
setup_script: |
66-
contrib/apt-install make gcc pkg-config git perl-modules iproute2 kmod wget cpu-checker
67-
sudo kvm-ok
68-
build_script: |
69-
make -C scripts/ci vagrant-fedora-rawhide
70-
7151
task:
7252
name: Vagrant Fedora based test (non-root)
7353
environment:

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,48 @@ jobs:
131131
# FIXME: https://github.com/containers/podman/issues/14920
132132
run: sudo -E XDG_RUNTIME_DIR= make -C scripts/ci fedora-rawhide CONTAINER_RUNTIME=podman BUILD_OPTIONS="--security-opt seccomp=unconfined"
133133

134+
vagrant-fedora-rawhide-test:
135+
name: Vagrant Fedora Rawhide based test
136+
needs: [alpine-test]
137+
runs-on: ubuntu-24.04
138+
timeout-minutes: 60
139+
steps:
140+
- uses: actions/checkout@v4
141+
- name: Install Lima
142+
uses: lima-vm/lima-actions/setup@v1
143+
- name: Cache Lima images
144+
uses: actions/cache@v4
145+
with:
146+
path: ~/.cache/lima
147+
key: lima-fedora-${{ github.sha }}
148+
restore-keys: lima-fedora-
149+
- name: Enable KVM
150+
run: |
151+
sudo apt-get -y install qemu-system-x86
152+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
153+
| sudo tee /etc/udev/rules.d/99-kvm.rules
154+
sudo udevadm control --reload-rules
155+
sudo udevadm trigger --name-match=kvm
156+
- name: Start Fedora VM
157+
run: limactl start --plain --name=default --cpus=4 --memory=4 template://fedora
158+
- name: Copy source into VM
159+
run: |
160+
lima sudo mkdir -p /home/criu
161+
lima sudo chown "$(lima whoami)" /home/criu
162+
limactl copy -r . default:/home/criu
163+
- name: Setup VM
164+
run: lima sudo /home/criu/scripts/ci/lima-fedora-rawhide.sh setup
165+
- name: Reboot VM to activate new kernel
166+
run: |
167+
limactl stop default
168+
limactl start default
169+
- name: Show VM info
170+
run: |
171+
lima uname -a
172+
lima cat /proc/cmdline
173+
- name: Run tests
174+
run: ssh -tt lima-default sudo -i /home/criu/scripts/ci/lima-fedora-rawhide.sh test
175+
134176
gcov-test:
135177
needs: [alpine-test]
136178
runs-on: ubuntu-22.04

scripts/ci/lima-fedora-rawhide.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# This script runs inside a Lima Fedora VM to set up and run
4+
# the Fedora Rawhide based CI tests with a vanilla kernel.
5+
# It mirrors the logic from vagrant.sh's setup() and fedora-rawhide().
6+
7+
set -e
8+
set -x
9+
10+
CRIU_DIR="${CRIU_DIR:-/home/criu}"
11+
12+
setup() {
13+
# Disable sssd to avoid zdtm test failures in pty04 due to sssd socket
14+
systemctl mask sssd
15+
16+
# Upgrade the kernel to the latest vanilla one
17+
dnf -y copr enable @kernel-vanilla/stable
18+
# The shellcheck tool misunderstands the "do" to be from a loop
19+
# shellcheck disable=SC1010
20+
dnf -y do --action=upgrade \* --action=install make podman
21+
}
22+
23+
test() {
24+
# Some tests in the container need selinux to be disabled.
25+
# In the container it is not possible to change the state of selinux.
26+
# Let's just disable it for this test run completely.
27+
setenforce Permissive
28+
29+
cd "${CRIU_DIR}"
30+
make -C scripts/ci fedora-rawhide \
31+
CONTAINER_RUNTIME=podman \
32+
BUILD_OPTIONS="--security-opt seccomp=unconfined"
33+
}
34+
35+
"$@"

0 commit comments

Comments
 (0)