Skip to content

Commit 99f31a7

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

File tree

2 files changed

+80
-22
lines changed

2 files changed

+80
-22
lines changed

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

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ 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: build-platforms
35+
value:
36+
- linux/x86_64
37+
- linux/arm64
38+
- name: hermetic
39+
value: true
3440
- name: dockerfile
3541
value: Dockerfile.ocp
3642
- name: path-context
@@ -43,10 +49,10 @@ spec:
4349
value: "true"
4450
pipelineSpec:
4551
description: |
46-
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
52+
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
4753
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)_
54+
_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.
55+
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)_
5056
finally:
5157
- name: show-sbom
5258
params:
@@ -107,7 +113,7 @@ spec:
107113
description: Build a source image.
108114
name: build-source-image
109115
type: string
110-
- default: "false"
116+
- default: "true"
111117
description: Add built image into an OCI image index
112118
name: build-image-index
113119
type: string
@@ -124,6 +130,12 @@ spec:
124130
VMs
125131
name: privileged-nested
126132
type: string
133+
- default:
134+
- linux/x86_64
135+
description: List of platforms to build the container images on. The available
136+
set of values is determined by the configuration of the multi-platform-controller.
137+
name: build-platforms
138+
type: array
127139
results:
128140
- description: ""
129141
name: IMAGE_URL
@@ -210,7 +222,12 @@ spec:
210222
workspace: git-auth
211223
- name: netrc
212224
workspace: netrc
213-
- name: build-container
225+
- matrix:
226+
params:
227+
- name: PLATFORM
228+
value:
229+
- $(params.build-platforms)
230+
name: build-images
214231
params:
215232
- name: IMAGE
216233
value: $(params.output-image)
@@ -237,14 +254,16 @@ spec:
237254
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
238255
- name: CACHI2_ARTIFACT
239256
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
257+
- name: IMAGE_APPEND_PLATFORM
258+
value: "true"
240259
runAfter:
241260
- prefetch-dependencies
242261
taskRef:
243262
params:
244263
- name: name
245-
value: buildah-oci-ta
264+
value: buildah-remote-oci-ta
246265
- name: bundle
247-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.4@sha256:3e1e08f539ea3e70b473f348a4b4dc50f8bfc49d40d18e89591358c19fae5aa2
266+
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.4@sha256:e1c03f2be119f8000100ac10cba614cf7d0d77597a04aa74bc72d91df183bc5b
248267
- name: kind
249268
value: task
250269
resolver: bundles
@@ -265,9 +284,9 @@ spec:
265284
value: $(params.build-image-index)
266285
- name: IMAGES
267286
value:
268-
- $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
287+
- $(tasks.build-images.results.IMAGE_REF[*])
269288
runAfter:
270-
- build-container
289+
- build-images
271290
taskRef:
272291
params:
273292
- name: name
@@ -356,7 +375,12 @@ spec:
356375
operator: in
357376
values:
358377
- "false"
359-
- name: ecosystem-cert-preflight-checks
378+
- matrix:
379+
params:
380+
- name: platform
381+
value:
382+
- $(params.build-platforms)
383+
name: ecosystem-cert-preflight-checks
360384
params:
361385
- name: image-url
362386
value: $(tasks.build-image-index.results.IMAGE_URL)
@@ -402,7 +426,12 @@ spec:
402426
operator: in
403427
values:
404428
- "false"
405-
- name: clamav-scan
429+
- matrix:
430+
params:
431+
- name: image-arch
432+
value:
433+
- $(params.build-platforms)
434+
name: clamav-scan
406435
params:
407436
- name: image-digest
408437
value: $(tasks.build-image-index.results.IMAGE_DIGEST)

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

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ 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: build-platforms
34+
value:
35+
- linux/x86_64
36+
- linux/arm64
37+
- name: hermetic
38+
value: true
3339
- name: dockerfile
3440
value: Dockerfile.ocp
3541
- name: path-context
@@ -42,10 +48,10 @@ spec:
4248
value: "true"
4349
pipelineSpec:
4450
description: |
45-
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
51+
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
4652
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)_
53+
_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.
54+
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)_
4955
finally:
5056
- name: show-sbom
5157
params:
@@ -106,7 +112,7 @@ spec:
106112
description: Build a source image.
107113
name: build-source-image
108114
type: string
109-
- default: "false"
115+
- default: "true"
110116
description: Add built image into an OCI image index
111117
name: build-image-index
112118
type: string
@@ -123,6 +129,12 @@ spec:
123129
VMs
124130
name: privileged-nested
125131
type: string
132+
- default:
133+
- linux/x86_64
134+
description: List of platforms to build the container images on. The available
135+
set of values is determined by the configuration of the multi-platform-controller.
136+
name: build-platforms
137+
type: array
126138
results:
127139
- description: ""
128140
name: IMAGE_URL
@@ -209,7 +221,12 @@ spec:
209221
workspace: git-auth
210222
- name: netrc
211223
workspace: netrc
212-
- name: build-container
224+
- matrix:
225+
params:
226+
- name: PLATFORM
227+
value:
228+
- $(params.build-platforms)
229+
name: build-images
213230
params:
214231
- name: IMAGE
215232
value: $(params.output-image)
@@ -236,14 +253,16 @@ spec:
236253
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
237254
- name: CACHI2_ARTIFACT
238255
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
256+
- name: IMAGE_APPEND_PLATFORM
257+
value: "true"
239258
runAfter:
240259
- prefetch-dependencies
241260
taskRef:
242261
params:
243262
- name: name
244-
value: buildah-oci-ta
263+
value: buildah-remote-oci-ta
245264
- name: bundle
246-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.4@sha256:3e1e08f539ea3e70b473f348a4b4dc50f8bfc49d40d18e89591358c19fae5aa2
265+
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.4@sha256:e1c03f2be119f8000100ac10cba614cf7d0d77597a04aa74bc72d91df183bc5b
247266
- name: kind
248267
value: task
249268
resolver: bundles
@@ -264,9 +283,9 @@ spec:
264283
value: $(params.build-image-index)
265284
- name: IMAGES
266285
value:
267-
- $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
286+
- $(tasks.build-images.results.IMAGE_REF[*])
268287
runAfter:
269-
- build-container
288+
- build-images
270289
taskRef:
271290
params:
272291
- name: name
@@ -355,7 +374,12 @@ spec:
355374
operator: in
356375
values:
357376
- "false"
358-
- name: ecosystem-cert-preflight-checks
377+
- matrix:
378+
params:
379+
- name: platform
380+
value:
381+
- $(params.build-platforms)
382+
name: ecosystem-cert-preflight-checks
359383
params:
360384
- name: image-url
361385
value: $(tasks.build-image-index.results.IMAGE_URL)
@@ -401,7 +425,12 @@ spec:
401425
operator: in
402426
values:
403427
- "false"
404-
- name: clamav-scan
428+
- matrix:
429+
params:
430+
- name: image-arch
431+
value:
432+
- $(params.build-platforms)
433+
name: clamav-scan
405434
params:
406435
- name: image-digest
407436
value: $(tasks.build-image-index.results.IMAGE_DIGEST)

0 commit comments

Comments
 (0)