diff --git a/apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml b/apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml index 3a64cddfb..8ab01304a 100644 --- a/apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml +++ b/apps/prod/tekton/configs/pipelines/pull-pingcap-qe-artifacts-build-image.yaml @@ -3,12 +3,28 @@ kind: Pipeline metadata: name: pull-pingcap-qe-artifacts-build-image spec: - workspaces: - - name: git-source params: - name: git-url + type: string - name: git-revision default: main + # - name: IMAGE + # description: Name (reference) of the image to build. + - name: TAGS + description: image tags to push additionally. + default: "dev" + # - name: DOCKERFILE + # description: Path to the Dockerfile to build. + # default: ./Dockerfile + # - name: CONTEXT + # description: The build context used by Kaniko. + # default: ./ + - name: BUILDER_IMAGE + description: The image on which builds will run. + default: gcr.io/kaniko-project/executor:v1.9.1 + - name: EXTRA_ARGS + type: array + default: [] tasks: - name: fetch-from-git taskRef: @@ -21,14 +37,67 @@ spec: workspaces: - name: output workspace: git-source - - name: hello - taskSpec: - steps: - - name: echo - image: debian:latest - script: | - pwd - df -h - echo hello + - name: build-ci-base-amd64 runAfter: - fetch-from-git + taskRef: + name: kaniko + params: + - name: IMAGE + value: hub.pingcap.net/ee/ci/base + - name: CONTEXT + value: dockerfiles/ci-runtimes/base/ + - name: DOCKERFILE + value: Dockerfile + - name: BUILDER_IMAGE + value: "$(params.BUILDER_IMAGE)" + - name: EXTRA_ARGS + value: ["$(params.EXTRA_ARGS[*])", --build-arg, ARCH=amd64] + workspaces: + - name: source + workspace: git-source + - name: dockerconfig + workspace: dockerconfig + - name: build-ci-base-arm64 + runAfter: + - fetch-from-git + taskRef: + name: kaniko + params: + - name: IMAGE + value: hub.pingcap.net/ee/ci/base + - name: CONTEXT + value: dockerfiles/ci-runtimes/base/ + - name: DOCKERFILE + value: Dockerfile + - name: BUILDER_IMAGE + value: "$(params.BUILDER_IMAGE)" + - name: EXTRA_ARGS + value: ["$(params.EXTRA_ARGS[*])", --build-arg, ARCH=arm64] + workspaces: + - name: source + workspace: git-source + - name: dockerconfig + workspace: dockerconfig + - name: mult-arch-push + runAfter: + - build-ci-base-amd64 + - build-ci-base-arm64 + taskRef: + name: multi-arch-image-push + params: + - name: IMAGE + value: hub.pingcap.net/ee/ci/base + - name: tags + value: "$(params.TAGS)" + - name: platform-and-digest-list + value: + - linux/amd64 => $(tasks.build-ci-base-amd64.results.IMAGE_DIGEST) + - linux/arm64 => $(tasks.build-ci-base-arm64.results.IMAGE_DIGEST) + workspaces: + - name: dockerconfig + workspace: dockerconfig + workspaces: + - name: git-source + - name: dockerconfig # contains file: config.json + optional: true diff --git a/apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml b/apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml index 0a7ca4cb6..f5fb99501 100644 --- a/apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml +++ b/apps/prod/tekton/configs/triggers/templates/pull-pingcap-qe-artifacts.yaml @@ -29,11 +29,26 @@ spec: value: $(tt.params.git-url) - name: git-revision value: $(tt.params.git-revision) + - name: EXTRA_ARGS + value: [--cache=true] + taskRunSpecs: + - pipelineTaskName: build-ci-base-arm64 + taskPodTemplate: + nodeSelector: + kubernetes.io/arch: arm64 + - pipelineTaskName: build-ci-base-amd64 + taskPodTemplate: + nodeSelector: + kubernetes.io/arch: amd64 workspaces: + - name: dockerconfig + secret: + secretName: hub-pingcap-net-ee - name: git-source volumeClaimTemplate: spec: - accessModes: [ReadWriteOnce] + storageClassName: ceph-filesystem + accessModes: [ReadWriteMany] resources: requests: storage: 1Gi