Skip to content

Commit

Permalink
Merge pull request containerd#10817 from AkihiroSuda/fix-10816
Browse files Browse the repository at this point in the history
CI: fix vagrant
  • Loading branch information
AkihiroSuda authored Oct 12, 2024
2 parents 08037e7 + 1db0064 commit 61f91b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,30 +563,14 @@ jobs:
# Canonical's Vagrant 2.2.19 dpkg cannot download Fedora 38 image: https://bugs.launchpad.net/vagrant/+bug/2017828
# So we have to install Vagrant >= 2.3.1 from the upstream: https://github.com/opencontainers/runc/blob/v1.1.8/.cirrus.yml#L41-L49
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com jammy main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
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
sudo sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
# we use vagrant from jammy since the sources are not yet available in noble for vagrant
# TODO: once vagrant package sources are available in ubuntu-24 this can be removed
sudo tee -a /etc/apt/sources.list.d/ubuntu.sources <<EOF
Types: deb deb-src
URIs: http://archive.ubuntu.com/ubuntu
Suites: jammy
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF
echo "" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources > /dev/null
# jammy security needs to be added so that the compatible ovmf package can be fetched
sudo tee -a /etc/apt/sources.list.d/ubuntu.sources <<EOF
Types: deb deb-src
URIs: http://security.archive.ubuntu.com/ubuntu
Suites: jammy-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF
sudo apt-get update
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant ovmf=2022.02-3ubuntu0.22.04.2
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant ovmf
# https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1725#issuecomment-1454058646
sudo cp /usr/share/OVMF/OVMF_VARS_4M.fd /var/lib/libvirt/qemu/nvram/
sudo systemctl enable --now libvirtd
sudo apt-get build-dep -y vagrant ruby-libvirt
sudo apt-get build-dep -y ruby-libvirt
sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev
sudo vagrant plugin install vagrant-libvirt
- name: Boot VM
Expand Down
5 changes: 4 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ Vagrant.configure("2") do |config|
v.memory = memory
v.cpus = cpus
v.machine_virtual_size = disk_size
v.loader = "/usr/share/OVMF/OVMF_CODE.fd"
# https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1725#issuecomment-1454058646
# Needs `sudo cp /usr/share/OVMF/OVMF_VARS_4M.fd /var/lib/libvirt/qemu/nvram/`
v.loader = '/usr/share/OVMF/OVMF_CODE_4M.fd'
v.nvram = '/var/lib/libvirt/qemu/nvram/OVMF_VARS_4M.fd'
end

config.vm.synced_folder ".", "/vagrant", type: "rsync"
Expand Down

0 comments on commit 61f91b9

Please sign in to comment.