From de441671f36e08b15c388225d4c8b5fe05257079 Mon Sep 17 00:00:00 2001 From: Nestor Acuna Blanco Date: Mon, 12 Jan 2026 09:22:09 +0100 Subject: [PATCH 1/4] fix: architecture suffix for the fedora-container-image artifact This change introduces a suffix to the built artifact to facilitate multi-architecture image testing. Without this modification, a race condition occurs when the jobs for s390x and x86_64 run in parallel. Signed-off-by: Nestor Acuna Blanco --- .github/workflows/component-builder.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/component-builder.yml b/.github/workflows/component-builder.yml index 8aea9701e8..18df43246e 100644 --- a/.github/workflows/component-builder.yml +++ b/.github/workflows/component-builder.yml @@ -51,12 +51,12 @@ jobs: run: | mkdir -p artifacts podman tag "${local_repository}":"${arch_tag}" "${remote_repository}":"${arch_tag}" - podman save -o artifacts/fedora-image.tar "${remote_repository}":"${arch_tag}" - echo "Saved image to artifacts/fedora-image.tar" + podman save -o artifacts/fedora-image-${{ env.CPU_ARCH }}.tar "${remote_repository}":"${arch_tag}" + echo "Saved image to artifacts/fedora-image-${{ env.CPU_ARCH }}.tar" - name: Upload container image artifact uses: actions/upload-artifact@v6 with: - name: fedora-container-image - path: artifacts/fedora-image.tar + name: fedora-container-image-${{ env.CPU_ARCH }} + path: artifacts/fedora-image-${{ env.CPU_ARCH }}.tar retention-days: 5 compression-level: 0 From dc0ec8561cbe3b99cd629da826dbe11ca22a4d6d Mon Sep 17 00:00:00 2001 From: Nestor Acuna Blanco Date: Mon, 12 Jan 2026 09:33:50 +0100 Subject: [PATCH 2/4] feat: build s390x images in the component builder workflow Most of the code is a copy-paste from the amd64 section. The main difference is that qemu-system-s390x must be installed instead of x86. After the job runs, an s390x artifact should be published. Signed-off-by: Nestor Acuna Blanco --- .github/workflows/component-builder.yml | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/component-builder.yml b/.github/workflows/component-builder.yml index 18df43246e..6dcd4737a4 100644 --- a/.github/workflows/component-builder.yml +++ b/.github/workflows/component-builder.yml @@ -60,3 +60,55 @@ jobs: path: artifacts/fedora-image-${{ env.CPU_ARCH }}.tar retention-days: 5 compression-level: 0 + guest-fedora-s390x: + runs-on: ubuntu-latest + env: + FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.s390x.qcow2 + FEDORA_VERSION: 41 + CPU_ARCH: s390x + FULL_EMULATION: "true" + DEBIAN_FRONTEND: noninteractive + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install dependencies for VM build + run: | + sudo apt-get update + sudo apt-get install -y \ + qemu-system-s390x \ + libvirt-daemon-system \ + virtinst cloud-image-utils \ + libguestfs-tools + - name: Tweak hosted runner to enable 'virt-sysprep' + # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725 + run: sudo chmod 0644 /boot/vmlinuz* + - name: Fetch base Fedora image + working-directory: ./containers/fedora + run: wget -q "https://download.fedoraproject.org/pub/fedora-secondary/releases/41/Cloud/s390x/images/${{ env.FEDORA_IMAGE }}" + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: "0.8.22" + - name: Create VM + working-directory: ./containers/fedora + env: + PYTHONPATH: ${{ github.workspace }} + NO_SECRETS: "true" + run: ./build.sh + - name: Save container image as tarball + env: + local_repository: "localhost/fedora" + remote_repository: "quay.io/openshift-cnv/qe-cnv-tests-fedora-staging" + arch_tag: "${{ env.FEDORA_VERSION }}-${{ env.CPU_ARCH }}" + run: | + mkdir -p artifacts + podman tag "${local_repository}":"${arch_tag}" "${remote_repository}":"${arch_tag}" + podman save -o artifacts/fedora-image-${{ env.CPU_ARCH }}.tar "${remote_repository}":"${arch_tag}" + echo "Saved image to artifacts/fedora-image-${{ env.CPU_ARCH }}.tar" + - name: Upload container image artifact + uses: actions/upload-artifact@v4 + with: + name: fedora-container-image-${{ env.CPU_ARCH }} + path: artifacts/fedora-image-${{ env.CPU_ARCH }}.tar + retention-days: 5 + compression-level: 0 From bab5119e461640fcc5442128c4dfbbf01de430d3 Mon Sep 17 00:00:00 2001 From: Nestor Acuna Blanco Date: Mon, 12 Jan 2026 09:34:08 +0100 Subject: [PATCH 3/4] Refactor: preparation work for Fedora image multiarch publish The build.sh script primarily utilizes environment variables. To generate an image for a new architecture, these variables must be adjusted. This change relocates the generic environment variables to specific steps, facilitating the transition to multiarch building. Signed-off-by: Nestor Acuna Blanco --- .github/workflows/component-builder-publish.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/component-builder-publish.yml b/.github/workflows/component-builder-publish.yml index 7cf5be0823..130def7e98 100644 --- a/.github/workflows/component-builder-publish.yml +++ b/.github/workflows/component-builder-publish.yml @@ -10,12 +10,10 @@ on: workflow_dispatch: jobs: - guest-fedora-amd64: + guest-fedora: runs-on: ubuntu-latest env: - FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 FEDORA_VERSION: 41 - CPU_ARCH: amd64 FULL_EMULATION: "true" DEBIAN_FRONTEND: noninteractive steps: @@ -35,6 +33,8 @@ jobs: - name: Fetch base Fedora image working-directory: ./containers/fedora run: wget -q "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/${{ env.FEDORA_IMAGE }}" + env: + FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 - name: Install uv uses: astral-sh/setup-uv@v7 with: @@ -45,11 +45,14 @@ jobs: PYTHONPATH: ${{ github.workspace }} ORGANIZATION_ID: ${{ secrets.BITWARDEN_ORGANIZATION_ID }} ACCESS_TOKEN: ${{ secrets.BITWARDEN_ACCESS_TOKEN }} + FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 + CPU_ARCH: amd64 run: ./build.sh - name: Logging to quay.io run: podman login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - name: Tag & Push image to staging env: + CPU_ARCH: amd64 local_repository: "localhost/fedora" remote_repository: "quay.io/openshift-cnv/qe-cnv-tests-fedora-staging" arch_tag: "${{ env.FEDORA_VERSION }}-${{ env.CPU_ARCH }}" From 0ff92de455f9e5a38a39153869942a759484429c Mon Sep 17 00:00:00 2001 From: Nestor Acuna Blanco Date: Mon, 12 Jan 2026 09:34:27 +0100 Subject: [PATCH 4/4] feat: Component Builder Publish s390x Enablement This change enables the publication of the Fedora s390x image alongside the amd64 image in a single manifest. To achieve this, the following steps must be taken: 1. Install qemu-system-s390x. 2. Execute build.sh twice with different environment variables. After completing these steps, both the amd64 and s390x images should be added to the manifest. Signed-off-by: Nestor Acuna Blanco --- .../workflows/component-builder-publish.yml | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/component-builder-publish.yml b/.github/workflows/component-builder-publish.yml index 130def7e98..0fd41748f5 100644 --- a/.github/workflows/component-builder-publish.yml +++ b/.github/workflows/component-builder-publish.yml @@ -24,17 +24,23 @@ jobs: sudo apt-get update sudo apt-get install -y \ qemu-system-x86 \ + qemu-system-s390x \ libvirt-daemon-system \ virtinst cloud-image-utils \ libguestfs-tools - name: Tweak hosted runner to enable 'virt-sysprep' # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725 run: sudo chmod 0644 /boot/vmlinuz* - - name: Fetch base Fedora image + - name: Fetch base Fedora amd64 image working-directory: ./containers/fedora run: wget -q "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/${{ env.FEDORA_IMAGE }}" env: FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 + - name: Fetch base Fedora s390x image + working-directory: ./containers/fedora + run: wget -q "https://download.fedoraproject.org/pub/fedora-secondary/releases/41/Cloud/s390x/images/${{ env.FEDORA_IMAGE }}" + env: + FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.s390x.qcow2 - name: Install uv uses: astral-sh/setup-uv@v7 with: @@ -48,17 +54,28 @@ jobs: FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 CPU_ARCH: amd64 run: ./build.sh + - name: Create s390x VM + working-directory: ./containers/fedora + env: + PYTHONPATH: ${{ github.workspace }} + ORGANIZATION_ID: ${{ secrets.BITWARDEN_ORGANIZATION_ID }} + ACCESS_TOKEN: ${{ secrets.BITWARDEN_ACCESS_TOKEN }} + FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.s390x.qcow2 + CPU_ARCH: s390x + run: ./build.sh - name: Logging to quay.io run: podman login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - name: Tag & Push image to staging env: - CPU_ARCH: amd64 local_repository: "localhost/fedora" remote_repository: "quay.io/openshift-cnv/qe-cnv-tests-fedora-staging" - arch_tag: "${{ env.FEDORA_VERSION }}-${{ env.CPU_ARCH }}" + arch_tag_amd64: "${{ env.FEDORA_VERSION }}-amd64" + arch_tag_s390x: "${{ env.FEDORA_VERSION }}-s390x" remote_tag: "${{ env.FEDORA_VERSION }}-dev" run: | - podman tag "${local_repository}":"${arch_tag}" "${remote_repository}":"${arch_tag}" - podman push "${remote_repository}":"${arch_tag}" - podman manifest create --log-level=debug "${remote_repository}":"${remote_tag}" "${remote_repository}":"${arch_tag}" + podman tag "${local_repository}":"${arch_tag_amd64}" "${remote_repository}":"${arch_tag_amd64}" + podman tag "${local_repository}":"${arch_tag_s390x}" "${remote_repository}":"${arch_tag_s390x}" + podman push "${remote_repository}":"${arch_tag_amd64}" + podman push "${remote_repository}":"${arch_tag_s390x}" + podman manifest create --log-level=debug "${remote_repository}":"${remote_tag}" "${remote_repository}":"${arch_tag_amd64}" "${remote_repository}":"${arch_tag_s390x}" podman manifest push "${remote_repository}":"${remote_tag}" --all --format=v2s2