GenericCloud: Test Image #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "GenericCloud: Test Image" | |
| # Required repository configuration: | |
| # secrets: MATTERMOST_WEBHOOK_URL | |
| # vars: MATTERMOST_CHANNEL | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| image_url: | |
| description: "URL to the GenericCloud .qcow2 image (build's public S3 URL or repo.almalinux.org)" | |
| required: true | |
| type: string | |
| default: '' | |
| notify_mattermost: | |
| description: "Send notification to Mattermost" | |
| required: true | |
| type: boolean | |
| default: true | |
| jobs: | |
| init-data: | |
| name: "Parse image URL" | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| image_filename: ${{ steps.parse.outputs.image_filename }} | |
| subtype: ${{ steps.parse.outputs.subtype }} | |
| alma_major: ${{ steps.parse.outputs.alma_major }} | |
| alma_version: ${{ steps.parse.outputs.alma_version }} | |
| alma_date: ${{ steps.parse.outputs.alma_date }} | |
| alma_arch: ${{ steps.parse.outputs.alma_arch }} | |
| alma_arch_full: ${{ steps.parse.outputs.alma_arch_full }} | |
| release_string: ${{ steps.parse.outputs.release_string }} | |
| steps: | |
| - name: Validate and parse image URL | |
| id: parse | |
| env: | |
| IMAGE_URL: ${{ inputs.image_url }} | |
| run: | | |
| if [[ ! "${IMAGE_URL}" =~ ^https?:// ]]; then | |
| echo "[Error] image_url must be an http(s) URL" | |
| exit 1 | |
| fi | |
| IMAGE_FILENAME="${IMAGE_URL##*/}" | |
| # Two URL shapes are accepted: | |
| # 1. Build pipeline S3 layout (per .github/scripts/resolve-image-config.sh): | |
| # .../gencloud/<timestamp>/<filename> | |
| # .../gencloud_ext4/<timestamp>/<filename> | |
| # Subtype is read from the path segment (gencloud and | |
| # gencloud_ext4 share the on-disk filename here). | |
| # 2. Official repo (repo.almalinux.org) layout: | |
| # .../cloud/<arch>/images/<filename> | |
| # Subtype is read from the filename: the publish step | |
| # renames the ext4 variant to AlmaLinux-...-GenericCloud-ext4-... | |
| if [[ "${IMAGE_URL}" == */gencloud_ext4/* ]] \ | |
| || [[ "${IMAGE_FILENAME}" == *-GenericCloud-ext4-* ]]; then | |
| SUBTYPE=gencloud_ext4 | |
| elif [[ "${IMAGE_URL}" == */gencloud/* ]] \ | |
| || [[ "${IMAGE_URL}" =~ /cloud/(x86_64|aarch64)/images/ ]]; then | |
| SUBTYPE=gencloud | |
| else | |
| echo "[Error] URL path must contain one of:" | |
| echo " '/gencloud/' or '/gencloud_ext4/' (build pipeline S3 layout)" | |
| echo " '/cloud/<arch>/images/' (repo.almalinux.org layout)" | |
| exit 1 | |
| fi | |
| # Stable: AlmaLinux-10-GenericCloud-10.1-20260502.0.x86_64.qcow2 | |
| # Stable ext4 (repo.almalinux.org): AlmaLinux-10-GenericCloud-ext4-10.1-20260501.0.x86_64.qcow2 | |
| # Kitten: AlmaLinux-Kitten-GenericCloud-10-20260502.0.x86_64.qcow2 | |
| # Kitten v2 microarch: AlmaLinux-Kitten-GenericCloud-10-20260501.0.x86_64_v2.qcow2 | |
| # Optional segments: | |
| # '-ext4' ext4 variant (present in repo.almalinux.org filenames) | |
| # '.<iter>' same-day re-run iteration on the datestamp | |
| # '_v2' x86_64_v2 microarchitecture-level variant (AL10 / Kitten) | |
| # ALMA_ARCH is captured as the base arch only (x86_64 / aarch64) | |
| # so the QEMU case statement and the in-VM rpm arch grep stay | |
| # correct; the optional '_v2' is allowed but not extracted. | |
| re_stable='^AlmaLinux-([0-9]+)-GenericCloud(-ext4)?-([0-9]+\.[0-9]+)-([0-9]+(\.[0-9]+)?)\.(x86_64|aarch64)(_v2)?\.qcow2$' | |
| re_kitten='^AlmaLinux-Kitten-GenericCloud(-ext4)?-([0-9]+)-([0-9]+(\.[0-9]+)?)\.(x86_64|aarch64)(_v2)?\.qcow2$' | |
| if [[ "${IMAGE_FILENAME}" =~ ${re_stable} ]]; then | |
| ALMA_MAJOR="${BASH_REMATCH[1]}" | |
| ALMA_VERSION="${BASH_REMATCH[3]}" | |
| ALMA_DATE="${BASH_REMATCH[4]}" | |
| ALMA_ARCH="${BASH_REMATCH[6]}" | |
| ARCH_VARIANT="${BASH_REMATCH[7]:-}" | |
| RELEASE_STRING="AlmaLinux release ${ALMA_VERSION}" | |
| elif [[ "${IMAGE_FILENAME}" =~ ${re_kitten} ]]; then | |
| ALMA_MAJOR="${BASH_REMATCH[2]}" | |
| ALMA_VERSION="${ALMA_MAJOR}" | |
| ALMA_DATE="${BASH_REMATCH[3]}" | |
| ALMA_ARCH="${BASH_REMATCH[5]}" | |
| ARCH_VARIANT="${BASH_REMATCH[6]:-}" | |
| RELEASE_STRING="AlmaLinux Kitten release ${ALMA_MAJOR}" | |
| else | |
| echo "[Error] Unexpected GenericCloud filename: '${IMAGE_FILENAME}'" | |
| echo "Expected:" | |
| echo " AlmaLinux-<major>-GenericCloud[-ext4]-<version>-<datestamp>[.<iter>].<arch>[_v2].qcow2" | |
| echo " AlmaLinux-Kitten-GenericCloud[-ext4]-<major>-<datestamp>[.<iter>].<arch>[_v2].qcow2" | |
| exit 1 | |
| fi | |
| # alma_arch is the base arch (x86_64 or aarch64) used by the | |
| # QEMU case statement and runner-selection expression. | |
| # alma_arch_full carries the optional '_v2' microarch suffix | |
| # (so x86_64_v2 stays distinct from x86_64) and is what the | |
| # in-VM rpm-arch assertion greps for - the almalinux-release | |
| # package on a v2 build reports %{ARCH} as x86_64_v2. | |
| ALMA_ARCH_FULL="${ALMA_ARCH}${ARCH_VARIANT}" | |
| echo "Image filename: ${IMAGE_FILENAME}" | |
| echo "Subtype: ${SUBTYPE}" | |
| echo "AlmaLinux major: ${ALMA_MAJOR}" | |
| echo "AlmaLinux ver: ${ALMA_VERSION}" | |
| echo "Datestamp: ${ALMA_DATE}" | |
| echo "Architecture: ${ALMA_ARCH} (full: ${ALMA_ARCH_FULL})" | |
| echo "Release string: ${RELEASE_STRING}" | |
| { | |
| echo "image_filename=${IMAGE_FILENAME}" | |
| echo "subtype=${SUBTYPE}" | |
| echo "alma_major=${ALMA_MAJOR}" | |
| echo "alma_version=${ALMA_VERSION}" | |
| echo "alma_date=${ALMA_DATE}" | |
| echo "alma_arch=${ALMA_ARCH}" | |
| echo "alma_arch_full=${ALMA_ARCH_FULL}" | |
| echo "release_string=${RELEASE_STRING}" | |
| } >> "$GITHUB_OUTPUT" | |
| test-x86_64: | |
| name: "Test GenericCloud x86_64 image" | |
| needs: [init-data] | |
| if: needs.init-data.outputs.alma_arch == 'x86_64' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/gencloud-test-steps | |
| with: | |
| image_url: ${{ inputs.image_url }} | |
| image_filename: ${{ needs.init-data.outputs.image_filename }} | |
| subtype: ${{ needs.init-data.outputs.subtype }} | |
| alma_arch: ${{ needs.init-data.outputs.alma_arch }} | |
| alma_arch_full: ${{ needs.init-data.outputs.alma_arch_full }} | |
| release_string: ${{ needs.init-data.outputs.release_string }} | |
| notify_mattermost: ${{ inputs.notify_mattermost }} | |
| MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | |
| MATTERMOST_CHANNEL: ${{ vars.MATTERMOST_CHANNEL }} | |
| test-aarch64: | |
| name: "Test GenericCloud aarch64 image" | |
| needs: [init-data] | |
| if: needs.init-data.outputs.alma_arch == 'aarch64' | |
| # AlmaLinux org uses RunsOn metal arm64; forks fall back to the | |
| # GitHub-hosted ubuntu-24.04-arm runner. The compute action's first | |
| # step asserts /dev/kvm is present and fails fast otherwise. | |
| runs-on: >- | |
| ${{ | |
| github.repository_owner == 'AlmaLinux' && | |
| format('runs-on={0}/family=c7i.metal-24xl+c7a.metal-48xl+*8gd.metal*/image=ubuntu24-full-arm64', github.run_id) | |
| || | |
| 'ubuntu-24.04-arm' | |
| }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/gencloud-test-steps | |
| with: | |
| image_url: ${{ inputs.image_url }} | |
| image_filename: ${{ needs.init-data.outputs.image_filename }} | |
| subtype: ${{ needs.init-data.outputs.subtype }} | |
| alma_arch: ${{ needs.init-data.outputs.alma_arch }} | |
| alma_arch_full: ${{ needs.init-data.outputs.alma_arch_full }} | |
| release_string: ${{ needs.init-data.outputs.release_string }} | |
| notify_mattermost: ${{ inputs.notify_mattermost }} | |
| MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | |
| MATTERMOST_CHANNEL: ${{ vars.MATTERMOST_CHANNEL }} |