Skip to content

GenericCloud: Test Image #11

GenericCloud: Test Image

GenericCloud: Test Image #11

Workflow file for this run

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 }}
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
# The trailing '.<iter>' on the datestamp is optional (matches
# the same shape oci-test.yml accepts for Compute Image names).
# The '-ext4' segment is also optional - present in repo.almalinux.org
# filenames for the ext4 variant, absent in build pipeline filenames.
re_stable='^AlmaLinux-([0-9]+)-GenericCloud(-ext4)?-([0-9]+\.[0-9]+)-([0-9]+(\.[0-9]+)?)\.(x86_64|aarch64)\.qcow2$'
re_kitten='^AlmaLinux-Kitten-GenericCloud(-ext4)?-([0-9]+)-([0-9]+(\.[0-9]+)?)\.(x86_64|aarch64)\.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]}"
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]}"
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>.qcow2"
echo " AlmaLinux-Kitten-GenericCloud[-ext4]-<major>-<datestamp>[.<iter>].<arch>.qcow2"
exit 1
fi
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}"
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 "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 }}
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 }}
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 }}