From 801407e3959182ebdc11490666b09657eefa301f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Fri, 11 Apr 2025 15:48:57 +0200 Subject: [PATCH] add example --- examples/bootc/src/Containerfile | 4 ++ examples/bootc/tekton/pipeline.yaml | 87 ++++++++++++++++++++++++++ examples/bootc/tekton/pipelinerun.yaml | 51 +++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 examples/bootc/src/Containerfile create mode 100644 examples/bootc/tekton/pipeline.yaml create mode 100644 examples/bootc/tekton/pipelinerun.yaml diff --git a/examples/bootc/src/Containerfile b/examples/bootc/src/Containerfile new file mode 100644 index 0000000..a855da2 --- /dev/null +++ b/examples/bootc/src/Containerfile @@ -0,0 +1,4 @@ +FROM quay.io/fedora/fedora-bootc:41 + +RUN dnf install -y htop \ + && dnf clean all diff --git a/examples/bootc/tekton/pipeline.yaml b/examples/bootc/tekton/pipeline.yaml new file mode 100644 index 0000000..995ce87 --- /dev/null +++ b/examples/bootc/tekton/pipeline.yaml @@ -0,0 +1,87 @@ +apiVersion: tekton.dev/v1beta1 +kind: Pipeline +metadata: + name: bootc +spec: + + workspaces: + - name: source-workspace + - name: oci-images + - name: registry-token + + params: + - name: git-url + type: string + - name: git-revision + type: string + default: main + - name: image-name + type: string + - name: context-dir + type: string + default: "." + - name: containerfile-path + type: string + default: "Containerfile" + + tasks: + + - name: clone-repo + taskRef: + kind: Task + name: git-clone + params: + - name: url + value: $(params.git-url) + - name: revision + value: $(params.git-revision) + workspaces: + - name: output + workspace: source-workspace + + - name: build-x86-64 + runAfter: ["clone-repo"] + taskRef: + name: buildah-build + params: + - name: context-dir + value: $(params.context-dir) + - name: containerfile-path + value: $(params.containerfile-path) + workspaces: + - name: source-workspace + workspace: source-workspace + - name: oci-images + workspace: oci-images + + - name: build-aarch64 + runAfter: ["clone-repo"] + taskRef: + name: buildah-build + params: + - name: context-dir + value: $(params.context-dir) + - name: containerfile-path + value: $(params.containerfile-path) + workspaces: + - name: source-workspace + workspace: source-workspace + - name: oci-images + workspace: oci-images + + - name: push-image + runAfter: ["build-x86-64", "build-aarch64"] + taskRef: + name: buildah-push + params: + - name: image-name + value: $(params.image-name) + - name: architectures + value: + - x86_64 + - aarch64 + workspaces: + - name: oci-images + workspace: oci-images + - name: dockerconfig + workspace: registry-token diff --git a/examples/bootc/tekton/pipelinerun.yaml b/examples/bootc/tekton/pipelinerun.yaml new file mode 100644 index 0000000..9252577 --- /dev/null +++ b/examples/bootc/tekton/pipelinerun.yaml @@ -0,0 +1,51 @@ +apiVersion: tekton.dev/v1 +kind: PipelineRun +metadata: + generateName: bootc- +spec: + pipelineRef: + name: bootc + params: + - name: git-url + value: https://github.com/nmasse-itix/tekton-pipeline-multiarch.git + - name: git-revision + value: devoxx-france-2025 + - name: image-name + value: quay.io/nmasse-redhat/fedora-with-htop + - name: context-dir + value: examples/bootc/src + - name: containerfile-path + value: "examples/bootc/src/Containerfile" + workspaces: + - name: oci-images + volumeClaimTemplate: + spec: + storageClassName: efs-csi + accessModes: + - ReadWriteMany + resources: + requests: + storage: 10Gi + - name: source-workspace + volumeClaimTemplate: + spec: + storageClassName: efs-csi + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi + - name: registry-token + secret: + secretName: quay-authentication + taskRunTemplate: + serviceAccountName: buildbot + taskRunSpecs: + - pipelineTaskName: build-aarch64 + podTemplate: + nodeSelector: + beta.kubernetes.io/arch: arm64 + tolerations: + - key: "emea-open-demo.redhat.com/arm64-architecture" + operator: "Exists" + effect: "NoSchedule"