From db588f7683ed8a33947e4bd5116ba561786e9925 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Wed, 2 Jul 2025 17:04:32 +0200 Subject: [PATCH 1/3] Update RHEL SAP VMs for tests --- ansible/group_vars/all.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 5a97210445..325fbdc199 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -59,8 +59,12 @@ virtual_machines: rhel-sap: project: rhel-sap-cloud families: - - rhel-8-4-sap-ha - rhel-8-6-sap-ha + - rhel-8-8-sap-ha + - rhel-8-10-sap-ha + - rhel-9-0-sap-ha + - rhel-9-2-sap-ha + - rhel-9-4-sap-ha # RHEL SAP 8.4 seems to have an older version of podman that # fails with our integration tests, so we stick with docker # for now. From 02fa081971090d78ab01f25e9ba8114ebff4837b Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 3 Jul 2025 10:10:58 +0200 Subject: [PATCH 2/3] Use podman on RHEL-SAP --- ansible/group_vars/all.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 325fbdc199..e4edb68399 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -65,10 +65,7 @@ virtual_machines: - rhel-9-0-sap-ha - rhel-9-2-sap-ha - rhel-9-4-sap-ha - # RHEL SAP 8.4 seems to have an older version of podman that - # fails with our integration tests, so we stick with docker - # for now. - container_engine: docker + container_engine: podman rhcos: project: rhcos-cloud From a082a38132f0c7c9dfeb39d2d4f7cfb91a260037 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 3 Jul 2025 13:13:46 +0200 Subject: [PATCH 3/3] Fetch VM families from GCP for testing Few times over the last couple of years we have found ourselves having to update the list of VMs we use for testing manually when a family is added or removed from GCP. This is an annoying process that also turns our CI red until we get it done when an image is removed. With this change, the list of VM images to be used for RHEL and Ubuntu will be directly retrieved from GCP with a script. --- ansible/group_vars/all.yml | 18 ++---- ansible/scripts/fetch_gcp_families.sh | 86 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 13 deletions(-) create mode 100755 ansible/scripts/fetch_gcp_families.sh diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index e4edb68399..fc8ebd3cc6 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -28,8 +28,7 @@ virtual_machines: rhel: project: rhel-cloud families: - - rhel-8 - - rhel-9 + "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_gcp_families.sh -a X86_64 -p rhel-cloud') }}" container_engine: podman rhel-arm64: @@ -37,7 +36,7 @@ virtual_machines: arch: arm64 machine_type: t2a-standard-2 families: - - rhel-9-arm64 + "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_gcp_families.sh -a ARM64 -p rhel-cloud') }}" container_engine: podman rhel-s390x: @@ -59,12 +58,7 @@ virtual_machines: rhel-sap: project: rhel-sap-cloud families: - - rhel-8-6-sap-ha - - rhel-8-8-sap-ha - - rhel-8-10-sap-ha - - rhel-9-0-sap-ha - - rhel-9-2-sap-ha - - rhel-9-4-sap-ha + "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_gcp_families.sh -a X86_64 -p rhel-sap-cloud') }}" container_engine: podman rhcos: @@ -141,16 +135,14 @@ virtual_machines: ubuntu-os: project: ubuntu-os-cloud families: - - ubuntu-2204-lts - - ubuntu-2404-lts-amd64 + "{{ lookup('ansible.builtin.pipe', \"scripts/fetch_gcp_families.sh -f '^ubuntu-\\d+-lts(-amd64)?$'\") }}" ubuntu-arm: project: ubuntu-os-cloud arch: arm64 machine_type: t2a-standard-2 families: - - ubuntu-2204-lts-arm64 - - ubuntu-2404-lts-arm64 + "{{ lookup('ansible.builtin.pipe', \"scripts/fetch_gcp_families.sh -f '^ubuntu-\\d+-lts-arm64$'\") }}" ubuntu-os-pro: project: ubuntu-os-pro-cloud diff --git a/ansible/scripts/fetch_gcp_families.sh b/ansible/scripts/fetch_gcp_families.sh new file mode 100755 index 0000000000..9848a24d5f --- /dev/null +++ b/ansible/scripts/fetch_gcp_families.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +set -euo pipefail + +function usage() { + echo "$0 [OPTIONS]" + echo "" + echo "[OPTIONS]" + echo " -a, --arch" + echo " Architecture wanted for the listed images" + echo " -p, --project" + echo " Project the image is hosted in" + echo " -f, --family" + echo " Regular expression for the image family to be listed" +} + +TEMP=$(getopt -o 'ha:p:f:' -l 'help,arch,project,family' -n "$0" -- "$@") + +# shellcheck disable=SC2181 +if [ $? -ne 0 ]; then + exit 1 +fi + +eval set -- "$TEMP" +unset TEMP + +arch="" +family="" +project="" +filter="" +using_regex=0 +using_aip=0 + +while true; do + case "${1:-}" in + '-h' | '--help') + usage + exit 0 + ;; + + '-a' | '--arch') + arch="architecture=$2" + using_aip=1 + shift 2 + ;; + + '-p' | '--project') + project="selfLink=/$2/" + using_aip=1 + shift 2 + ;; + + '-f' | '--family') + family="family ~ \"$2\"" + using_regex=1 + shift 2 + ;; + + '--') + shift + break + ;; + esac +done + +if ((using_regex != 0 && using_aip != 0)); then + echo >&2 "Mixing regex and AIP-160 is not supported in gcloud filters" + echo >&2 "see: https://cloud.google.com/compute/docs/reference/rest/v1/images/list" + exit 1 +elif ((using_regex != 0)); then + filter="$family" +elif ((using_aip != 0)); then + if [[ -n "$project" ]]; then + filter="$project" + if [[ -n "$arch" ]]; then + filter="$filter AND $arch" + fi + elif [[ -n "$arch" ]]; then + filter="$arch" + fi +fi + +gcloud compute images list \ + --format='json(family)' \ + --filter="$filter" \ + --limit 10 | jq -cM '[ .[].family ]'