Skip to content

Commit

Permalink
Attempt to build all multiarch platforms natively
Browse files Browse the repository at this point in the history
  • Loading branch information
Stringy committed Dec 20, 2023
1 parent de0f77e commit 59b0290
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/collector-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ jobs:
ppc64le-key: ${{ secrets.IBM_CLOUD_POWER_API_KEY }}
redhat-username: ${{ secrets.REDHAT_USERNAME }}
redhat-password: ${{ secrets.REDHAT_PASSWORD }}
vm-type: all
vm-type: ${{ matrix.arch }}
job-tag: builder

- name: Create Build VMs
if: matrix.arch == 's390x'
if: matrix.arch != 'amd64'
run: |
make -C "${{ github.workspace }}/ansible" create-build-vms
Expand Down Expand Up @@ -129,10 +129,7 @@ jobs:
} > ${{ github.workspace }}/ansible/secrets.yml
- name: Build images
if: |
github.event_name == 'push' ||
matrix.arch == 'amd64' ||
(contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch != 's390x')
if: matrix.arch == 'amd64'
timeout-minutes: 480
run: |
ansible-playbook \
Expand All @@ -143,21 +140,24 @@ jobs:
-e @'${{ github.workspace }}/ansible/secrets.yml' \
ansible/ci-build-builder.yml
- name: Build s390x images
- name: Build multiarch images
if: |
github.event_name == 'push' ||
(contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch == 's390x')
github.event_name == 'push' &&
matrix.arch != 'amd64' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
timeout-minutes: 480
run: |
ansible-playbook \
-i ansible/ci \
-e build_hosts='job_id_${{ env.JOB_ID }}' \
-e build_hosts='job_id_${{ env.JOB_ID }}:&vm_arch_${{ matrix.arch }}' \
-e arch='${{ matrix.arch }}' \
-e @'${{ github.workspace }}/ansible/secrets.yml' \
ansible/ci-build-builder.yml
- name: Destroy VMs
if: always() && matrix.arch == 's390x'
if: always() &&
matrix.arch != 'amd64' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
run: |
make -C ansible destroy-vms
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/collector-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ jobs:
ppc64le-key: ${{ secrets.IBM_CLOUD_POWER_API_KEY }}
redhat-username: ${{ secrets.REDHAT_USERNAME }}
redhat-password: ${{ secrets.REDHAT_PASSWORD }}
vm-type: all
vm-type: ${{ matrix.arch }}
job-tag: builder

- name: Create Build VMs
if: matrix.arch == 's390x'
if: matrix.arch != 'amd64'
run: |
make -C "${{ github.workspace }}/ansible" create-build-vms
Expand Down Expand Up @@ -114,10 +114,7 @@ jobs:
uses: 'google-github-actions/setup-gcloud@v1'

- name: Build images
if: |
github.event_name == 'push' ||
matrix.arch == 'amd64' ||
(contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch != 's390x')
if: matrix.arch == 'amd64'
timeout-minutes: 480
run: |
ansible-playbook \
Expand All @@ -128,16 +125,17 @@ jobs:
-e @'${{ github.workspace }}/ansible/secrets.yml' \
ansible/ci-build-collector.yml
- name: Build s390x image
- name: Build multiarch image
if: |
github.event_name == 'push' ||
(contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch == 's390x')
github.event_name == 'push' &&
matrix.arch != 'amd64' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
timeout-minutes: 480
run: |
ansible-playbook \
-i ansible/ci \
-e arch='${{ matrix.arch }}' \
-e build_hosts='job_id_${{ env.JOB_ID }}' \
-e build_hosts='job_id_${{ env.JOB_ID }}:&vm_arch_${{ matrix.arch }}' \
-e @'${{ github.workspace }}/ansible/secrets.yml' \
ansible/ci-build-collector.yml
env:
Expand All @@ -151,7 +149,9 @@ jobs:
retention-days: 1

- name: Destroy Build VMs
if: always() && matrix.arch == 's390x'
if: always() &&
matrix.arch != 'amd64' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
run: |
make -C ansible destroy-vms
Expand Down
5 changes: 3 additions & 2 deletions ansible/ci-create-build-vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
name: create-all-vms
vars:
vm_list:
# s390x
rhel-s390x: "{{ virtual_machines['rhel-s390x'] }}"
s390x: "{{ virtual_machines['rhel-s390x'] | combine({'families': ['rhel-8-6-s390x'] }) }}"
ppc64le: "{{ virtual_machines['rhel-ppc64le'] | combine({'families': ['p']}) }}"
arm64: "{{ virtual_machines[''] | combine({'families': ['fedora-coreos-stable-arm64']}) }}"

- name: Provision Build VMs
hosts: "job_id_{{ job_id }}"
Expand Down

0 comments on commit 59b0290

Please sign in to comment.