diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index de904f26..5d4e9051 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -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() diff --git a/.gitignore b/.gitignore index a369df7f..b4f9766e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Justfile b/Justfile index ff526af4..f9665cf8 100644 --- a/Justfile +++ b/Justfile @@ -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