Skip to content

Commit 48d3514

Browse files
committed
ci: configure GitHub Actions to use Vagrant with Libvirt provider
1 parent a53308e commit 48d3514

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

.github/workflows/jepsen.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ on:
2121

2222
jobs:
2323
jepsen:
24-
# Requires a self-hosted runner with VirtualBox + Vagrant and at least 12GB RAM free.
25-
runs-on: [self-hosted, virtualbox]
24+
runs-on: ubuntu-latest
2625
timeout-minutes: 120
2726
steps:
2827
- name: Checkout
@@ -35,9 +34,28 @@ jobs:
3534
with:
3635
go-version: "1.25.5"
3736

37+
- name: Setup Vagrant and Libvirt
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils libvirt-dev
41+
42+
# Install Vagrant from HashiCorp
43+
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
44+
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
45+
sudo apt-get update && sudo apt-get install -y vagrant
46+
47+
# Install plugins
48+
vagrant plugin install vagrant-libvirt
49+
vagrant plugin install vagrant-scp
50+
51+
# Configure permissions
52+
sudo usermod -aG libvirt $USER
53+
sudo usermod -aG kvm $USER
54+
sudo chmod 666 /var/run/libvirt/libvirt-sock
55+
3856
- name: Bring up Jepsen VMs
3957
working-directory: jepsen
40-
run: vagrant up
58+
run: vagrant up --provider=libvirt
4159

4260
- name: Run Jepsen workload
4361
working-directory: jepsen
@@ -72,4 +90,4 @@ jobs:
7290
uses: actions/upload-artifact@v4
7391
with:
7492
name: jepsen-results
75-
path: artifacts/results.tgz
93+
path: artifacts/results.tgz

jepsen/Vagrantfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Vagrant.configure("2") do |config|
2323
vb.cpus = 2
2424
end
2525

26+
# Libvirt (Linux/KVM)
27+
node.vm.provider "libvirt" do |lv|
28+
lv.memory = name == :ctrl ? 4096 : 2048
29+
lv.cpus = 2
30+
lv.driver = "kvm"
31+
end
32+
2633
# UTM (Apple Silicon) defaults
2734
node.vm.provider "utm" do |utm|
2835
utm.memory = name == :ctrl ? 4096 : 2048

0 commit comments

Comments
 (0)