From 2a139e3ad6db1a111a92d9712833d878c241b11f Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Tue, 2 May 2023 18:59:37 +0800 Subject: [PATCH] feat(apps/staging/tekton): try to implement mutli arch image building (#510) Signed-off-by: wuhuizuo --- .../configs/pipelines/kaniko-build.yaml | 29 ++++++++++++++++--- .../staging/tekton/setup/operator-config.yaml | 4 +-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/apps/staging/tekton/configs/pipelines/kaniko-build.yaml b/apps/staging/tekton/configs/pipelines/kaniko-build.yaml index f10ebd973..c342d16f5 100644 --- a/apps/staging/tekton/configs/pipelines/kaniko-build.yaml +++ b/apps/staging/tekton/configs/pipelines/kaniko-build.yaml @@ -52,7 +52,28 @@ spec: - name: BUILDER_IMAGE value: "$(params.BUILDER_IMAGE)" - name: EXTRA_ARGS - value: ["$(params.EXTRA_ARGS[*])"] + value: ["$(params.EXTRA_ARGS[*])", --build-arg, ARCH=amd64] + workspaces: + - name: source + workspace: git-source + - name: dockerconfig + workspace: dockerconfig + - name: build-arm64 + runAfter: + - fetch-from-git + taskRef: + name: kaniko + params: + - name: IMAGE + value: "$(params.IMAGE)" + - name: DOCKERFILE + value: "$(params.DOCKERFILE)" + - name: CONTEXT + value: "$(params.CONTEXT)" + - name: BUILDER_IMAGE + value: "$(params.BUILDER_IMAGE)" + - name: EXTRA_ARGS + value: ["$(params.EXTRA_ARGS[*])", --build-arg, ARCH=arm64] workspaces: - name: source workspace: git-source @@ -61,7 +82,7 @@ spec: - name: mult-arch-push runAfter: - "build-amd64" - # - "build-arm64" + - "build-arm64" taskRef: name: multi-arch-image-push params: @@ -71,8 +92,8 @@ spec: value: "$(params.TAGS)" - name: platform-and-digest-list value: - - "linux/amd64 => $(tasks.build-amd64.results.IMAGE_DIGEST)" - # - "linux/arm64 => $(tasks.build-arm64.results.IMAGE_DIGEST)" + - linux/amd64 => $(tasks.build-amd64.results.IMAGE_DIGEST) + - linux/arm64 => $(tasks.build-arm64.results.IMAGE_DIGEST) workspaces: - name: dockerconfig workspace: dockerconfig diff --git a/apps/staging/tekton/setup/operator-config.yaml b/apps/staging/tekton/setup/operator-config.yaml index 0979f8f6f..4b803a3a0 100644 --- a/apps/staging/tekton/setup/operator-config.yaml +++ b/apps/staging/tekton/setup/operator-config.yaml @@ -9,7 +9,7 @@ spec: nodeSelector: {} tolerations: [] pipeline: - disable-affinity-assistant: false + disable-affinity-assistant: true disable-creds-init: false # disable-home-env-overwrite: true # disable-working-directory-overwrite: true @@ -38,7 +38,7 @@ spec: resources: - taskrun - pipelinerun - keep: 10 + keep: 100 schedule: "0 * * * *" # hourly hub: params: