From 094b541563a8b60fd21c5b77b1afe5a3fb76be5d Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Fri, 8 Mar 2024 11:37:29 +0100 Subject: [PATCH 1/5] Build power images on remote VMs Try building power images on a remote VM Testing Clone repo on power builder Stop creating all VMs Minor simplification --- .github/workflows/collector-builder.yml | 60 ++++++++++++++++++++++++- .github/workflows/collector-slim.yml | 6 ++- ansible/ci-build-collector.yml | 2 +- ansible/ci-create-build-vms.yml | 4 +- 4 files changed, 65 insertions(+), 7 deletions(-) diff --git a/.github/workflows/collector-builder.yml b/.github/workflows/collector-builder.yml index e7519fcd28..a6265cfa5d 100644 --- a/.github/workflows/collector-builder.yml +++ b/.github/workflows/collector-builder.yml @@ -73,6 +73,64 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Create ansible vars + run: | + cat << EOF > ${{ github.workspace }}/ansible/secrets.yml + --- + stackrox_io_username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }} + stackrox_io_password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }} + rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }} + rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }} + collector_git_ref: ${{ github.ref }} + collector_git_sha: ${{ github.sha }} + collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} + EOF + + - name: Build images + if: | + github.event_name == 'push' || + matrix.arch == 'amd64' || + contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') + timeout-minutes: 480 + run: | + ansible-galaxy install -r ansible/requirements.yml + ansible-playbook \ + --connection local \ + -i localhost, \ + --limit localhost \ + -e arch='${{ matrix.arch }}' \ + -e @'${{ github.workspace }}/ansible/secrets.yml' \ + ansible/ci-build-builder.yml + + build-builder-image-remote-vm: + name: Build the builder image + runs-on: ubuntu-latest + # Multiarch builds sometimes take for eeeeeeeeeever + timeout-minutes: 480 + needs: + - builder-needs-rebuilding + - builder-setup-environment + if: | + needs.builder-needs-rebuilding.outputs.build-image == 'true' || ( + github.event_name == 'push' && ( + github.ref_type == 'tag' || startsWith(github.ref_name, 'release-') + )) || ( + contains(github.event.pull_request.labels.*.name, 'build-builder-image') && + contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') + ) + strategy: + fail-fast: false + matrix: + arch: [ppc64le, s390x] + + env: + PLATFORM: linux/${{ matrix.arch }} + BUILD_TYPE: ci + COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" @@ -94,7 +152,7 @@ jobs: ppc64le-key: ${{ secrets.IBM_CLOUD_POWER_API_KEY }} redhat-username: ${{ secrets.REDHAT_USERNAME }} redhat-password: ${{ secrets.REDHAT_PASSWORD }} - vm-type: all + vm-type: rhel-${{ matrix.arch }} job-tag: builder - name: Create Build VMs diff --git a/.github/workflows/collector-slim.yml b/.github/workflows/collector-slim.yml index a5a99bd675..4733ead8e8 100644 --- a/.github/workflows/collector-slim.yml +++ b/.github/workflows/collector-slim.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - arch: [amd64, ppc64le, arm64] + arch: [amd64, arm64] env: PLATFORM: linux/${{ matrix.arch }} @@ -125,6 +125,8 @@ jobs: - name: Create Build VMs run: | make -C "${{ github.workspace }}/ansible" create-build-vms + env: + VM_TYPE: rhel-${{ matrix.arch }} - name: Create ansible vars run: | @@ -137,7 +139,7 @@ jobs: collector_git_ref: ${{ github.ref }} collector_git_sha: ${{ github.sha }} collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} - disable_profiling: ${{ matrix.arch != 'amd64' && matrix.arch != 'arm64' }} + disable_profiling: true rhacs_eng_image: ${{ env.RHACS_ENG_IMAGE }} collector_image: ${{ inputs.collector-image }} collector_tag: ${{ inputs.collector-tag }} diff --git a/ansible/ci-build-collector.yml b/ansible/ci-build-collector.yml index 19a9c0b690..bab569322f 100644 --- a/ansible/ci-build-collector.yml +++ b/ansible/ci-build-collector.yml @@ -20,7 +20,7 @@ version: "{{ collector_git_sha }}" refspec: "+{{ collector_git_ref | replace('refs/', '') }}" recursive: true - when: arch == "s390x" + when: arch == "s390x" or arch == "ppc64le" - name: Run the builder image community.general.make: diff --git a/ansible/ci-create-build-vms.yml b/ansible/ci-create-build-vms.yml index 34913b56c9..0c82d353fe 100644 --- a/ansible/ci-create-build-vms.yml +++ b/ansible/ci-create-build-vms.yml @@ -8,9 +8,7 @@ include_role: name: create-all-vms vars: - vm_list: - # s390x - rhel-s390x: "{{ virtual_machines['rhel-s390x'] }}" + vm_list: "{{ virtual_machines }}" - name: Provision Build VMs hosts: "job_id_{{ job_id }}" From 462001b7ae5f19e038bb5aea6486dd7dc447aa75 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Mon, 11 Mar 2024 12:02:15 +0100 Subject: [PATCH 2/5] Split remote and local builder image builds Always cleanup build VMs --- .github/workflows/collector-builder.yml | 98 +++++++++++-------------- ansible/ci-build-builder.yml | 2 +- 2 files changed, 43 insertions(+), 57 deletions(-) diff --git a/.github/workflows/collector-builder.yml b/.github/workflows/collector-builder.yml index a6265cfa5d..ec2b1a10c8 100644 --- a/.github/workflows/collector-builder.yml +++ b/.github/workflows/collector-builder.yml @@ -11,7 +11,7 @@ on: outputs: collector-builder-tag: description: The builder tag used by the build - value: ${{ jobs.build-builder-image.outputs.collector-builder-tag || 'master' }} + value: ${{ jobs.builder-setup-environment.outputs.collector-builder-tag }} env: COLLECTOR_TAG: ${{ inputs.collector-tag }} @@ -38,6 +38,23 @@ jobs: - builder/Dockerfile - .github/workflows/collector-builder.yml + builder-setup-environment: + name: Setup environment + runs-on: ubuntu-latest + outputs: + collector-builder-tag: ${{ steps.builder-tag.outputs.collector-builder-tag }} + steps: + - name: Define builder tag + id: builder-tag + run: | + COLLECTOR_BUILDER_TAG="${DEFAULT_BUILDER_TAG}" + if [[ "${{ github.event_name }}" == 'pull_request' || \ + "${{ github.ref_type }}" == 'tag' || \ + "${{ github.ref_name }}" =~ ^release- ]]; then + COLLECTOR_BUILDER_TAG="${{ inputs.collector-tag }}" + fi + echo "collector-builder-tag=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_OUTPUT" + build-builder-image: name: Build the builder image runs-on: ubuntu-latest @@ -45,22 +62,22 @@ jobs: timeout-minutes: 480 needs: - builder-needs-rebuilding + - builder-setup-environment if: | needs.builder-needs-rebuilding.outputs.build-image == 'true' || (github.event_name == 'push' && ( github.ref_type == 'tag' || startsWith(github.ref_name, 'release-') )) || contains(github.event.pull_request.labels.*.name, 'build-builder-image') - outputs: - collector-builder-tag: ${{ steps.builder-tag.outputs.collector-builder-tag }} strategy: fail-fast: false matrix: - arch: [amd64, ppc64le, s390x, arm64] + arch: [amd64, arm64] env: PLATFORM: linux/${{ matrix.arch }} BUILD_TYPE: ci + COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} steps: - uses: actions/checkout@v4 @@ -156,58 +173,23 @@ jobs: job-tag: builder - name: Create Build VMs - if: | - matrix.arch == 's390x' && - (github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')) run: | make -C "${{ github.workspace }}/ansible" create-build-vms - - name: Define builder tag - id: builder-tag - run: | - COLLECTOR_BUILDER_TAG="${DEFAULT_BUILDER_TAG}" - if [[ "${{ github.event_name }}" == 'pull_request' || \ - "${{ github.ref_type }}" == 'tag' || \ - "${{ github.ref_name }}" =~ ^release- ]]; then - COLLECTOR_BUILDER_TAG="${{ inputs.collector-tag }}" - fi - - echo "COLLECTOR_BUILDER_TAG=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_ENV" - echo "collector-builder-tag=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_OUTPUT" - - name: Create ansible vars run: | - { - echo "---" - echo "stackrox_io_username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}" - echo "stackrox_io_password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}" - echo "rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}" - echo "rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}" - echo "collector_git_ref: ${{ github.ref }}" - echo "collector_git_sha: ${{ github.sha }}" - echo "collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }}" - } > ${{ github.workspace }}/ansible/secrets.yml + cat << EOF > ${{ github.workspace }}/ansible/secrets.yml + --- + stackrox_io_username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }} + stackrox_io_password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }} + rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }} + rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }} + collector_git_ref: ${{ github.ref }} + collector_git_sha: ${{ github.sha }} + collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} + EOF - name: Build images - if: | - (github.event_name == 'push' && matrix.arch != 's390x') || - matrix.arch == 'amd64' || - (contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch != 's390x') - timeout-minutes: 480 - run: | - ansible-galaxy install -r ansible/requirements.yml - ansible-playbook \ - --connection local \ - -i localhost, \ - --limit localhost \ - -e arch='${{ matrix.arch }}' \ - -e @'${{ github.workspace }}/ansible/secrets.yml' \ - ansible/ci-build-builder.yml - - - name: Build s390x images - if: | - (github.event_name == 'push' && matrix.arch == 's390x') || - (contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch == 's390x') timeout-minutes: 480 run: | ansible-playbook \ @@ -218,21 +200,24 @@ jobs: ansible/ci-build-builder.yml - name: Destroy VMs - if: always() && matrix.arch == 's390x' + if: always() run: | make -C ansible destroy-vms create-multiarch-manifest: needs: + - builder-setup-environment - build-builder-image + - build-builder-image-remote-vm name: Create Multiarch manifest runs-on: ubuntu-latest if: | - github.event_name == 'push' || - (needs.build-builder-image.outputs.collector-builder-tag != 'cache' && - contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')) + github.event_name == 'push' || ( + needs.builder-setup-environment.outputs.collector-builder-tag != 'master' && + contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') + ) env: - COLLECTOR_BUILDER_TAG: ${{ needs.build-builder-image.outputs.collector-builder-tag }} + COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} ARCHS: amd64 ppc64le s390x arm64 steps: @@ -266,15 +251,16 @@ jobs: retag-x86-image: needs: + - builder-setup-environment - build-builder-image name: Retag x86 builder image runs-on: ubuntu-latest if: | github.event_name == 'pull_request' && - needs.build-builder-image.outputs.collector-builder-tag != 'cache' && + needs.builder-setup-environment.outputs.collector-builder-tag != 'master' && !contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') env: - COLLECTOR_BUILDER_TAG: ${{ needs.build-builder-image.outputs.collector-builder-tag }} + COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} steps: - name: Pull image to retag run: | diff --git a/ansible/ci-build-builder.yml b/ansible/ci-build-builder.yml index 98fb9ef5ef..009348599b 100644 --- a/ansible/ci-build-builder.yml +++ b/ansible/ci-build-builder.yml @@ -18,7 +18,7 @@ version: "{{ collector_git_sha }}" refspec: "+{{ collector_git_ref | replace('refs/', '') }}" recursive: true - when: arch == "s390x" + when: arch == "s390x" or arch == "ppc64le" - name: Build the collector builder image community.general.make: From e3b1fb1ed3bd27779f1807e896fcbb16f0b0d676 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Tue, 12 Mar 2024 13:47:12 +0100 Subject: [PATCH 3/5] Move Arm build to remote VMs Try moving arm build to remote VMs too Refresh inventory after creating build VMs Fix disable_profiling variable Remove unneeded env definition Add missing condition to slim image builds on GHA Simplify builder tag definition a bit Minor fix --- .github/workflows/collector-builder.yml | 47 +++++++++++-------------- .github/workflows/collector-slim.yml | 12 +++---- ansible/ci-build-builder.yml | 2 +- ansible/ci-build-collector.yml | 2 +- ansible/ci-create-build-vms.yml | 4 +++ 5 files changed, 32 insertions(+), 35 deletions(-) diff --git a/.github/workflows/collector-builder.yml b/.github/workflows/collector-builder.yml index ec2b1a10c8..9d7e3e56fe 100644 --- a/.github/workflows/collector-builder.yml +++ b/.github/workflows/collector-builder.yml @@ -11,7 +11,7 @@ on: outputs: collector-builder-tag: description: The builder tag used by the build - value: ${{ jobs.builder-setup-environment.outputs.collector-builder-tag }} + value: ${{ jobs.builder-needs-rebuilding.outputs.collector-builder-tag }} env: COLLECTOR_TAG: ${{ inputs.collector-tag }} @@ -24,6 +24,7 @@ jobs: runs-on: ubuntu-latest outputs: build-image: ${{ steps.changed.outputs.builder-changed }} + collector-builder-tag: ${{ steps.set-builder-tag.outputs.collector-builder-tag || 'master' }} steps: - uses: actions/checkout@v4 @@ -38,14 +39,14 @@ jobs: - builder/Dockerfile - .github/workflows/collector-builder.yml - builder-setup-environment: - name: Setup environment - runs-on: ubuntu-latest - outputs: - collector-builder-tag: ${{ steps.builder-tag.outputs.collector-builder-tag }} - steps: - - name: Define builder tag - id: builder-tag + - name: Set builder tag + id: set-builder-tag + if: | + steps.changed.outputs.builder-changed == 'true' || + contains(github.event.pull_request.labels.*.name, 'build-builder-image') || ( + github.event_name == 'push' && ( + github.ref_type == 'tag' || startsWith(github.ref_name, 'release-') + )) run: | COLLECTOR_BUILDER_TAG="${DEFAULT_BUILDER_TAG}" if [[ "${{ github.event_name }}" == 'pull_request' || \ @@ -62,7 +63,6 @@ jobs: timeout-minutes: 480 needs: - builder-needs-rebuilding - - builder-setup-environment if: | needs.builder-needs-rebuilding.outputs.build-image == 'true' || (github.event_name == 'push' && ( @@ -72,12 +72,12 @@ jobs: strategy: fail-fast: false matrix: - arch: [amd64, arm64] + arch: [amd64] env: PLATFORM: linux/${{ matrix.arch }} BUILD_TYPE: ci - COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} + COLLECTOR_BUILDER_TAG: ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }} steps: - uses: actions/checkout@v4 @@ -104,10 +104,6 @@ jobs: EOF - name: Build images - if: | - github.event_name == 'push' || - matrix.arch == 'amd64' || - contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') timeout-minutes: 480 run: | ansible-galaxy install -r ansible/requirements.yml @@ -126,7 +122,6 @@ jobs: timeout-minutes: 480 needs: - builder-needs-rebuilding - - builder-setup-environment if: | needs.builder-needs-rebuilding.outputs.build-image == 'true' || ( github.event_name == 'push' && ( @@ -138,12 +133,12 @@ jobs: strategy: fail-fast: false matrix: - arch: [ppc64le, s390x] + arch: [ppc64le, s390x, arm64] env: PLATFORM: linux/${{ matrix.arch }} BUILD_TYPE: ci - COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} + COLLECTOR_BUILDER_TAG: ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }} steps: - uses: actions/checkout@v4 @@ -206,18 +201,18 @@ jobs: create-multiarch-manifest: needs: - - builder-setup-environment + - builder-needs-rebuilding - build-builder-image - build-builder-image-remote-vm name: Create Multiarch manifest runs-on: ubuntu-latest if: | github.event_name == 'push' || ( - needs.builder-setup-environment.outputs.collector-builder-tag != 'master' && - contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') + needs.builder-needs-rebuilding.outputs.collector-builder-tag != 'master' && + contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') ) env: - COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} + COLLECTOR_BUILDER_TAG: ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }} ARCHS: amd64 ppc64le s390x arm64 steps: @@ -251,16 +246,16 @@ jobs: retag-x86-image: needs: - - builder-setup-environment + - builder-needs-rebuilding - build-builder-image name: Retag x86 builder image runs-on: ubuntu-latest if: | github.event_name == 'pull_request' && - needs.builder-setup-environment.outputs.collector-builder-tag != 'master' && + needs.builder-needs-rebuilding.outputs.collector-builder-tag != 'master' && !contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') env: - COLLECTOR_BUILDER_TAG: ${{ needs.builder-setup-environment.outputs.collector-builder-tag }} + COLLECTOR_BUILDER_TAG: ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }} steps: - name: Pull image to retag run: | diff --git a/.github/workflows/collector-slim.yml b/.github/workflows/collector-slim.yml index 4733ead8e8..8a299fe51b 100644 --- a/.github/workflows/collector-slim.yml +++ b/.github/workflows/collector-slim.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - arch: [amd64, arm64] + arch: [amd64, ppc64le] env: PLATFORM: linux/${{ matrix.arch }} @@ -62,18 +62,18 @@ jobs: collector_git_ref: ${{ github.ref }} collector_git_sha: ${{ github.sha }} collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} - disable_profiling: ${{ matrix.arch != 'amd64' && matrix.arch != 'arm64' }} + disable_profiling: ${{ matrix.arch == 'amd64' }} rhacs_eng_image: ${{ env.RHACS_ENG_IMAGE }} collector_image: ${{ inputs.collector-image }} collector_tag: ${{ inputs.collector-tag }} EOF - name: Build images + timeout-minutes: 480 if: | github.event_name == 'push' || matrix.arch == 'amd64' || contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') - timeout-minutes: 480 run: | ansible-playbook \ --connection local \ @@ -90,7 +90,7 @@ jobs: strategy: fail-fast: false matrix: - arch: [s390x] + arch: [ppc64le, s390x, arm64] env: PLATFORM: linux/${{ matrix.arch }} @@ -125,8 +125,6 @@ jobs: - name: Create Build VMs run: | make -C "${{ github.workspace }}/ansible" create-build-vms - env: - VM_TYPE: rhel-${{ matrix.arch }} - name: Create ansible vars run: | @@ -139,7 +137,7 @@ jobs: collector_git_ref: ${{ github.ref }} collector_git_sha: ${{ github.sha }} collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} - disable_profiling: true + disable_profiling: ${{ matrix.arch == 'arm64' }} rhacs_eng_image: ${{ env.RHACS_ENG_IMAGE }} collector_image: ${{ inputs.collector-image }} collector_tag: ${{ inputs.collector-tag }} diff --git a/ansible/ci-build-builder.yml b/ansible/ci-build-builder.yml index 009348599b..a699e3ce16 100644 --- a/ansible/ci-build-builder.yml +++ b/ansible/ci-build-builder.yml @@ -18,7 +18,7 @@ version: "{{ collector_git_sha }}" refspec: "+{{ collector_git_ref | replace('refs/', '') }}" recursive: true - when: arch == "s390x" or arch == "ppc64le" + when: arch != "amd64" - name: Build the collector builder image community.general.make: diff --git a/ansible/ci-build-collector.yml b/ansible/ci-build-collector.yml index bab569322f..98e55757a8 100644 --- a/ansible/ci-build-collector.yml +++ b/ansible/ci-build-collector.yml @@ -20,7 +20,7 @@ version: "{{ collector_git_sha }}" refspec: "+{{ collector_git_ref | replace('refs/', '') }}" recursive: true - when: arch == "s390x" or arch == "ppc64le" + when: arch != "amd64" - name: Run the builder image community.general.make: diff --git a/ansible/ci-create-build-vms.yml b/ansible/ci-create-build-vms.yml index 0c82d353fe..9909e2781e 100644 --- a/ansible/ci-create-build-vms.yml +++ b/ansible/ci-create-build-vms.yml @@ -9,6 +9,10 @@ name: create-all-vms vars: vm_list: "{{ virtual_machines }}" + post_tasks: + # We have all the VMs created now, so refresh the inventory - this allows + # us to use the provisioning role on the VMs we just created + - meta: refresh_inventory - name: Provision Build VMs hosts: "job_id_{{ job_id }}" From a7eb5be96efe614be5d599937e7cf58835baf98b Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 14 Mar 2024 14:32:44 +0100 Subject: [PATCH 4/5] Use fastest combinations - amd64: locally - arm64: remote VM - s390x: remote VM - ppc64le: builder on remote, collector image locally --- .github/workflows/collector-builder.yml | 2 ++ .github/workflows/collector-slim.yml | 4 +++- ansible/ci-build-builder.yml | 2 +- ansible/ci-build-collector.yml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/collector-builder.yml b/.github/workflows/collector-builder.yml index 9d7e3e56fe..342af6f3b5 100644 --- a/.github/workflows/collector-builder.yml +++ b/.github/workflows/collector-builder.yml @@ -101,6 +101,7 @@ jobs: collector_git_ref: ${{ github.ref }} collector_git_sha: ${{ github.sha }} collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} + clone_repository: false EOF - name: Build images @@ -182,6 +183,7 @@ jobs: collector_git_ref: ${{ github.ref }} collector_git_sha: ${{ github.sha }} collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }} + clone_repository: true EOF - name: Build images diff --git a/.github/workflows/collector-slim.yml b/.github/workflows/collector-slim.yml index 8a299fe51b..6ac8f59b45 100644 --- a/.github/workflows/collector-slim.yml +++ b/.github/workflows/collector-slim.yml @@ -66,6 +66,7 @@ jobs: rhacs_eng_image: ${{ env.RHACS_ENG_IMAGE }} collector_image: ${{ inputs.collector-image }} collector_tag: ${{ inputs.collector-tag }} + clone_repository: false EOF - name: Build images @@ -90,7 +91,7 @@ jobs: strategy: fail-fast: false matrix: - arch: [ppc64le, s390x, arm64] + arch: [s390x, arm64] env: PLATFORM: linux/${{ matrix.arch }} @@ -141,6 +142,7 @@ jobs: rhacs_eng_image: ${{ env.RHACS_ENG_IMAGE }} collector_image: ${{ inputs.collector-image }} collector_tag: ${{ inputs.collector-tag }} + clone_repository: true EOF - name: Build ${{ matrix.arch }} image diff --git a/ansible/ci-build-builder.yml b/ansible/ci-build-builder.yml index a699e3ce16..6497dd3e4d 100644 --- a/ansible/ci-build-builder.yml +++ b/ansible/ci-build-builder.yml @@ -18,7 +18,7 @@ version: "{{ collector_git_sha }}" refspec: "+{{ collector_git_ref | replace('refs/', '') }}" recursive: true - when: arch != "amd64" + when: clone_repository - name: Build the collector builder image community.general.make: diff --git a/ansible/ci-build-collector.yml b/ansible/ci-build-collector.yml index 98e55757a8..7891fa4c54 100644 --- a/ansible/ci-build-collector.yml +++ b/ansible/ci-build-collector.yml @@ -20,7 +20,7 @@ version: "{{ collector_git_sha }}" refspec: "+{{ collector_git_ref | replace('refs/', '') }}" recursive: true - when: arch != "amd64" + when: clone_repository - name: Run the builder image community.general.make: From 6d195dbf3a65c650f4624d0c152abfd9fad73914 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Fri, 15 Mar 2024 09:02:42 +0100 Subject: [PATCH 5/5] Use full ref for cloning --- ansible/ci-build-builder.yml | 2 +- ansible/ci-build-collector.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/ci-build-builder.yml b/ansible/ci-build-builder.yml index 6497dd3e4d..6cb8206f36 100644 --- a/ansible/ci-build-builder.yml +++ b/ansible/ci-build-builder.yml @@ -16,7 +16,7 @@ repo: https://github.com/stackrox/collector dest: "{{ collector_root }}" version: "{{ collector_git_sha }}" - refspec: "+{{ collector_git_ref | replace('refs/', '') }}" + refspec: "+{{ collector_git_ref }}" recursive: true when: clone_repository diff --git a/ansible/ci-build-collector.yml b/ansible/ci-build-collector.yml index 7891fa4c54..79194ce777 100644 --- a/ansible/ci-build-collector.yml +++ b/ansible/ci-build-collector.yml @@ -18,7 +18,7 @@ repo: https://github.com/stackrox/collector dest: "{{ collector_root }}" version: "{{ collector_git_sha }}" - refspec: "+{{ collector_git_ref | replace('refs/', '') }}" + refspec: "+{{ collector_git_ref }}" recursive: true when: clone_repository