Skip to content

Commit 8946871

Browse files
committed
jepsen: allow libvirt driver fallback to qemu in CI
1 parent 213c4ae commit 8946871

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/jepsen.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ jobs:
6262
6363
- name: Bring up Jepsen VMs
6464
working-directory: jepsen
65-
run: vagrant up --provider=libvirt
65+
run: |
66+
if [ -r /dev/kvm ] && [ -w /dev/kvm ]; then
67+
echo "KVM is available. Using kvm driver."
68+
export LIBVIRT_DRIVER=kvm
69+
else
70+
echo "KVM is NOT available or not writable. Falling back to qemu driver (slow)."
71+
export LIBVIRT_DRIVER=qemu
72+
fi
73+
vagrant up --provider=libvirt
6674
6775
- name: Run Jepsen workload
6876
working-directory: jepsen

jepsen/Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Vagrant.configure("2") do |config|
3434
kvm.memory = name == :ctrl ? 4096 : 2048
3535
kvm.cpus = 2
3636
# 必要に応じてドライバを指定
37-
kvm.driver = 'kvm'
37+
kvm.driver = ENV['LIBVIRT_DRIVER'] || 'kvm'
3838
end
3939

4040
if name == :ctrl

0 commit comments

Comments
 (0)