Skip to content

Commit 66c6dab

Browse files
red-hat-konfluxsyedriko
authored andcommitted
Switch to multi-platform build pipeline, for x86_64 and arm64
1 parent 0bdf249 commit 66c6dab

File tree

2 files changed

+80
-34
lines changed

2 files changed

+80
-34
lines changed

.tekton/openshift-mcp-server-pull-request.yaml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ spec:
3131
value: quay.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/openshift-mcp-server:on-pr-{{revision}}
3232
- name: image-expires-after
3333
value: 5d
34-
- name: dockerfile
35-
value: Dockerfile.ocp
36-
- name: path-context
37-
value: .
3834
- name: build-platforms
3935
value:
4036
- linux/x86_64
4137
- linux/arm64
4238
- name: hermetic
43-
value: "true"
39+
value: true
40+
- name: dockerfile
41+
value: Dockerfile.ocp
42+
- name: path-context
43+
value: .
4444
pipelineSpec:
4545
description: |
46-
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
46+
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
4747
48-
_Uses `buildah` to create a container image leveraging [trusted artifacts](https://konflux-ci.dev/architecture/ADR/0036-trusted-artifacts.html). It also optionally creates a source image and runs some build-time tests. Information is shared between tasks using OCI artifacts instead of PVCs. EC will pass the [`trusted_task.trusted`](https://conforma.dev/docs/policy/packages/release_trusted_task.html#trusted_task__trusted) policy as long as all data used to build the artifact is generated from trusted tasks.
49-
This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/repository/konflux-ci/tekton-catalog/pipeline-docker-build-oci-ta?tab=tags)_
48+
_Uses `buildah` to create a multi-platform container image leveraging [trusted artifacts](https://konflux-ci.dev/architecture/ADR/0036-trusted-artifacts.html). It also optionally creates a source image and runs some build-time tests. This pipeline requires that the [multi platform controller](https://github.com/konflux-ci/multi-platform-controller) is deployed and configured on your Konflux instance. Information is shared between tasks using OCI artifacts instead of PVCs. EC will pass the [`trusted_task.trusted`](https://conforma.dev/docs/policy/packages/release_trusted_task.html#trusted_task__trusted) policy as long as all data used to build the artifact is generated from trusted tasks.
49+
This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/repository/konflux-ci/tekton-catalog/pipeline-docker-build-multi-platform-oci-ta?tab=tags)_
5050
finally:
5151
- name: show-sbom
5252
params:
@@ -107,7 +107,7 @@ spec:
107107
description: Build a source image.
108108
name: build-source-image
109109
type: string
110-
- default: "false"
110+
- default: "true"
111111
description: Add built image into an OCI image index
112112
name: build-image-index
113113
type: string
@@ -124,6 +124,12 @@ spec:
124124
VMs
125125
name: privileged-nested
126126
type: string
127+
- default:
128+
- linux/x86_64
129+
description: List of platforms to build the container images on. The available
130+
set of values is determined by the configuration of the multi-platform-controller.
131+
name: build-platforms
132+
type: array
127133
results:
128134
- description: ""
129135
name: IMAGE_URL
@@ -210,7 +216,12 @@ spec:
210216
workspace: git-auth
211217
- name: netrc
212218
workspace: netrc
213-
- name: build-container
219+
- matrix:
220+
params:
221+
- name: PLATFORM
222+
value:
223+
- $(params.build-platforms)
224+
name: build-images
214225
params:
215226
- name: IMAGE
216227
value: $(params.output-image)
@@ -237,14 +248,16 @@ spec:
237248
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
238249
- name: CACHI2_ARTIFACT
239250
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
251+
- name: IMAGE_APPEND_PLATFORM
252+
value: "true"
240253
runAfter:
241254
- prefetch-dependencies
242255
taskRef:
243256
params:
244257
- name: name
245-
value: buildah-oci-ta
258+
value: buildah-remote-oci-ta
246259
- name: bundle
247-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.4@sha256:3e1e08f539ea3e70b473f348a4b4dc50f8bfc49d40d18e89591358c19fae5aa2
260+
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.4@sha256:e1c03f2be119f8000100ac10cba614cf7d0d77597a04aa74bc72d91df183bc5b
248261
- name: kind
249262
value: task
250263
resolver: bundles
@@ -265,9 +278,9 @@ spec:
265278
value: $(params.build-image-index)
266279
- name: IMAGES
267280
value:
268-
- $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
281+
- $(tasks.build-images.results.IMAGE_REF[*])
269282
runAfter:
270-
- build-container
283+
- build-images
271284
taskRef:
272285
params:
273286
- name: name
@@ -356,7 +369,12 @@ spec:
356369
operator: in
357370
values:
358371
- "false"
359-
- name: ecosystem-cert-preflight-checks
372+
- matrix:
373+
params:
374+
- name: platform
375+
value:
376+
- $(params.build-platforms)
377+
name: ecosystem-cert-preflight-checks
360378
params:
361379
- name: image-url
362380
value: $(tasks.build-image-index.results.IMAGE_URL)
@@ -367,7 +385,7 @@ spec:
367385
- name: name
368386
value: ecosystem-cert-preflight-checks
369387
- name: bundle
370-
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:51d698844b207f7bedff69cc8718858cbc7407b0cadbea3033e5965e71ae5e96
388+
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:3de22bd7d3c274bc00f95a6bb5ed61559c3354aae74568d7afa364b896b513a6
371389
- name: kind
372390
value: task
373391
resolver: bundles
@@ -402,7 +420,12 @@ spec:
402420
operator: in
403421
values:
404422
- "false"
405-
- name: clamav-scan
423+
- matrix:
424+
params:
425+
- name: image-arch
426+
value:
427+
- $(params.build-platforms)
428+
name: clamav-scan
406429
params:
407430
- name: image-digest
408431
value: $(tasks.build-image-index.results.IMAGE_DIGEST)

.tekton/openshift-mcp-server-push.yaml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ spec:
3030
value: quay.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/openshift-mcp-server:{{revision}}
3131
- name: image-expires-after
3232
value: 5d
33-
- name: dockerfile
34-
value: Dockerfile.ocp
35-
- name: path-context
36-
value: .
3733
- name: build-platforms
3834
value:
3935
- linux/x86_64
4036
- linux/arm64
4137
- name: hermetic
42-
value: "true"
38+
value: true
39+
- name: dockerfile
40+
value: Dockerfile.ocp
41+
- name: path-context
42+
value: .
4343
pipelineSpec:
4444
description: |
45-
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
45+
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
4646
47-
_Uses `buildah` to create a container image leveraging [trusted artifacts](https://konflux-ci.dev/architecture/ADR/0036-trusted-artifacts.html). It also optionally creates a source image and runs some build-time tests. Information is shared between tasks using OCI artifacts instead of PVCs. EC will pass the [`trusted_task.trusted`](https://conforma.dev/docs/policy/packages/release_trusted_task.html#trusted_task__trusted) policy as long as all data used to build the artifact is generated from trusted tasks.
48-
This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/repository/konflux-ci/tekton-catalog/pipeline-docker-build-oci-ta?tab=tags)_
47+
_Uses `buildah` to create a multi-platform container image leveraging [trusted artifacts](https://konflux-ci.dev/architecture/ADR/0036-trusted-artifacts.html). It also optionally creates a source image and runs some build-time tests. This pipeline requires that the [multi platform controller](https://github.com/konflux-ci/multi-platform-controller) is deployed and configured on your Konflux instance. Information is shared between tasks using OCI artifacts instead of PVCs. EC will pass the [`trusted_task.trusted`](https://conforma.dev/docs/policy/packages/release_trusted_task.html#trusted_task__trusted) policy as long as all data used to build the artifact is generated from trusted tasks.
48+
This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/repository/konflux-ci/tekton-catalog/pipeline-docker-build-multi-platform-oci-ta?tab=tags)_
4949
finally:
5050
- name: show-sbom
5151
params:
@@ -106,7 +106,7 @@ spec:
106106
description: Build a source image.
107107
name: build-source-image
108108
type: string
109-
- default: "false"
109+
- default: "true"
110110
description: Add built image into an OCI image index
111111
name: build-image-index
112112
type: string
@@ -123,6 +123,12 @@ spec:
123123
VMs
124124
name: privileged-nested
125125
type: string
126+
- default:
127+
- linux/x86_64
128+
description: List of platforms to build the container images on. The available
129+
set of values is determined by the configuration of the multi-platform-controller.
130+
name: build-platforms
131+
type: array
126132
results:
127133
- description: ""
128134
name: IMAGE_URL
@@ -209,7 +215,12 @@ spec:
209215
workspace: git-auth
210216
- name: netrc
211217
workspace: netrc
212-
- name: build-container
218+
- matrix:
219+
params:
220+
- name: PLATFORM
221+
value:
222+
- $(params.build-platforms)
223+
name: build-images
213224
params:
214225
- name: IMAGE
215226
value: $(params.output-image)
@@ -236,14 +247,16 @@ spec:
236247
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
237248
- name: CACHI2_ARTIFACT
238249
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
250+
- name: IMAGE_APPEND_PLATFORM
251+
value: "true"
239252
runAfter:
240253
- prefetch-dependencies
241254
taskRef:
242255
params:
243256
- name: name
244-
value: buildah-oci-ta
257+
value: buildah-remote-oci-ta
245258
- name: bundle
246-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.4@sha256:3e1e08f539ea3e70b473f348a4b4dc50f8bfc49d40d18e89591358c19fae5aa2
259+
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.4@sha256:e1c03f2be119f8000100ac10cba614cf7d0d77597a04aa74bc72d91df183bc5b
247260
- name: kind
248261
value: task
249262
resolver: bundles
@@ -264,9 +277,9 @@ spec:
264277
value: $(params.build-image-index)
265278
- name: IMAGES
266279
value:
267-
- $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
280+
- $(tasks.build-images.results.IMAGE_REF[*])
268281
runAfter:
269-
- build-container
282+
- build-images
270283
taskRef:
271284
params:
272285
- name: name
@@ -355,7 +368,12 @@ spec:
355368
operator: in
356369
values:
357370
- "false"
358-
- name: ecosystem-cert-preflight-checks
371+
- matrix:
372+
params:
373+
- name: platform
374+
value:
375+
- $(params.build-platforms)
376+
name: ecosystem-cert-preflight-checks
359377
params:
360378
- name: image-url
361379
value: $(tasks.build-image-index.results.IMAGE_URL)
@@ -366,7 +384,7 @@ spec:
366384
- name: name
367385
value: ecosystem-cert-preflight-checks
368386
- name: bundle
369-
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:51d698844b207f7bedff69cc8718858cbc7407b0cadbea3033e5965e71ae5e96
387+
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:3de22bd7d3c274bc00f95a6bb5ed61559c3354aae74568d7afa364b896b513a6
370388
- name: kind
371389
value: task
372390
resolver: bundles
@@ -401,7 +419,12 @@ spec:
401419
operator: in
402420
values:
403421
- "false"
404-
- name: clamav-scan
422+
- matrix:
423+
params:
424+
- name: image-arch
425+
value:
426+
- $(params.build-platforms)
427+
name: clamav-scan
405428
params:
406429
- name: image-digest
407430
value: $(tasks.build-image-index.results.IMAGE_DIGEST)

0 commit comments

Comments
 (0)