-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add job to build on QEMU with the right kernel to be able to use io_u…
…ring (#60) Motivation: Add scripts and job config which will spin up a QEMU VM and run the build on it. This allows us to run all io_uring tests as we can use the right kernel Modifications: - Add scripts - Add config - Add job that builds via QEMU Result: Run unit tests during PR validation
- Loading branch information
1 parent
fd58c22
commit 4cabf21
Showing
11 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
instance-id: io-uring-00 | ||
local-hostname: io-uring-00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#cloud-config | ||
# Set the default user | ||
system_info: | ||
default_user: | ||
name: netty | ||
|
||
# Unlock the default user | ||
chpasswd: | ||
list: | | ||
netty:netty | ||
expire: False | ||
|
||
# Other settings | ||
resize_rootfs: True | ||
ssh_pwauth: True | ||
timezone: Europe/Berlin | ||
|
||
packages: | ||
- java-11-openjdk-devel | ||
- autoconf | ||
- automake | ||
- libtool | ||
- make | ||
- tar | ||
- cifs-utils | ||
- expect | ||
|
||
bootcmd: | ||
- [ mount, -t, cifs, -o, sec=none, //10.0.2.4/qemu/, /mnt ] | ||
|
||
# For expect to know when to log in and begin tests | ||
final_message: "SYSTEM READY TO LOG IN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Expected kernel image as argument" | ||
exit 1 | ||
fi | ||
|
||
KERNEL=linux-5.9.16 | ||
wget -q https://cdn.kernel.org/pub/linux/kernel/v5.x/$KERNEL.tar.xz | ||
tar xf $KERNEL.tar.xz | ||
cd $KERNEL && cp /boot/config-`uname -r`* .config | ||
make ARCH=x86_64 olddefconfig | ||
make -j$(nproc) | ||
cp arch/x86/boot/bzImage $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$#" -ne 5 ]; then | ||
echo "Expected qemu dir, disk image and seed image as argument" | ||
exit 1 | ||
fi | ||
|
||
FILENAME=Fedora-Cloud-Base-33-1.2.x86_64.qcow2 | ||
cp $4 $1/user-data | ||
cp $5 $1/meta-data | ||
|
||
cd $1 | ||
wget -q https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/$FILENAME | ||
qemu-img create -f qcow2 -b $FILENAME $1/$2 20G | ||
genisoimage -output $1/$3 -volid cidata -joliet -rock $1/meta-data $1/user-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Expected build log as argument" | ||
exit 1 | ||
fi | ||
|
||
if grep -q 'BUILD FAILURE' $1 ; then | ||
echo "Build failure detected, please inspect build log" | ||
exit 1 | ||
else | ||
echo "Build successful" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/expect -f | ||
|
||
# Let's use a default timeout of 30 seconds | ||
set timeout 30 | ||
set workspace "$env(GITHUB_WORKSPACE)" | ||
set console {netty@io-uring-00} | ||
set rootConsole {root@io-uring-00} | ||
|
||
set qemudir [lindex $argv 0]; | ||
set disk [lindex $argv 1]; | ||
set seed [lindex $argv 2]; | ||
|
||
# Start up our VM | ||
spawn qemu-system-x86_64 -m 1024 -hda ${qemudir}/${disk} -cdrom ${qemudir}/${seed} -nographic -net nic -net user,smb=${workspace} | ||
|
||
# Set some timeout handling | ||
expect_before timeout { exit 1 } | ||
|
||
# Wait till the VM is completely up. The string here (and the user / password) is configured in user-data. | ||
# We give it 30 minutes as this can be slow (as we also need to install packages etc). | ||
expect -timeout 1800 "SYSTEM READY TO LOG IN" | ||
send "netty\r" | ||
|
||
expect "Password: " | ||
send "netty\r" | ||
|
||
expect $console | ||
send "sudo -s\r" | ||
|
||
expect $rootConsole | ||
send "cd /mnt/\r" | ||
|
||
expect $rootConsole | ||
send "JAVA_HOME=/usr/lib/jvm/java-11 ./mvnw clean package -Dio.netty.testsuite.badHost=netty.io\r" | ||
|
||
# Let's give the build 1 hour before we timeout | ||
expect -timeout 3600 $rootConsole | ||
send "shutdown -h now\r" | ||
|
||
sleep 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters