KVM not supported in GitHub Action Runner testing infrastructure. This should be fixed. #787
Labels
cpu-kvm
gem5's KVM CPU
enhancement
github
gem5 files necessary for GitHub integration. Found in ".github"
tests
gem5's Testing Infrastructure
The GitHub Action Runners run inside VMs hosted on servers owned by UC Davis and UW Madison. The GitHub Action Runners are services which run jobs inside the VM, typically inside Docker containers. Ergo, a gem5 compilation and run is executed within a Docker container, created by a GitHub Action Runner, in a VM, on a host machine. Right now this works but the gem5 instances running inside this Docker containers cannot utilized KVM. This means we can't test using KVM with gem5 and KVM-based tests cannot be run on our testing infrastructure.
In this Issue I outline what I attempted to fix this issue and thoughts on moving forward.
Note: all this was done X86 hosts with KVM enabled. I cannot state whether or not ARM KVM would work differently based on these instrucitons.
I attempted to implement KVM by updating the GitHub Action runners with commit 3783aff. It does two simple steps:
Uses the cpu-checker utility's
kvm-ok
command to see if the VM allows for kvm.If
kvm-ok
states that KVM is permitted then it is enabled by the APT installation ofvirt-manager
,libvirt-daemon-system
,virtinst
,libvirt-clients
, andbridge-utils
; the enabling and starting of thelibvirtd
service, and adding thevagrant
user to thekvm
andvagrant
groups.docker run --device /dev/kvm -v$(pwd):/work -w /work --rm ubuntu:22.04 bash -c "apt update -y && apt install -y cpu-checker && kvm-ok"
is run to see if a Docker container running in the VM can use KVM. If this is the case then the GitHub Action Runner is created with thekvm
label.The limitation with this approach is it requires any docker command run in the VM (via the GitHub Action Runner) to create docker containers with the
--device /dev/kvm
argument. Fortunately it is possible to soecify this in the GitHub Action Workflow file.PR #473 tested doing this.
From here I can't remember the exact backs-and-forths i did here but based on the current contents of PR #473, and the status of its tests, I found that the
kvm-ok
command suggests KVM is enabled inside the docker container, but we cannot directly run gem5 KVM scripts. The following error is returned when trying to run./build/ALL/gem5.opt configs/example/gem5_library/x86-ubuntu-run-with-kvm-no-perf.py
:My current guess is we may need to install the KVM dependencies, and perhaps user groups, inside the docker (like in step [2.] above for the VM), though I don't know for sure and no longer have the bandwidth to continue looking into this.
Right now we still have several
kvm
tagged Github Action Runners via the 3783aff commit so #473 can still be used/extended to test stragegies on getting this workingThe text was updated successfully, but these errors were encountered: