Skip to content

Commit 6d7377e

Browse files
committed
Test latest Fedora kernels from fc32-41
This improves the CI by running quark-test on all fedora versions. krun-fedora.sh downloads the latest kernel rpm of the specified version, unpacks and runs krun.sh on it. When Fedora updates its rpms, we end up getting the updated version. This also enables nested virtualization on the CI so we can run things on qemu super fast, <1min as opposed to 5-10min on the worst case, the most important bit is that it fixes some flaky tests that would time out. Prompted by a question from @andrewkroh Many thanks to @mjwolf for pointing me to the allowed GCP options in buildkite.
1 parent 1ad610a commit 6d7377e

File tree

5 files changed

+203
-3
lines changed

5 files changed

+203
-3
lines changed

.buildkite/pipeline.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ steps:
22
- label: "build amd64 in docker"
33
key: make_docker
44
command: "make docker"
5+
artifact_paths:
6+
- "initramfs.gz"
57
agents:
68
image: family/core-ubuntu-2204
79
provider: gcp
@@ -34,3 +36,114 @@ steps:
3436
image: family/core-ubuntu-2204
3537
provider: gcp
3638
machineType: n2-standard-2
39+
enableNestedVirtualization: true
40+
41+
- label: "quark-test on fedora 32"
42+
key: test_fedora_32
43+
command: "./.buildkite/runtest_fedora.sh 32"
44+
depends_on:
45+
- make_docker
46+
agents:
47+
image: family/core-ubuntu-2204
48+
provider: gcp
49+
machineType: n2-standard-2
50+
enableNestedVirtualization: true
51+
52+
- label: "quark-test on fedora 33"
53+
key: test_fedora_33
54+
command: "./.buildkite/runtest_fedora.sh 33"
55+
depends_on:
56+
- make_docker
57+
agents:
58+
image: family/core-ubuntu-2204
59+
provider: gcp
60+
machineType: n2-standard-2
61+
enableNestedVirtualization: true
62+
63+
- label: "quark-test on fedora 34"
64+
key: test_fedora_34
65+
command: "./.buildkite/runtest_fedora.sh 34"
66+
depends_on:
67+
- make_docker
68+
agents:
69+
image: family/core-ubuntu-2204
70+
provider: gcp
71+
machineType: n2-standard-2
72+
enableNestedVirtualization: true
73+
74+
- label: "quark-test on fedora 35"
75+
key: test_fedora_35
76+
command: "./.buildkite/runtest_fedora.sh 35"
77+
depends_on:
78+
- make_docker
79+
agents:
80+
image: family/core-ubuntu-2204
81+
provider: gcp
82+
machineType: n2-standard-2
83+
enableNestedVirtualization: true
84+
85+
- label: "quark-test on fedora 36"
86+
key: test_fedora_36
87+
command: "./.buildkite/runtest_fedora.sh 36"
88+
depends_on:
89+
- make_docker
90+
agents:
91+
image: family/core-ubuntu-2204
92+
provider: gcp
93+
machineType: n2-standard-2
94+
enableNestedVirtualization: true
95+
96+
- label: "quark-test on fedora 37"
97+
key: test_fedora_37
98+
command: "./.buildkite/runtest_fedora.sh 37"
99+
depends_on:
100+
- make_docker
101+
agents:
102+
image: family/core-ubuntu-2204
103+
provider: gcp
104+
machineType: n2-standard-2
105+
enableNestedVirtualization: true
106+
107+
- label: "quark-test on fedora 38"
108+
key: test_fedora_38
109+
command: "./.buildkite/runtest_fedora.sh 38"
110+
depends_on:
111+
- make_docker
112+
agents:
113+
image: family/core-ubuntu-2204
114+
provider: gcp
115+
machineType: n2-standard-2
116+
enableNestedVirtualization: true
117+
118+
- label: "quark-test on fedora 39"
119+
key: test_fedora_39
120+
command: "./.buildkite/runtest_fedora.sh 39"
121+
depends_on:
122+
- make_docker
123+
agents:
124+
image: family/core-ubuntu-2204
125+
provider: gcp
126+
machineType: n2-standard-2
127+
enableNestedVirtualization: true
128+
129+
- label: "quark-test on fedora 40"
130+
key: test_fedora_40
131+
command: "./.buildkite/runtest_fedora.sh 40"
132+
depends_on:
133+
- make_docker
134+
agents:
135+
image: family/core-ubuntu-2204
136+
provider: gcp
137+
machineType: n2-standard-2
138+
enableNestedVirtualization: true
139+
140+
- label: "quark-test on fedora 41"
141+
key: test_fedora_41
142+
command: "./.buildkite/runtest_fedora.sh 41"
143+
depends_on:
144+
- make_docker
145+
agents:
146+
image: family/core-ubuntu-2204
147+
provider: gcp
148+
machineType: n2-standard-2
149+
enableNestedVirtualization: true

.buildkite/runtest_fedora.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
FEDORAVER="$1"
6+
7+
function download {
8+
buildkite-agent artifact download "$1" "$2"
9+
}
10+
11+
if [ -z "${BUILDKITE}" ]; then
12+
echo "This script doesn't appear to be running in buildkite" 1>&2
13+
echo "refusing to continue" 1>&2
14+
exit 1
15+
fi
16+
17+
download initramfs.gz .
18+
19+
echo updating packages...
20+
sudo apt-get -qq update -y
21+
echo installing packages...
22+
sudo apt-get -qq install -y --no-install-recommends \
23+
cpio \
24+
cpu-checker \
25+
lynx \
26+
qemu-system-x86 \
27+
qemu-kvm \
28+
rpm2cpio \
29+
> /dev/null
30+
31+
# Make sure we can run things on KVM
32+
sudo kvm-ok
33+
34+
# Run Forrest Run
35+
sudo ./krun-fedora.sh initramfs.gz $FEDORAVER quark-test
36+
37+
exit $?

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ DOCKER_RUN_ARGS=$(QDOCKER) \
222222

223223
docker: docker-image clean-all
224224
$(call msg,DOCKER-RUN,Dockerfile)
225-
$(Q)$(DOCKER) run $(DOCKER_RUN_ARGS) /bin/bash -c "make -C $(PWD)"
225+
$(Q)$(DOCKER) run $(DOCKER_RUN_ARGS) /bin/bash -c "make -C $(PWD) all initramfs.gz"
226226

227227
docker-cross-arm64: clean-all docker-image manpages.h
228228
$(call msg,DOCKER-RUN,Dockerfile)

krun-fedora.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
SCRIPT=${0##*/}
6+
7+
function usage
8+
{
9+
echo "usage: $SCRIPT initramfs.gz FEDORAVERSION command" 1>&2
10+
exit 1
11+
}
12+
13+
if [ $# -lt 3 ]; then
14+
usage
15+
fi
16+
17+
INITRAMFS="$1"
18+
FEDORAVER="$2"
19+
shift 2
20+
21+
case $FEDORAVER in
22+
2?|3?) URL="https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/$FEDORAVER/Everything/x86_64/Packages/k";;
23+
4?) URL="http://ftp.fau.de/fedora/linux/updates/$FEDORAVER/Everything/x86_64/Packages/k";;
24+
*) echo bad version "$FEDORAVER" 1>&2
25+
esac
26+
27+
TMPDIR=$(mktemp -d "/tmp/$SCRIPT.XXXXXXXXXX")
28+
trap 'rm -rf "$TMPDIR"' EXIT
29+
30+
RPMURL=$(lynx -dump -listonly "$URL"|grep kernel-core)
31+
RPMURL=${RPMURL##* }
32+
RPM=$(basename "$RPMURL")
33+
VMLINUZ=${RPM##kernel-core-}
34+
VMLINUZ=${VMLINUZ%%.rpm}
35+
VMLINUZ=$TMPDIR/lib/modules/$VMLINUZ/vmlinuz
36+
37+
# echo URL $URL
38+
# echo RPMURL $RPMURL
39+
# echo RPM $RPM
40+
# echo VMLINUZ $VMLINUZ
41+
42+
cd "$TMPDIR"
43+
curl -s "$RPMURL" | rpm2cpio - | cpio -idm
44+
cd -
45+
46+
./krun.sh "$INITRAMFS" "$VMLINUZ" "$@"

krun.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ cmdline="$*"
2121
function qemu {
2222
case "$(file -b "$kernel" | awk '{print $3}')" in
2323
x86)
24+
kvm=""
25+
if grep -qw vmx /proc/cpuinfo && [ -e /dev/kvm ]; then
26+
kvm="-enable-kvm"
27+
fi
2428
qemu-system-x86_64 \
2529
-m 256M \
26-
-enable-kvm \
2730
-initrd "$initramfs" \
2831
-kernel "$kernel" \
2932
-nographic \
30-
--append "console=ttyS0 quiet TERM=dumb $cmdline"
33+
--append "console=ttyS0 quiet TERM=dumb $cmdline" \
34+
$kvm
3135
;;
3236
ARM64)
3337
qemu-system-aarch64 \

0 commit comments

Comments
 (0)