8
8
required : true
9
9
description : |
10
10
The tag used to build the collector image
11
- architectures :
12
- type : string
13
- required : true
14
- description : |
15
- Space-separated list of architectures to build
16
11
17
12
outputs :
18
13
collector-builder-tag :
31
26
outputs :
32
27
build-image : ${{ steps.builder-tag.outputs.build-image || false }}
33
28
collector-builder-tag : ${{ steps.builder-tag.outputs.collector-builder-tag || 'master'}}
34
- local-exclude : ${{ steps.arch.outputs.local-exclude || '[]'}}
35
29
36
30
env :
37
31
DEFAULT_BUILDER_TAG : master
@@ -70,24 +64,23 @@ jobs:
70
64
echo "collector-builder-tag=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_OUTPUT"
71
65
echo "build-image=true" >> "$GITHUB_OUTPUT"
72
66
73
- - name : Check arches for local build
74
- if : ${{ ! contains(inputs.architectures, 'ppc64le') }}
75
- id : arch
76
- run : echo 'local-exclude=[{"arch":"ppc64le"}]' >> "$GITHUB_OUTPUT"
77
-
78
67
build-builder-image :
79
- name : Local builder image
80
- # Multiarch builds sometimes take for eeeeeeeeeever
81
- timeout-minutes : 480
68
+ name : Build builder image
82
69
needs :
83
70
- builder-needs-rebuilding
84
71
if : |
85
72
needs.builder-needs-rebuilding.outputs.build-image == 'true'
86
73
strategy :
87
74
matrix :
88
- arch : [amd64, arm64, ppc64le]
89
- exclude : ${{ fromJSON(needs.builder-needs-rebuilding.outputs.local-exclude) }}
90
- runs-on : ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}
75
+ arch :
76
+ - amd64
77
+ - arm64
78
+ - ppc64le
79
+ - s390x
80
+ runs-on : ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') ||
81
+ (matrix.arch == 'ppc64le' && 'ubuntu-24.04-ppc64le') ||
82
+ (matrix.arch == 's390x' && 'ubuntu-24.04-s390x') ||
83
+ ' ubuntu-24.04' }}
91
84
92
85
env :
93
86
PLATFORM : linux/${{ matrix.arch }}
@@ -99,14 +92,14 @@ jobs:
99
92
with :
100
93
submodules : true
101
94
102
- - name : Set up QEMU
103
- uses : docker/setup-qemu-action@v3
104
- with :
105
- image : tonistiigi/binfmt:qemu-v8.1.5
106
-
107
95
- name : Set up Docker Buildx
108
96
uses : docker/setup-buildx-action@v3
109
97
98
+ - name : Install ansible on P&Z runners
99
+ if : matrix.arch == 'ppc64le' || matrix.arch == 's390x'
100
+ run : |
101
+ sudo apt-get install -y ansible
102
+
110
103
- name : Create ansible vars
111
104
run : |
112
105
cat << EOF > ${{ github.workspace }}/ansible/secrets.yml
@@ -120,7 +113,6 @@ jobs:
120
113
EOF
121
114
122
115
- name : Build images
123
- timeout-minutes : 480
124
116
run : |
125
117
ansible-galaxy install -r ansible/requirements.yml
126
118
ansible-playbook \
@@ -131,98 +123,18 @@ jobs:
131
123
-e @'${{ github.workspace }}/ansible/secrets.yml' \
132
124
ansible/ci-build-builder.yml
133
125
134
- build-builder-image-remote-vm :
135
- name : Remote builder image
136
- # Multiarch builds sometimes take for eeeeeeeeeever
137
- timeout-minutes : 480
138
- needs :
139
- - builder-needs-rebuilding
140
- if : |
141
- needs.builder-needs-rebuilding.outputs.build-image == 'true' &&
142
- contains(inputs.architectures, 's390x')
143
- strategy :
144
- matrix :
145
- arch : [s390x]
146
- runs-on : ubuntu-24.04
147
-
148
- env :
149
- PLATFORM : linux/${{ matrix.arch }}
150
- BUILD_TYPE : ci
151
- COLLECTOR_BUILDER_TAG : ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }}
152
-
153
- steps :
154
- - uses : actions/checkout@v4
155
- with :
156
- submodules : true
157
-
158
- - uses : actions/setup-python@v5
159
- with :
160
- python-version : " 3.10"
161
-
162
- - uses : ' google-github-actions/auth@v2'
163
- with :
164
- credentials_json : ' ${{ secrets.GOOGLE_CREDENTIALS_COLLECTOR_SVC_ACCT }}'
165
-
166
- - uses : ' google-github-actions/setup-gcloud@v2'
167
-
168
- - uses : ./.github/actions/setup-vm-creds
169
- with :
170
- gcp-ssh-key : ${{ secrets.GCP_SSH_KEY }}
171
- gcp-ssh-key-pub : ${{ secrets.GCP_SSH_KEY_PUB }}
172
- s390x-ssh-key : ${{ secrets.IBM_CLOUD_S390X_SSH_PRIVATE_KEY }}
173
- ppc64le-ssh-key : ${{ secrets.IBM_CLOUD_POWER_SSH_PRIVATE_KEY }}
174
- ppc64le-ssh-key-pub : ${{ secrets.IBM_CLOUD_POWER_SSH_PUBLIC_KEY }}
175
- s390x-key : ${{ secrets.IBM_CLOUD_S390x_API_KEY }}
176
- ppc64le-key : ${{ secrets.IBM_CLOUD_POWER_API_KEY }}
177
- redhat-username : ${{ secrets.REDHAT_USERNAME }}
178
- redhat-password : ${{ secrets.REDHAT_PASSWORD }}
179
- vm-type : all
180
- job-tag : builder
181
-
182
- - name : Create Build VMs
183
- run : |
184
- make -C "${{ github.workspace }}/ansible" create-build-vms
185
-
186
- - name : Create ansible vars
187
- run : |
188
- cat << EOF > ${{ github.workspace }}/ansible/secrets.yml
189
- ---
190
- stackrox_io_username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
191
- stackrox_io_password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}
192
- rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
193
- rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}
194
- collector_git_ref: ${{ github.ref }}
195
- collector_builder_tag: ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }}
196
- EOF
197
-
198
- - name : Build images
199
- timeout-minutes : 480
200
- run : |
201
- ansible-playbook \
202
- -i ansible/ci \
203
- -e build_hosts='job_id_${{ env.JOB_ID }}' \
204
- -e arch='${{ matrix.arch }}' \
205
- -e @'${{ github.workspace }}/ansible/secrets.yml' \
206
- ansible/ci-build-builder.yml
207
-
208
- - name : Destroy VMs
209
- if : always()
210
- run : |
211
- make -C ansible destroy-vms
212
-
213
126
create-multiarch-manifest :
214
127
needs :
215
128
- builder-needs-rebuilding
216
129
- build-builder-image
217
- - build-builder-image-remote-vm
218
130
name : Create Multiarch manifest
219
131
runs-on : ubuntu-24.04
220
132
if : |
221
133
always() && !contains(join(needs.*.result, ','), 'failure') &&
222
134
needs.builder-needs-rebuilding.outputs.build-image == 'true'
223
135
env :
224
136
COLLECTOR_BUILDER_TAG : ${{ needs.builder-needs-rebuilding.outputs.collector-builder-tag }}
225
- ARCHS : ${{ inputs.architectures }}
137
+ ARCHS : amd64 arm64 ppc64le s390x
226
138
227
139
steps :
228
140
- uses : actions/checkout@v4
@@ -258,7 +170,6 @@ jobs:
258
170
if : always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
259
171
needs :
260
172
- build-builder-image
261
- - build-builder-image-remote-vm
262
173
- create-multiarch-manifest
263
174
steps :
264
175
- name : Slack notification
0 commit comments