feat(ci): add bootc install recipe (#2215)

This makes it easier to test changes that ideally need to be tested on a
fresh system. This is basically copy pasted from Zirconium.

Not uploading the image here as an artifact, I don't think this is too
useful and a bunch of work to resize to make it not suck to download.
But we should still get alerted when we change things that break bootc
install for whatever reason.
This commit is contained in:
renner 2026-05-16 23:09:29 +02:00 committed by GitHub
parent cc444b8d94
commit f7b1854b2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 77 additions and 6 deletions

View file

@ -247,6 +247,22 @@ jobs:
if-no-files-found: error
retention-days: 1
- name: Create Bootable Image
id: bootc-install
# doing other images is not worth it
if: github.event_name == 'pull_request' && matrix.base_name == 'aurora' && matrix.image_flavor == 'main'
# free disk space varies
continue-on-error: true
env:
MATRIX_BASE_NAME: ${{ matrix.base_name }}
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
run: |
sudo -E $(command -v just) disk-image "${MATRIX_BASE_NAME}" \
"${MATRIX_STREAM_NAME}" \
"${MATRIX_IMAGE_FLAVOR}" \
1
- name: PR Testing Instructions
if: github.event_name == 'pull_request'
id: pr-summary
@ -410,6 +426,14 @@ jobs:
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Disk usage summary
if: always()
run: |
echo "### Disk usage" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
df -h >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
check:
name: Check all ${{ matrix.stream_name }} builds successful
if: always()

8
.gitignore vendored
View file

@ -1,14 +1,10 @@
*.iso
*.iso-CHECKSUM
flatpaks_with_deps
flatpak.*
*.img
aurora*.oci
sbom_out
*.sbom
previous.manifest.json
changelog.md
output.env
version.txt
devcontainer

View file

@ -690,6 +690,57 @@ setup-cache $image="aurora" $tag="latest" $flavor="main" $ghcr="0" $github_event
echo "${CACHE_NAME}" "${ALLOW_CACHE_WRITE}"
[group('Utility')]
[private]
bootc $image="aurora" $tag="latest" $flavor="main" *ARGS:
#!/usr/bin/env bash
set -eoux pipefail
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
BOOTC_INSTALL_OPTIONS=()
BOOTC_INSTALL_OPTIONS+=("-v" "/var/lib/containers:/var/lib/containers" "-v" "/etc/containers:/etc/containers")
if [[ -d /sys/fs/selinux ]]; then
BOOTC_INSTALL_OPTIONS+=("-v" "/sys/fs/selinux:/sys/fs/selinux" "--security-opt" "label=type:unconfined_t")
fi
${PODMAN} run \
--rm --privileged --pid=host \
-it \
"${BOOTC_INSTALL_OPTIONS[@]}" \
-v /dev:/dev \
-v "${BUILD_BASE_DIR:-.}:/data" \
localhost/"${image_name}":"${tag}" bootc {{ ARGS }}
# Create bootable image
[group('Utility')]
disk-image $image="aurora" $tag="latest" $flavor="main" ghcr="0" $bootc_fs="btrfs":
#!/usr/bin/env bash
set -eoux pipefail
# this is enough for base aurora to make it more likely to run in CI
if [[ "{{ ghcr }}" == "1" ]]; then
IMG_SIZE=11G
else
# Do a little more locally so you can rebase
IMG_SIZE=30G
fi
BYTES_IMAGE_SIZE=$(numfmt --from=iec ${IMG_SIZE})
if [ ! -e "${BUILD_BASE_DIR:-.}/bootable.img" ]; then
FREE_SPACE=$(findmnt -bno AVAIL -T "${BUILD_BASE_DIR:-.}")
if [ "${FREE_SPACE}" -gt "${BYTES_IMAGE_SIZE}" ]; then
fallocate -l "${BYTES_IMAGE_SIZE}" "${BUILD_BASE_DIR:-.}/bootable.img"
else
echo "not enough disk space available"
exit 1
fi
fi
{{ just }} bootc "${image}" "${tag}" "${flavor}" install to-disk --generic-image --bootloader grub --via-loopback /data/bootable.img --filesystem "${bootc_fs}" --wipe
# # Examples:
# > just retag-nvidia-on-ghcr stable-daily stable-daily-41.20250126.3 0
# > just retag-nvidia-on-ghcr latest latest-41.20250228.1 0