Skip to content

Commit 0485c39

Browse files
committed
ROX-25508: migrate collector pipeline to matrix builds (#2634)
1 parent be60f23 commit 0485c39

File tree

2 files changed

+37
-169
lines changed

2 files changed

+37
-169
lines changed

.tekton/collector-build.yaml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,8 @@ spec:
5858
secretName: '{{ git_auth_secret }}'
5959

6060
taskRunSpecs:
61-
62-
# Only adjusting computeResources for amd64 build because
63-
# multi-arch builds happen off cluster
64-
- pipelineTaskName: build-container-amd64
61+
- pipelineTaskName: build-images
6562
stepSpecs:
66-
- name: build
67-
# CPU requests are increased to speed up builds compared to the defaults.
68-
# Defaults: https://github.com/redhat-appstudio/build-definitions/blob/main/task/buildah/0.1/buildah.yaml#L126
69-
computeResources:
70-
limits:
71-
cpu: 4
72-
requests:
73-
cpu: 4
7463
- name: use-trusted-artifact
7564
# use-/create-trusted-artifact gets OOM-killed when a cluster is loaded. Bigger mem limits==request should help.
7665
computeResources: &ta-resources
@@ -105,18 +94,6 @@ spec:
10594
requests:
10695
cpu: "1"
10796
memory: 6Gi
108-
- pipelineTaskName: build-container-s390x
109-
stepSpecs:
110-
- name: use-trusted-artifact
111-
computeResources: *ta-resources
112-
- pipelineTaskName: build-container-ppc64le
113-
stepSpecs:
114-
- name: use-trusted-artifact
115-
computeResources: *ta-resources
116-
- pipelineTaskName: build-container-arm64
117-
stepSpecs:
118-
- name: use-trusted-artifact
119-
computeResources: *ta-resources
12097
- pipelineTaskName: build-source-image
12198
stepSpecs:
12299
- name: use-trusted-artifact

.tekton/collector-component-pipeline.yaml

Lines changed: 36 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ spec:
114114
- name: extra-labels
115115
type: array
116116
description: Additional labels to put on the built containers.
117+
- default:
118+
- linux-c2xlarge/amd64
119+
- linux-c2xlarge/arm64
120+
- linux/ppc64le
121+
- linux/s390x
122+
description: >
123+
List of platforms to build the container images for. The available
124+
set of values is determined by the configuration of the multi-platform-controller
125+
on the cluster: https://konflux.pages.redhat.com/docs/users/getting-started/multi-platform-builds.html
126+
name: build-platforms
127+
type: array
117128
results:
118129
- description: ""
119130
name: IMAGE_URL
@@ -239,148 +250,17 @@ spec:
239250
workspaces:
240251
- name: git-basic-auth
241252
workspace: git-auth
242-
- name: build-container-amd64
243-
params:
244-
- name: IMAGE
245-
value: $(params.output-image-repo):$(tasks.determine-image-tag.results.IMAGE_TAG)-amd64
246-
- name: DOCKERFILE
247-
value: $(params.dockerfile)
248-
- name: CONTEXT
249-
value: $(params.path-context)
250-
- name: HERMETIC
251-
value: $(params.hermetic)
252-
- name: PREFETCH_INPUT
253-
value: $(params.prefetch-input)
254-
- name: IMAGE_EXPIRES_AFTER
255-
value: $(tasks.determine-image-expiration.results.IMAGE_EXPIRES_AFTER)
256-
- name: COMMIT_SHA
257-
value: $(tasks.clone-repository.results.commit)
258-
- name: TARGET_STAGE
259-
value: $(params.build-target-stage)
260-
- name: BUILD_ARGS
261-
value:
262-
- COLLECTOR_TAG=$(tasks.determine-image-tag.results.IMAGE_TAG)
263-
- name: SOURCE_ARTIFACT
264-
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
265-
- name: CACHI2_ARTIFACT
266-
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
267-
- name: BUILDAH_FORMAT
268-
value: $(params.buildah-format)
269-
- name: LABELS
270-
value: ["$(params.extra-labels[*])"]
271-
- name: BUILD_TIMESTAMP
272-
value: "$(tasks.clone-repository.results.commit-timestamp)"
273-
taskRef:
253+
- name: build-images
254+
matrix:
274255
params:
275-
- name: name
276-
value: buildah-oci-ta
277-
- name: bundle
278-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.6@sha256:7b4c101b71e48b267079a5b6331d22de0b25e008c9e1dcaca1c41c4312391e39
279-
- name: kind
280-
value: task
281-
resolver: bundles
282-
when:
283-
- input: $(tasks.init.results.build)
284-
operator: in
285-
values: ["true"]
286-
- name: build-container-s390x
256+
- name: PLATFORM
257+
value:
258+
- $(params.build-platforms)
287259
params:
288260
- name: IMAGE
289-
value: $(params.output-image-repo):$(tasks.determine-image-tag.results.IMAGE_TAG)-s390x
290-
- name: DOCKERFILE
291-
value: $(params.dockerfile)
292-
- name: CONTEXT
293-
value: $(params.path-context)
294-
- name: HERMETIC
295-
value: $(params.hermetic)
296-
- name: PREFETCH_INPUT
297-
value: $(params.prefetch-input)
298-
- name: IMAGE_EXPIRES_AFTER
299-
value: $(tasks.determine-image-expiration.results.IMAGE_EXPIRES_AFTER)
300-
- name: COMMIT_SHA
301-
value: $(tasks.clone-repository.results.commit)
302-
- name: TARGET_STAGE
303-
value: $(params.build-target-stage)
304-
- name: BUILD_ARGS
305-
value:
306-
- COLLECTOR_TAG=$(tasks.determine-image-tag.results.IMAGE_TAG)
307-
- name: SOURCE_ARTIFACT
308-
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
309-
- name: CACHI2_ARTIFACT
310-
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
311-
- name: PLATFORM
312-
value: linux/s390x
313-
- name: BUILDAH_FORMAT
314-
value: $(params.buildah-format)
315-
- name: LABELS
316-
value: ["$(params.extra-labels[*])"]
317-
- name: BUILD_TIMESTAMP
318-
value: "$(tasks.clone-repository.results.commit-timestamp)"
319-
taskRef:
320-
params:
321-
- name: name
322-
value: buildah-remote-oci-ta
323-
- name: bundle
324-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.6@sha256:ac05dabe8b6b446f974cf2b6ef1079cfaa9443d7078c2ebe3ec79aa650e1b5b2
325-
- name: kind
326-
value: task
327-
resolver: bundles
328-
when:
329-
- input: $(tasks.init.results.build)
330-
operator: in
331-
values: ["true"]
332-
timeout: 1h30m0s
333-
- name: build-container-ppc64le
334-
params:
335-
- name: IMAGE
336-
value: $(params.output-image-repo):$(tasks.determine-image-tag.results.IMAGE_TAG)-ppc64le
337-
- name: DOCKERFILE
338-
value: $(params.dockerfile)
339-
- name: CONTEXT
340-
value: $(params.path-context)
341-
- name: HERMETIC
342-
value: $(params.hermetic)
343-
- name: PREFETCH_INPUT
344-
value: $(params.prefetch-input)
345-
- name: IMAGE_EXPIRES_AFTER
346-
value: $(tasks.determine-image-expiration.results.IMAGE_EXPIRES_AFTER)
347-
- name: COMMIT_SHA
348-
value: $(tasks.clone-repository.results.commit)
349-
- name: TARGET_STAGE
350-
value: $(params.build-target-stage)
351-
- name: BUILD_ARGS
352-
value:
353-
- COLLECTOR_TAG=$(tasks.determine-image-tag.results.IMAGE_TAG)
354-
- name: SOURCE_ARTIFACT
355-
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
356-
- name: CACHI2_ARTIFACT
357-
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
358-
- name: PLATFORM
359-
value: linux/ppc64le
360-
- name: BUILDAH_FORMAT
361-
value: $(params.buildah-format)
362-
- name: LABELS
363-
value: ["$(params.extra-labels[*])"]
364-
- name: BUILD_TIMESTAMP
365-
value: "$(tasks.clone-repository.results.commit-timestamp)"
366-
taskRef:
367-
params:
368-
- name: name
369-
value: buildah-remote-oci-ta
370-
- name: bundle
371-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.6@sha256:ac05dabe8b6b446f974cf2b6ef1079cfaa9443d7078c2ebe3ec79aa650e1b5b2
372-
- name: kind
373-
value: task
374-
resolver: bundles
375-
when:
376-
- input: $(tasks.init.results.build)
377-
operator: in
378-
values: ["true"]
379-
timeout: 1h30m0s
380-
- name: build-container-arm64
381-
params:
382-
- name: IMAGE
383-
value: $(params.output-image-repo):$(tasks.determine-image-tag.results.IMAGE_TAG)-arm64
261+
value: $(params.output-image-repo):$(tasks.determine-image-tag.results.IMAGE_TAG)
262+
- name: IMAGE_APPEND_PLATFORM
263+
value: "true"
384264
- name: DOCKERFILE
385265
value: $(params.dockerfile)
386266
- name: CONTEXT
@@ -402,8 +282,6 @@ spec:
402282
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
403283
- name: CACHI2_ARTIFACT
404284
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
405-
- name: PLATFORM
406-
value: linux-c2xlarge/arm64
407285
- name: BUILDAH_FORMAT
408286
value: $(params.buildah-format)
409287
- name: LABELS
@@ -432,14 +310,12 @@ spec:
432310
value: $(tasks.clone-repository.results.commit)
433311
- name: IMAGES
434312
value:
435-
- $(tasks.build-container-amd64.results.IMAGE_REF)
436-
- $(tasks.build-container-s390x.results.IMAGE_REF)
437-
- $(tasks.build-container-ppc64le.results.IMAGE_REF)
438-
- $(tasks.build-container-arm64.results.IMAGE_REF)
313+
- $(tasks.build-images.results.IMAGE_REF[*])
439314
- name: IMAGE_EXPIRES_AFTER
440315
value: $(tasks.determine-image-expiration.results.IMAGE_EXPIRES_AFTER)
441316
- name: BUILDAH_FORMAT
442317
value: $(params.buildah-format)
318+
runAfter: [ build-images ]
443319
taskRef:
444320
params:
445321
- name: name
@@ -521,6 +397,11 @@ spec:
521397
operator: in
522398
values: ["false"]
523399
- name: clair-scan
400+
matrix:
401+
params:
402+
- name: image-platform
403+
value:
404+
- $(params.build-platforms)
524405
params:
525406
- name: image-digest
526407
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
@@ -540,6 +421,11 @@ spec:
540421
operator: in
541422
values: ["false"]
542423
- name: ecosystem-cert-preflight-checks
424+
matrix:
425+
params:
426+
- name: platform
427+
value:
428+
- $(params.build-platforms)
543429
params:
544430
- name: image-url
545431
value: $(tasks.build-image-index.results.IMAGE_URL)
@@ -626,6 +512,11 @@ spec:
626512
operator: in
627513
values: ["false"]
628514
- name: clamav-scan
515+
matrix:
516+
params:
517+
- name: image-arch
518+
value:
519+
- $(params.build-platforms)
629520
params:
630521
- name: image-digest
631522
value: $(tasks.build-image-index.results.IMAGE_DIGEST)

0 commit comments

Comments
 (0)