Skip to content

Commit 482bf79

Browse files
StringyMolter73
andauthored
ROX-30260: add support for arm64 [upstream] (#30)
--------- Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
1 parent 6f4df99 commit 482bf79

File tree

10 files changed

+336024
-160918
lines changed

10 files changed

+336024
-160918
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ concurrency:
1717

1818
jobs:
1919
basic:
20-
runs-on: ubuntu-24.04
20+
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
2121
strategy:
2222
fail-fast: false
2323
matrix:
2424
args:
2525
- build --release
2626
- clippy -- -D warnings
2727
- test
28+
arch:
29+
- amd64
30+
- arm64
2831
steps:
2932
- uses: actions/checkout@v4
3033
with:
@@ -57,40 +60,84 @@ jobs:
5760
~/.cargo/registry/cache/
5861
~/.cargo/git/db/
5962
target/
60-
key: ${{ runner.os }}-cargo-${{ steps.args.outputs.args }}-${{ hashFiles('**/Cargo.lock') }}
63+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ steps.args.outputs.args }}-${{ hashFiles('**/Cargo.lock') }}
6164
- run: cargo ${{ matrix.args }}
6265

63-
container:
66+
vars:
6467
runs-on: ubuntu-24.04
68+
outputs:
69+
tag: ${{ steps.vars.outputs.tag }}
70+
image-name: ${{ steps.vars.outputs.image-name }}
6571
steps:
6672
- uses: actions/checkout@v4
6773
with:
6874
submodules: true
75+
76+
- id: vars
77+
run: |
78+
cat << EOF >> "$GITHUB_OUTPUT"
79+
tag=$(make tag)
80+
image-name=$(make image-name)
81+
EOF
82+
83+
container:
84+
needs:
85+
- vars
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
arch:
90+
- amd64
91+
- arm64
92+
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
93+
env:
94+
FACT_TAG: ${{ needs.vars.outputs.tag }}-${{ matrix.arch }}
95+
steps:
96+
- uses: actions/checkout@v4
97+
with:
98+
submodules: true
99+
69100
- run: make image
101+
70102
- name: Login to quay.io/stackrox-io
71103
uses: docker/login-action@v3
72104
with:
73105
registry: quay.io
74106
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
75107
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}
108+
76109
- run: docker push "$(make image-name)"
77110

78-
tag:
111+
manifest:
79112
runs-on: ubuntu-24.04
80-
outputs:
81-
tag: ${{ steps.tag.outputs.tag }}
113+
needs:
114+
- container
115+
- vars
116+
env:
117+
ARCHS: amd64 arm64
82118
steps:
83-
- uses: actions/checkout@v4
84-
with:
85-
submodules: true
86-
- id: tag
87-
run: echo "tag=$(make tag)" >> "$GITHUB_OUTPUT"
119+
- uses: actions/checkout@v4
120+
with:
121+
repository: stackrox/collector
122+
path: collector
123+
ref: master
124+
125+
- uses: docker/login-action@v3
126+
with:
127+
registry: quay.io
128+
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
129+
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}
130+
131+
- uses: ./collector/.github/actions/create-multiarch-manifest
132+
with:
133+
base-image: ${{ needs.vars.outputs.image-name }}
134+
archs: ${{ env.ARCHS }}
88135

89136
integration-tests:
90137
needs:
91-
- container
92-
- tag
138+
- vars
139+
- manifest
93140
uses: ./.github/workflows/integration-tests.yml
94141
with:
95-
tag: ${{ needs.tag.outputs.tag }}
142+
tag: ${{ needs.vars.outputs.tag }}
96143
secrets: inherit

.github/workflows/integration-tests.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,21 @@ on:
1818
type: string
1919
default: ''
2020

21+
# TODO: Remove once Konflux builds have been
22+
# modified to support Arm
23+
vm_list:
24+
description: JSON list of VMs to test on
25+
default: '["fedora-coreos","fcarm"]'
26+
type: string
27+
2128
jobs:
2229
integration-tests:
2330
runs-on: ubuntu-24.04
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
vm: "${{ fromJSON(inputs.vm_list) }}"
35+
2436
steps:
2537
- uses: actions/checkout@v4
2638
with:
@@ -53,7 +65,7 @@ jobs:
5365
ppc64le-key: ${{ secrets.IBM_CLOUD_POWER_API_KEY }}
5466
redhat-username: ${{ secrets.REDHAT_USERNAME }}
5567
redhat-password: ${{ secrets.REDHAT_PASSWORD }}
56-
vm-type: fedora-coreos
68+
vm-type: ${{ matrix.vm }}
5769
job-tag: ${{ inputs.job-tag }}
5870
workspace: ${{ github.workspace }}/collector
5971

@@ -110,7 +122,7 @@ jobs:
110122
if: always()
111123
uses: actions/upload-artifact@v4
112124
with:
113-
name: test-logs
125+
name: ${{ matrix.vm }}-test-logs
114126
path: |
115127
${{ github.workspace }}/fact/tests/logs
116128
${{ github.workspace }}/fact/tests/results.xml

.github/workflows/konflux-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ jobs:
5050
registry: quay.io/rhacs-eng/fact
5151
tag: ${{ needs.init.outputs.fact-tag }}
5252
job-tag: konf
53+
vm_list: '["fedora-coreos"]'
5354
secrets: inherit
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
ansible_user: core

ansible/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Run integration tests
3-
hosts: "job_id_{{ job_id }}"
3+
hosts: "platform_*:&job_id_{{ job_id }}"
44
environment:
55
FACT_IMAGE_NAME: "{{ fact.image | default(None) }}"
66

0 commit comments

Comments
 (0)