6060 collector-builder-tag : ${{ steps.builder-tag.outputs.collector-builder-tag }}
6161 strategy :
6262 matrix :
63- include : ${{ fromJSON(inputs.include-arch-json) }}
64- runs-on : ${{ matrix.runner }}
63+ arch : [amd64, arm64]
64+ runs-on : ${{ ( matrix.arch != 'arm64' && ubuntu-24.04) || 'ubuntu-24.04-arm' }}
6565
6666 env :
6767 PLATFORM : linux/${{ matrix.arch }}
@@ -73,30 +73,91 @@ jobs:
7373 submodules : true
7474
7575 - name : Set up QEMU
76- if : matrix.remote != true
7776 uses : docker/setup-qemu-action@v3
7877 with :
7978 image : tonistiigi/binfmt:qemu-v8.1.5
8079
8180 - name : Set up Docker Buildx
82- if : matrix.remote != true
8381 uses : docker/setup-buildx-action@v3
8482
83+ - name : Define builder tag
84+ id : builder-tag
85+ run : |
86+ COLLECTOR_BUILDER_TAG="${DEFAULT_BUILDER_TAG}"
87+ if [[ "${{ github.event_name }}" == 'pull_request' || \
88+ "${{ github.ref_type }}" == 'tag' || \
89+ "${{ github.ref_name }}" =~ ^release- ]]; then
90+ COLLECTOR_BUILDER_TAG="${{ inputs.collector-tag }}"
91+ fi
92+
93+ echo "COLLECTOR_BUILDER_TAG=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_ENV"
94+ echo "collector-builder-tag=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_OUTPUT"
95+
96+ - name : Create ansible vars
97+ run : |
98+ {
99+ echo "---"
100+ echo "stackrox_io_username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}"
101+ echo "stackrox_io_password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}"
102+ echo "rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}"
103+ echo "rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}"
104+ echo "collector_git_ref: ${{ github.ref }}"
105+ echo "collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }}"
106+ } > ${{ github.workspace }}/ansible/secrets.yml
107+
108+ - name : Build images
109+ timeout-minutes : 480
110+ run : |
111+ ansible-galaxy install -r ansible/requirements.yml
112+ ansible-playbook \
113+ --connection local \
114+ -i localhost, \
115+ --limit localhost \
116+ -e arch='${{ matrix.arch }}' \
117+ -e @'${{ github.workspace }}/ansible/secrets.yml' \
118+ ansible/ci-build-builder.yml
119+
120+ build-builder-image-remote :
121+ if : contains(inputs.include-arch-json, 's390x')
122+ name : Build the builder image
123+ # Multiarch builds sometimes take for eeeeeeeeeever
124+ timeout-minutes : 480
125+ needs :
126+ - builder-needs-rebuilding
127+ if : |
128+ needs.builder-needs-rebuilding.outputs.build-image == 'true' ||
129+ (github.event_name == 'push' && (
130+ github.ref_type == 'tag' || startsWith(github.ref_name, 'release-')
131+ )) ||
132+ contains(github.event.pull_request.labels.*.name, 'build-builder-image') ||
133+ github.event_name == 'schedule'
134+ outputs :
135+ collector-builder-tag : ${{ steps.builder-tag.outputs.collector-builder-tag }}
136+ strategy :
137+ matrix :
138+ arch : [s390x]
139+ runs-on : ubuntu-24.04
140+
141+ env :
142+ PLATFORM : linux/${{ matrix.arch }}
143+ BUILD_TYPE : ci
144+
145+ steps :
146+ - uses : actions/checkout@v4
147+ with :
148+ submodules : true
149+
85150 - uses : actions/setup-python@v5
86- if : matrix.remote
87151 with :
88152 python-version : " 3.10"
89153
90154 - uses : ' google-github-actions/auth@v2'
91- if : matrix.remote
92155 with :
93156 credentials_json : ' ${{ secrets.GOOGLE_CREDENTIALS_COLLECTOR_SVC_ACCT }}'
94157
95158 - uses : ' google-github-actions/setup-gcloud@v2'
96- if : matrix.remote
97159
98160 - uses : ./.github/actions/setup-vm-creds
99- if : matrix.remote
100161 with :
101162 gcp-ssh-key : ${{ secrets.GCP_SSH_KEY }}
102163 gcp-ssh-key-pub : ${{ secrets.GCP_SSH_KEY_PUB }}
@@ -111,7 +172,6 @@ jobs:
111172 job-tag : builder
112173
113174 - name : Create Build VMs
114- if : matrix.remote
115175 run : |
116176 make -C "${{ github.workspace }}/ansible" create-build-vms
117177
@@ -140,21 +200,7 @@ jobs:
140200 echo "collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }}"
141201 } > ${{ github.workspace }}/ansible/secrets.yml
142202
143- - name : Build images
144- if : matrix.remote != true
145- timeout-minutes : 480
146- run : |
147- ansible-galaxy install -r ansible/requirements.yml
148- ansible-playbook \
149- --connection local \
150- -i localhost, \
151- --limit localhost \
152- -e arch='${{ matrix.arch }}' \
153- -e @'${{ github.workspace }}/ansible/secrets.yml' \
154- ansible/ci-build-builder.yml
155-
156203 - name : Build s390x images
157- if : matrix.remote
158204 timeout-minutes : 480
159205 run : |
160206 ansible-playbook \
@@ -165,13 +211,14 @@ jobs:
165211 ansible/ci-build-builder.yml
166212
167213 - name : Destroy VMs
168- if : always() && matrix.remote
214+ if : always()
169215 run : |
170216 make -C ansible destroy-vms
171217
172218 create-multiarch-manifest :
173219 needs :
174220 - build-builder-image
221+ - build-builder-image-remote
175222 name : Create Multiarch manifest
176223 runs-on : ubuntu-24.04
177224 if : |
@@ -215,6 +262,7 @@ jobs:
215262 if : always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
216263 needs :
217264 - build-builder-image
265+ - build-builder-image-remote
218266 - create-multiarch-manifest
219267 steps :
220268 - name : Slack notification
0 commit comments