From eb0ad2a73a33a22a9216a9563fe7e69cae718803 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 09:30:17 -0400 Subject: [PATCH 01/14] Exclude prerelease versions from krew release bot PRs Signed-off-by: Joseph --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9085c173..1b371445 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -193,6 +193,8 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + + # Skip this step if it is not a clean semver: eg if it has -beta, or any other suffix, do not run - name: Update new version in krew-index + if: ${{!contains(github.ref_name, '-') && !contains(github.ref_name, '+')}} uses: rajatjindal/krew-release-bot@v0.0.46 \ No newline at end of file From d74548e60099e219644ad4e5b9699482968d844f Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 10:09:48 -0400 Subject: [PATCH 02/14] quay oadp-cli-binaries push multiarch Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 37379008..a2c9672b 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -17,14 +17,22 @@ jobs: - name: Podman login run: podman login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Podman build and tag run: | - podman build -f Dockerfile.download \ - -t quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} \ - -t quay.io/konveyor/oadp-cli-binaries:latest . + # Create manifest + podman manifest create oadp-cli-binaries + + podman build \ + --platform=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ + --manifest oadp-cli-binaries \ + -f Dockerfile.download \ + . - name: Podman push version tag - run: podman push quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + run: podman manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} - name: Podman push latest tag - run: podman push quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file + run: podman manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file From bb4234e38a55533c262bda5b0035aa24be7063d9 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 13:02:14 -0400 Subject: [PATCH 03/14] Use buildah multi arch Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 105 +++++++++++++++--- Dockerfile.download => Containerfile.download | 0 2 files changed, 92 insertions(+), 13 deletions(-) rename Dockerfile.download => Containerfile.download (100%) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index a2c9672b..e434e08a 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -5,34 +5,113 @@ on: push: tags: - 'v*' + pull_request: + # Check out code, podman login, run podman build, push to jobs: - push-binaries: + single-arch-build: + name: Single-Arch Build runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Podman login - run: podman login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io + - name: Checkout Buildah action + uses: actions/checkout@v4 + with: + path: "buildah-build" - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Install qemu dependency + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static - - name: Podman build and tag + - name: Build Image + id: build_image_singlearch + uses: ./buildah-build/ + with: + image: quay.io/konveyor/oadp-cli-binaries + tags: latest ${{ github.ref_name }} + archs: amd64 + containerfiles: | + ./Containerfile.download + + - name: Echo Outputs + run: | + echo "Image: ${{ steps.build_image_singlearch.outputs.image }}" + echo "Tags: ${{ steps.build_image_singlearch.outputs.tags }}" + echo "Tagged Image: ${{ steps.build_image_singlearch.outputs.image-with-tag }}" + + - name: Check images created + run: buildah images | grep 'quay.io/konveyor/oadp-cli-binaries' + + - name: Check image metadata + run: | + set -x + buildah inspect quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} | jq ".OCIv1.architecture" + buildah inspect quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} | jq ".Docker.architecture" + + multi-arch-build: + name: Multi-Arch Build + runs-on: ubuntu-latest + needs: single-arch-build + steps: + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Checkout Buildah action + uses: actions/checkout@v4 + with: + path: "buildah-build" + + - name: Install qemu dependency + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static + + - name: Build Image + id: build_image_multiarch + uses: ./buildah-build/ + with: + image: quay.io/konveyor/oadp-cli-binaries + tags: latest ${{ github.ref_name }} + archs: amd64,arm64,ppc64le,s390x + containerfiles: | + ./Containerfile.download + + - name: Echo Outputs + run: | + echo "Image: ${{ steps.build_image_multiplatform.outputs.image }}" + echo "Tags: ${{ steps.build_image_multiplatform.outputs.tags }}" + echo "Tagged Image: ${{ steps.build_image_multiplatform.outputs.image-with-tag }}" + + - name: Check images created + run: buildah images | grep '${{ env.IMAGE_NAME }}' + + - name: Check manifest + run: | + set -x + buildah manifest inspect quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + - name: Buildah login + run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io + + - name: Buildah build and tag run: | # Create manifest - podman manifest create oadp-cli-binaries + buildah manifest create oadp-cli-binaries - podman build \ + buildah build \ --platform=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ --manifest oadp-cli-binaries \ - -f Dockerfile.download \ + -f Containerfile.download \ . - - name: Podman push version tag - run: podman manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + - name: Buildah push version tag + if: startsWith(github.ref_name, 'v') + run: buildah manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} - - name: Podman push latest tag - run: podman manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file + - name: Buildah push latest tag + if: startsWith(github.ref_name, 'v') + run: buildah manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file diff --git a/Dockerfile.download b/Containerfile.download similarity index 100% rename from Dockerfile.download rename to Containerfile.download From 8a1329e0a0b5d0699312547ff64fc7e9096b7f03 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 13:23:49 -0400 Subject: [PATCH 04/14] Buildah action Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index e434e08a..63774311 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -17,11 +17,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Checkout Buildah action - uses: actions/checkout@v4 - with: - path: "buildah-build" - - name: Install qemu dependency run: | sudo apt-get update @@ -29,7 +24,7 @@ jobs: - name: Build Image id: build_image_singlearch - uses: ./buildah-build/ + uses: redhat-actions/buildah-build@v2 with: image: quay.io/konveyor/oadp-cli-binaries tags: latest ${{ github.ref_name }} @@ -61,11 +56,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Checkout Buildah action - uses: actions/checkout@v4 - with: - path: "buildah-build" - - name: Install qemu dependency run: | sudo apt-get update @@ -73,7 +63,7 @@ jobs: - name: Build Image id: build_image_multiarch - uses: ./buildah-build/ + uses: redhat-actions/buildah-build@v2 with: image: quay.io/konveyor/oadp-cli-binaries tags: latest ${{ github.ref_name }} From 6031de6aed449ab5ef1817867317405eda965f52 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 13:53:01 -0400 Subject: [PATCH 05/14] test tag for PRs Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 63774311..ffd82ccb 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -27,7 +27,7 @@ jobs: uses: redhat-actions/buildah-build@v2 with: image: quay.io/konveyor/oadp-cli-binaries - tags: latest ${{ github.ref_name }} + tags: ${{ github.ref_type == 'tag' && format('latest {0}', github.ref_name) || 'test' }} archs: amd64 containerfiles: | ./Containerfile.download @@ -66,7 +66,7 @@ jobs: uses: redhat-actions/buildah-build@v2 with: image: quay.io/konveyor/oadp-cli-binaries - tags: latest ${{ github.ref_name }} + tags: ${{ github.ref_type == 'tag' && format('latest {0}', github.ref_name) || 'test' }} archs: amd64,arm64,ppc64le,s390x containerfiles: | ./Containerfile.download From 34a6175e724f4a12c8351c3a8b1f31508fc9530a Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 14:45:10 -0400 Subject: [PATCH 06/14] Fix image tags for inspect Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index ffd82ccb..ee3544ca 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -44,8 +44,8 @@ jobs: - name: Check image metadata run: | set -x - buildah inspect quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} | jq ".OCIv1.architecture" - buildah inspect quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} | jq ".Docker.architecture" + buildah inspect ${{ steps.build_image_singlearch.outputs.image-with-tag }} | jq ".OCIv1.architecture" + buildah inspect ${{ steps.build_image_singlearch.outputs.image-with-tag }} | jq ".Docker.architecture" multi-arch-build: name: Multi-Arch Build @@ -83,7 +83,7 @@ jobs: - name: Check manifest run: | set -x - buildah manifest inspect quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + buildah manifest inspect ${{ steps.build_image_multiarch.outputs.image-with-tag }} - name: Buildah login run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io From 1c86f89e309e53402be70c41dc2ed4fd79b72ab1 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 16:08:58 -0400 Subject: [PATCH 07/14] Multiarch amd and arm --- .github/workflows/quay_binaries_push.yml | 39 +----------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index ee3544ca..7a9d0126 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -10,47 +10,10 @@ on: # Check out code, podman login, run podman build, push to jobs: - single-arch-build: - name: Single-Arch Build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install qemu dependency - run: | - sudo apt-get update - sudo apt-get install -y qemu-user-static - - - name: Build Image - id: build_image_singlearch - uses: redhat-actions/buildah-build@v2 - with: - image: quay.io/konveyor/oadp-cli-binaries - tags: ${{ github.ref_type == 'tag' && format('latest {0}', github.ref_name) || 'test' }} - archs: amd64 - containerfiles: | - ./Containerfile.download - - - name: Echo Outputs - run: | - echo "Image: ${{ steps.build_image_singlearch.outputs.image }}" - echo "Tags: ${{ steps.build_image_singlearch.outputs.tags }}" - echo "Tagged Image: ${{ steps.build_image_singlearch.outputs.image-with-tag }}" - - - name: Check images created - run: buildah images | grep 'quay.io/konveyor/oadp-cli-binaries' - - - name: Check image metadata - run: | - set -x - buildah inspect ${{ steps.build_image_singlearch.outputs.image-with-tag }} | jq ".OCIv1.architecture" - buildah inspect ${{ steps.build_image_singlearch.outputs.image-with-tag }} | jq ".Docker.architecture" multi-arch-build: name: Multi-Arch Build runs-on: ubuntu-latest - needs: single-arch-build steps: - name: Checkout code @@ -93,7 +56,7 @@ jobs: buildah manifest create oadp-cli-binaries buildah build \ - --platform=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ + --platform=linux/amd64,linux/arm64 \ --manifest oadp-cli-binaries \ -f Containerfile.download \ . From 6e1943455eaa2defe0998c77e75242cf2bf48cbf Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 16:19:41 -0400 Subject: [PATCH 08/14] Fix Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 7a9d0126..3ae467da 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -30,7 +30,7 @@ jobs: with: image: quay.io/konveyor/oadp-cli-binaries tags: ${{ github.ref_type == 'tag' && format('latest {0}', github.ref_name) || 'test' }} - archs: amd64,arm64,ppc64le,s390x + archs: amd64,arm64 containerfiles: | ./Containerfile.download From bc65059c4edd32a5bc64db81f54c103165ec4e5d Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 17:20:16 -0400 Subject: [PATCH 09/14] Add back archs Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 25 +++++++----------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 3ae467da..91376434 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -30,18 +30,18 @@ jobs: with: image: quay.io/konveyor/oadp-cli-binaries tags: ${{ github.ref_type == 'tag' && format('latest {0}', github.ref_name) || 'test' }} - archs: amd64,arm64 + archs: amd64,arm64,ppc64le,s390x containerfiles: | ./Containerfile.download - name: Echo Outputs run: | - echo "Image: ${{ steps.build_image_multiplatform.outputs.image }}" - echo "Tags: ${{ steps.build_image_multiplatform.outputs.tags }}" - echo "Tagged Image: ${{ steps.build_image_multiplatform.outputs.image-with-tag }}" + echo "Image: ${{ steps.build_image_multiarch.outputs.image }}" + echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}" + echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}" - name: Check images created - run: buildah images | grep '${{ env.IMAGE_NAME }}' + run: buildah images | grep 'quay.io/konveyor/oadp-cli-binaries' - name: Check manifest run: | @@ -49,22 +49,11 @@ jobs: buildah manifest inspect ${{ steps.build_image_multiarch.outputs.image-with-tag }} - name: Buildah login run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - - - name: Buildah build and tag - run: | - # Create manifest - buildah manifest create oadp-cli-binaries - - buildah build \ - --platform=linux/amd64,linux/arm64 \ - --manifest oadp-cli-binaries \ - -f Containerfile.download \ - . - name: Buildah push version tag if: startsWith(github.ref_name, 'v') - run: buildah manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + run: buildah manifest push ${{ steps.build_image_multiarch.outputs.image-with-tag }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} - name: Buildah push latest tag if: startsWith(github.ref_name, 'v') - run: buildah manifest push oadp-cli-binaries quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file + run: buildah manifest push ${{ steps.build_image_multiarch.outputs.image-with-tag }} quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file From 5998e93de33e376fd8498f95be11ddd8b348203f Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 21:43:36 -0400 Subject: [PATCH 10/14] Matrix strat Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 90 +++++++++++++++++------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 91376434..a99ceff9 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -12,48 +12,90 @@ on: jobs: multi-arch-build: - name: Multi-Arch Build + name: Build Multi-Arch Images runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64, arm64, ppc64le, s390x] steps: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - name: Install qemu dependency run: | sudo apt-get update sudo apt-get install -y qemu-user-static - - name: Build Image - id: build_image_multiarch + - name: Build Image for ${{ matrix.arch }} + id: build_image uses: redhat-actions/buildah-build@v2 with: - image: quay.io/konveyor/oadp-cli-binaries - tags: ${{ github.ref_type == 'tag' && format('latest {0}', github.ref_name) || 'test' }} - archs: amd64,arm64,ppc64le,s390x + image: oadp-cli-binaries-local + tags: ${{ matrix.arch }} + archs: ${{ matrix.arch }} containerfiles: | ./Containerfile.download - - name: Echo Outputs + - name: Save image as tar run: | - echo "Image: ${{ steps.build_image_multiarch.outputs.image }}" - echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}" - echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}" - - - name: Check images created - run: buildah images | grep 'quay.io/konveyor/oadp-cli-binaries' + buildah push ${{ steps.build_image.outputs.image-with-tag }} oci-archive:oadp-cli-${{ matrix.arch }}.tar + + - name: Upload image artifact + uses: actions/upload-artifact@v4 + with: + name: oadp-cli-image-${{ matrix.arch }} + path: oadp-cli-${{ matrix.arch }}.tar + retention-days: 1 + + push-manifest: + name: Create and Push Multi-Arch Manifest + runs-on: ubuntu-latest + needs: multi-arch-build + if: startsWith(github.ref_name, 'v') + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + pattern: oadp-cli-image-* - - name: Check manifest + - name: Load images and create manifest run: | - set -x - buildah manifest inspect ${{ steps.build_image_multiarch.outputs.image-with-tag }} + # Load all arch images + buildah pull oci-archive:oadp-cli-image-amd64/oadp-cli-amd64.tar + buildah pull oci-archive:oadp-cli-image-arm64/oadp-cli-arm64.tar + buildah pull oci-archive:oadp-cli-image-ppc64le/oadp-cli-ppc64le.tar + buildah pull oci-archive:oadp-cli-image-s390x/oadp-cli-s390x.tar + + # Tag them for manifest + buildah tag localhost/oadp-cli-binaries-local:amd64 quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-amd64 + buildah tag localhost/oadp-cli-binaries-local:arm64 quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-arm64 + buildah tag localhost/oadp-cli-binaries-local:ppc64le quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-ppc64le + buildah tag localhost/oadp-cli-binaries-local:s390x quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-s390x + - name: Buildah login run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - - - name: Buildah push version tag - if: startsWith(github.ref_name, 'v') - run: buildah manifest push ${{ steps.build_image_multiarch.outputs.image-with-tag }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} - - - name: Buildah push latest tag - if: startsWith(github.ref_name, 'v') - run: buildah manifest push ${{ steps.build_image_multiarch.outputs.image-with-tag }} quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file + + - name: Create and push version manifest + run: | + buildah manifest create quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-amd64 + buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-arm64 + buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-ppc64le + buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-s390x + buildah manifest push --all quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + + - name: Create and push latest manifest + run: | + buildah manifest create quay.io/konveyor/oadp-cli-binaries:latest + buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-amd64 + buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-arm64 + buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-ppc64le + buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-s390x + buildah manifest push --all quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file From 197f5031730752fdd0c587a8b38b21816cc5c120 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 22:13:49 -0400 Subject: [PATCH 11/14] multi-platform Containerfile and remove QEMU Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 5 ----- Containerfile.download | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index a99ceff9..496ee8f1 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -27,11 +27,6 @@ jobs: with: go-version-file: go.mod cache: true - - - name: Install qemu dependency - run: | - sudo apt-get update - sudo apt-get install -y qemu-user-static - name: Build Image for ${{ matrix.arch }} id: build_image diff --git a/Containerfile.download b/Containerfile.download index 66f1c502..2e8428c9 100644 --- a/Containerfile.download +++ b/Containerfile.download @@ -1,7 +1,10 @@ # This Dockerfile is used to cross-build the kubectl-oadp binaries for all platforms # It also builds a Go server that serves the binaries for download -FROM golang:1.24 AS builder +FROM --platform=$BUILDPLATFORM golang:1.24 AS builder + +ARG TARGETOS +ARG TARGETARCH WORKDIR /app @@ -10,16 +13,22 @@ RUN go mod download && go mod verify COPY . . -# Build everything, create tarballs, and clean up in one layer to reduce size +# Build ALL kubectl-oadp binaries using native Go cross-compilation (no QEMU emulation) +# The download server needs to serve binaries for all platforms, not just one arch RUN make release-build && \ - CGO_ENABLED=0 go build -o download-server ./cmd/downloads/server.go && \ mkdir -p /archives && \ for binary in kubectl-oadp_*; do \ archive_name=$(echo "$binary" | sed 's/\.exe$//' ).tar.gz; \ tar -czf "/archives/$archive_name" "$binary"; \ echo "Created /archives/$archive_name"; \ - done && \ - go clean -cache -modcache -testcache && \ + done + +# Build the download server for the TARGET platform (the arch this container will run on) +# This uses cross-compilation so the builder can run natively on amd64 +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o download-server ./cmd/downloads/server.go + +# Clean up to reduce layer size +RUN go clean -cache -modcache -testcache && \ rm -rf /root/.cache/go-build && \ rm -rf /go/pkg From f7076acb60f70be0ecdbc9289d6e2cf79f661852 Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 28 Oct 2025 23:36:21 -0400 Subject: [PATCH 12/14] Test quay.io push Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 38 +++++++++++++----------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 496ee8f1..757f56f8 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -6,9 +6,11 @@ on: tags: - 'v*' pull_request: - -# Check out code, podman login, run podman build, push to + +env: + IMAGE_REPO: quay.io/rh_ee_jvaikath/oadp-cli-binaries +# Check out code, podman login, run podman build, push to jobs: multi-arch-build: @@ -69,28 +71,28 @@ jobs: buildah pull oci-archive:oadp-cli-image-s390x/oadp-cli-s390x.tar # Tag them for manifest - buildah tag localhost/oadp-cli-binaries-local:amd64 quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-amd64 - buildah tag localhost/oadp-cli-binaries-local:arm64 quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-arm64 - buildah tag localhost/oadp-cli-binaries-local:ppc64le quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-ppc64le - buildah tag localhost/oadp-cli-binaries-local:s390x quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-s390x + buildah tag localhost/oadp-cli-binaries-local:amd64 ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 + buildah tag localhost/oadp-cli-binaries-local:arm64 ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 + buildah tag localhost/oadp-cli-binaries-local:ppc64le ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le + buildah tag localhost/oadp-cli-binaries-local:s390x ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x - name: Buildah login run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - name: Create and push version manifest run: | - buildah manifest create quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} - buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-amd64 - buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-arm64 - buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-ppc64le - buildah manifest add quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-s390x - buildah manifest push --all quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} + buildah manifest create ${{ env.IMAGE_REPO }}:${{ github.ref_name }} + buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 + buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 + buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le + buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x + buildah manifest push --all ${{ env.IMAGE_REPO }}:${{ github.ref_name }} - name: Create and push latest manifest run: | - buildah manifest create quay.io/konveyor/oadp-cli-binaries:latest - buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-amd64 - buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-arm64 - buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-ppc64le - buildah manifest add quay.io/konveyor/oadp-cli-binaries:latest quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }}-s390x - buildah manifest push --all quay.io/konveyor/oadp-cli-binaries:latest \ No newline at end of file + buildah manifest create ${{ env.IMAGE_REPO }}:latest + buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 + buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 + buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le + buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x + buildah manifest push --all ${{ env.IMAGE_REPO }}:latest \ No newline at end of file From a6ced69348315f5680046bcccd42ebfd09560dd9 Mon Sep 17 00:00:00 2001 From: Joseph Date: Wed, 29 Oct 2025 00:02:16 -0400 Subject: [PATCH 13/14] Reference by id after buildah pull Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 757f56f8..43ef429f 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -64,17 +64,17 @@ jobs: - name: Load images and create manifest run: | - # Load all arch images - buildah pull oci-archive:oadp-cli-image-amd64/oadp-cli-amd64.tar - buildah pull oci-archive:oadp-cli-image-arm64/oadp-cli-arm64.tar - buildah pull oci-archive:oadp-cli-image-ppc64le/oadp-cli-ppc64le.tar - buildah pull oci-archive:oadp-cli-image-s390x/oadp-cli-s390x.tar - - # Tag them for manifest - buildah tag localhost/oadp-cli-binaries-local:amd64 ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 - buildah tag localhost/oadp-cli-binaries-local:arm64 ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 - buildah tag localhost/oadp-cli-binaries-local:ppc64le ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le - buildah tag localhost/oadp-cli-binaries-local:s390x ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x + # Load all arch images and capture their IDs + AMD64_ID=$(buildah pull oci-archive:oadp-cli-image-amd64/oadp-cli-amd64.tar) + ARM64_ID=$(buildah pull oci-archive:oadp-cli-image-arm64/oadp-cli-arm64.tar) + PPC64LE_ID=$(buildah pull oci-archive:oadp-cli-image-ppc64le/oadp-cli-ppc64le.tar) + S390X_ID=$(buildah pull oci-archive:oadp-cli-image-s390x/oadp-cli-s390x.tar) + + # Tag the loaded images using their IDs + buildah tag $AMD64_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 + buildah tag $ARM64_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 + buildah tag $PPC64LE_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le + buildah tag $S390X_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x - name: Buildah login run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io From c66d72c2013f3d9a2329a2812a6ab802f2c278eb Mon Sep 17 00:00:00 2001 From: Joseph Date: Wed, 29 Oct 2025 00:25:13 -0400 Subject: [PATCH 14/14] Revert to konveyor Signed-off-by: Joseph --- .github/workflows/quay_binaries_push.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/quay_binaries_push.yml b/.github/workflows/quay_binaries_push.yml index 43ef429f..388a62d2 100644 --- a/.github/workflows/quay_binaries_push.yml +++ b/.github/workflows/quay_binaries_push.yml @@ -1,5 +1,5 @@ # Push binaries to Quay.io, when a new release is created -name: oadp-cli binaries image push +name: Multi-Arch Binary Push to Quay.io on: push: @@ -9,8 +9,8 @@ on: env: - IMAGE_REPO: quay.io/rh_ee_jvaikath/oadp-cli-binaries -# Check out code, podman login, run podman build, push to + IMAGE_REPO: quay.io/konveyor/oadp-cli-binaries + jobs: multi-arch-build: @@ -61,8 +61,11 @@ jobs: uses: actions/download-artifact@v4 with: pattern: oadp-cli-image-* + + - name: Buildah login + run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - - name: Load images and create manifest + - name: Load images and tag archs run: | # Load all arch images and capture their IDs AMD64_ID=$(buildah pull oci-archive:oadp-cli-image-amd64/oadp-cli-amd64.tar) @@ -76,10 +79,7 @@ jobs: buildah tag $PPC64LE_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le buildah tag $S390X_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x - - name: Buildah login - run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io - - - name: Create and push version manifest + - name: Create and push multi-arch manifest (version tag) run: | buildah manifest create ${{ env.IMAGE_REPO }}:${{ github.ref_name }} buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 @@ -88,7 +88,7 @@ jobs: buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x buildah manifest push --all ${{ env.IMAGE_REPO }}:${{ github.ref_name }} - - name: Create and push latest manifest + - name: Create and push multi-arch manifest (latest tag) run: | buildah manifest create ${{ env.IMAGE_REPO }}:latest buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64