build: Explicitly start libvirt daemon in container
Some checks failed
build-image / Build image (push) Failing after 20m46s

This commit is contained in:
2025-07-28 11:22:26 +10:00
parent 27e33ebdf6
commit 025cfe01d0

View File

@ -54,6 +54,19 @@ jobs:
run: |
mkdir -p \
ubuntu-vm
- name: Cache source iso
id: cache-iso
uses: actions/cache@v4
with:
path: ubuntu-vm/ubuntu.iso
key: ubuntu-24.04.2-live-server-amd64
- if: ${{ steps.cache-iso.outputs.cache-hit != 'true' }}
name: Download source Ubuntu iso
continue-on-error: true
run: |
curl -L -o ubuntu-vm/ubuntu.iso https://releases.ubuntu.com/24.04/ubuntu-24.04.2-live-server-amd64.iso
- name: Generate seed ISO
run: |
apt-get update && \
@ -72,12 +85,6 @@ jobs:
env:
ROOT_HASHED_PASSWORD: ${{ secrets.ROOT_HASHED_PASSWORD }}
PUBLIC_SSHKEY: ${{ secrets.PUBLIC_SSHKEY }}
- name: Assert source Ubuntu ISO
run: |
# TODO: Make this path configurable in a yaml file
[[ ! -f '/iso/Canonical/Ubuntu Server 24.04/ubuntu-24.04.2-desktop-amd64.iso' ]] || {
echo 'Missing source iso file - exiting'; exit 1
}
- name: Create empty QCOW2 disk
run: |
apt-get update && \
@ -86,10 +93,16 @@ jobs:
qemu-img create -f qcow2 ubuntu-vm/ubuntu.qcow2 10G
- name: Run virt-install
# container: quay.io/kubevirt/libvirt
run: |
apt-get update && \
apt-get install -y \
virtinst
libvirt-daemon-system \
libvirt-clients \
virtinst \
qemu-utils
libvirtd -d
virt-install \
--name ubuntu-harvester \
@ -97,7 +110,7 @@ jobs:
--vcpus 2 \
--disk path=ubuntu-vm/ubuntu.qcow2,size=10,format=qcow2 \
--disk path=ubuntu-vm/seed.iso,device=cdrom \
--cdrom '/iso/Canonical/Ubuntu Server 24.04/ubuntu-24.04.2-desktop-amd64.iso' \
--cdrom ubuntu-vm/ubuntu.iso \
--os-variant ubuntu24.04 \
--graphics none \
--network network=default \