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

This commit is contained in:
2025-07-27 22:05:09 +10:00
parent 27e33ebdf6
commit c3c6aa833a

View File

@ -54,6 +54,20 @@ jobs:
run: | run: |
mkdir -p \ mkdir -p \
ubuntu-vm ubuntu-vm
- name: Assert source Ubuntu ISO
run: |
# TODO: Make this path configurable in a yaml file
# TODO: Add checksum verification
# d6dab0c3a657988501b4bd76f1297c053df710e06e0c3aece60dead24f270b4d *ubuntu-24.04.2-live-server-amd64.iso
[[ -f '/iso/Canonical/Ubuntu Server 24.04/ubuntu-24.04.2-live-server-amd64.iso' ]] && {
echo 'Source iso file exists - creating symbolic link'
ln -s "/iso/Canonical/Ubuntu Server 24.04/ubuntu-24.04.2-live-server-amd64.iso" ubuntu-vm/ubuntu.iso
ls ubuntu-vm -lash
} || {
echo 'Missing source iso file - exiting'; exit 1
}
- name: Generate seed ISO - name: Generate seed ISO
run: | run: |
apt-get update && \ apt-get update && \
@ -72,12 +86,6 @@ jobs:
env: env:
ROOT_HASHED_PASSWORD: ${{ secrets.ROOT_HASHED_PASSWORD }} ROOT_HASHED_PASSWORD: ${{ secrets.ROOT_HASHED_PASSWORD }}
PUBLIC_SSHKEY: ${{ secrets.PUBLIC_SSHKEY }} 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 - name: Create empty QCOW2 disk
run: | run: |
apt-get update && \ apt-get update && \
@ -86,10 +94,16 @@ jobs:
qemu-img create -f qcow2 ubuntu-vm/ubuntu.qcow2 10G qemu-img create -f qcow2 ubuntu-vm/ubuntu.qcow2 10G
- name: Run virt-install - name: Run virt-install
# container: quay.io/kubevirt/libvirt
run: | run: |
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y \
virtinst libvirt-daemon-system \
libvirt-clients \
virtinst \
qemu-utils
libvirtd -d
virt-install \ virt-install \
--name ubuntu-harvester \ --name ubuntu-harvester \
@ -97,7 +111,7 @@ jobs:
--vcpus 2 \ --vcpus 2 \
--disk path=ubuntu-vm/ubuntu.qcow2,size=10,format=qcow2 \ --disk path=ubuntu-vm/ubuntu.qcow2,size=10,format=qcow2 \
--disk path=ubuntu-vm/seed.iso,device=cdrom \ --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 \ --os-variant ubuntu24.04 \
--graphics none \ --graphics none \
--network network=default \ --network network=default \