From b8cc731a8afef266f33a19d4b6f7494273dcf35b Mon Sep 17 00:00:00 2001 From: Gal Ben Haim Date: Mon, 27 Jul 2026 14:54:37 +0300 Subject: [PATCH] Onboard tekton-kueue to kargo-infra-deployments project Add Kargo promotion pipeline for tekton-kueue (ring-0) watching quay.io/openshift-pipeline/pipelines-scheduler-rhel9 for new SHA-tagged builds and promoting to infra-deployments via kustomize image + git resource ref updates. Assisted-by: Cursor Signed-off-by: Gal Ben Haim Co-authored-by: Cursor Signed-off-by: Gal Ben Haim Co-authored-by: Cursor Signed-off-by: Gal Ben Haim Co-authored-by: Cursor --- .../kustomization.yaml | 1 + .../tekton-kueue/kustomization.yaml | 7 ++ .../promotiontasks/kustomization.yaml | 5 + .../tekton-kueue-promote-ring-0.yaml | 47 ++++++++ .../stage-ring-0-tekton-kueue.yaml | 112 ++++++++++++++++++ .../tekton-kueue/warehouse.yaml | 14 +++ .../kargo-konflux-infra/promotiontasks.yaml | 67 +++++++++++ .../projects/kargo-konflux-infra/stages.yaml | 27 +++++ .../kargo-konflux-infra/warehouse.yaml | 12 ++ 9 files changed, 292 insertions(+) create mode 100644 components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/kustomization.yaml create mode 100644 components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/kustomization.yaml create mode 100644 components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/tekton-kueue-promote-ring-0.yaml create mode 100644 components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/stage-ring-0-tekton-kueue.yaml create mode 100644 components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/warehouse.yaml create mode 100644 components/kargo/internal-staging/projects/kargo-konflux-infra/promotiontasks.yaml create mode 100644 components/kargo/internal-staging/projects/kargo-konflux-infra/stages.yaml create mode 100644 components/kargo/internal-staging/projects/kargo-konflux-infra/warehouse.yaml diff --git a/components/kargo/internal-production/projects/kargo-infra-deployments/kustomization.yaml b/components/kargo/internal-production/projects/kargo-infra-deployments/kustomization.yaml index ea71b03c..952d0ea8 100644 --- a/components/kargo/internal-production/projects/kargo-infra-deployments/kustomization.yaml +++ b/components/kargo/internal-production/projects/kargo-infra-deployments/kustomization.yaml @@ -8,6 +8,7 @@ resources: - base - dummy-deployment - konflux-operator + - tekton-kueue - authentication commonAnnotations: diff --git a/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/kustomization.yaml b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/kustomization.yaml new file mode 100644 index 00000000..271a65ef --- /dev/null +++ b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - warehouse.yaml + - promotiontasks + - stage-ring-0-tekton-kueue.yaml diff --git a/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/kustomization.yaml b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/kustomization.yaml new file mode 100644 index 00000000..23c7521e --- /dev/null +++ b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/kustomization.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - tekton-kueue-promote-ring-0.yaml diff --git a/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/tekton-kueue-promote-ring-0.yaml b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/tekton-kueue-promote-ring-0.yaml new file mode 100644 index 00000000..78a68438 --- /dev/null +++ b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/promotiontasks/tekton-kueue-promote-ring-0.yaml @@ -0,0 +1,47 @@ +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: PromotionTask +metadata: + name: tekton-kueue-promote-ring-0 +spec: + vars: + - name: srcPath + steps: + - uses: http + as: fetch-index + if: ${{ ctx.targetFreight.origin.name == "tekton-kueue" }} + config: + method: GET + url: https://quay.io/v2/openshift-pipeline/pipelines-scheduler-rhel10/manifests/${{ imageFrom("quay.io/openshift-pipeline/pipelines-scheduler-rhel10").Digest }} + headers: + - name: Accept + value: application/vnd.oci.image.index.v1+json + successExpression: response.status == 200 + outputs: + - name: amd64Digest + fromExpression: filter(response.body.manifests, {.platform.architecture == 'amd64' && .platform.os == 'linux'})[0].digest + timeout: 30s + - uses: http + as: fetch-manifest + if: ${{ ctx.targetFreight.origin.name == "tekton-kueue" }} + config: + method: GET + url: https://quay.io/v2/openshift-pipeline/pipelines-scheduler-rhel10/manifests/${{ outputs['fetch-index'].amd64Digest }} + headers: + - name: Accept + value: application/vnd.oci.image.manifest.v1+json + successExpression: response.status == 200 + outputs: + - name: revision + fromExpression: response.body.annotations["org.opencontainers.image.revision"] + timeout: 30s + - uses: yaml-update + as: update-tekton-kueue + if: ${{ ctx.targetFreight.origin.name == "tekton-kueue" }} + config: + path: ${{ vars.srcPath }}/components/kueue/rings/ring-0/tekton-kueue/kustomization.yaml + updates: + - key: images.0.digest + value: ${{ imageFrom("quay.io/openshift-pipeline/pipelines-scheduler-rhel10").Digest }} + - key: resources.0 + value: https://github.com/openshift-pipelines/tekton-kueue/upstream/config/default?ref=${{ outputs['fetch-manifest'].revision }} diff --git a/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/stage-ring-0-tekton-kueue.yaml b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/stage-ring-0-tekton-kueue.yaml new file mode 100644 index 00000000..1b665d8e --- /dev/null +++ b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/stage-ring-0-tekton-kueue.yaml @@ -0,0 +1,112 @@ +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: Stage +metadata: + name: ring-0-tekton-kueue + annotations: + kargo.akuity.io/color: green +spec: + requestedFreight: + - origin: + kind: Warehouse + name: tekton-kueue + sources: + direct: true + promotionTemplate: + spec: + vars: + - name: repoURL + value: https://github.com/redhat-appstudio/infra-deployments.git + - name: component + value: ${{ ctx.targetFreight.origin.name }} + steps: + - uses: git-clone + as: clone + config: + repoURL: ${{ vars.repoURL }} + checkout: + - branch: main + path: ./src + - task: + name: tekton-kueue-promote-ring-0 + as: tekton-kueue-promote + vars: + - name: srcPath + value: ./src + - uses: git-commit + as: commit + config: + path: ./src + message: | + chore(${{ ctx.stage }}): promote ${{ vars.component }} + - uses: git-push + as: push + config: + path: ./src + targetBranch: ${{ ctx.project }}/${{ vars.component }}/ring-0 + force: true + - uses: git-open-pr + as: open-pr + continueOnError: true + config: + repoURL: ${{ vars.repoURL }} + sourceBranch: ${{ ctx.project }}/${{ vars.component }}/ring-0 + targetBranch: main + title: "chore(${{ ctx.stage }}): promote ${{ vars.component }}" + description: | + ### ${{ ctx.stage }} + + | | | + |---|---| + | **Component** | `${{ vars.component }}` | + | **Project** | `${{ ctx.project }}` | + | **Promotion** | `${{ ctx.promotion }}` | + | **Freight** | `${{ ctx.targetFreight.alias }}` | + + --- + + ${{ (outputs[vars.component + '-promote.pr-meta']?.details) ?? ('Promotes `' + vars.component + '` to **' + ctx.stage + '**.') }} + + --- + + Auto-merged after CI passes. No manual approval required for Ring 0. + + > Branch is force-pushed each promotion cycle. Do not commit directly. + labels: + - ring-0 + - automated-promotion + - component/${{ vars.component }} + - task: + name: wait-for-ci + as: wait-for-ci + vars: + - name: commitSHA + value: ${{ outputs['push'].commit }} + - uses: http + as: find-pr + retry: + timeout: 5m0s + errorThreshold: 10 + config: + method: GET + url: https://api.github.com/repos/redhat-appstudio/infra-deployments/pulls?head=redhat-appstudio:${{ ctx.project }}/${{ vars.component }}/ring-0&state=open + headers: + - name: Authorization + value: Bearer ${{ secret('kargo-infra-deployments-secrets').github_pat }} + - name: Accept + value: application/vnd.github+json + outputs: + - name: prNumber + fromExpression: response.body[0].number + successExpression: response.status == 200 && len(response.body) > 0 + timeout: 30s + - uses: git-merge-pr + as: merge-pr + retry: + timeout: 2h0m0s + errorThreshold: 240 + config: + repoURL: ${{ vars.repoURL }} + prNumber: ${{ outputs['find-pr'].prNumber }} + mergeMethod: squash + wait: true diff --git a/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/warehouse.yaml b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/warehouse.yaml new file mode 100644 index 00000000..a3f0d0ad --- /dev/null +++ b/components/kargo/internal-production/projects/kargo-infra-deployments/tekton-kueue/warehouse.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: Warehouse +metadata: + name: tekton-kueue +spec: + freightCreationPolicy: Automatic + interval: 2h0m0s + subscriptions: + - image: + repoURL: quay.io/openshift-pipeline/pipelines-scheduler-rhel10 + imageSelectionStrategy: NewestBuild + discoveryLimit: 5 + allowTags: nightly diff --git a/components/kargo/internal-staging/projects/kargo-konflux-infra/promotiontasks.yaml b/components/kargo/internal-staging/projects/kargo-konflux-infra/promotiontasks.yaml new file mode 100644 index 00000000..59970210 --- /dev/null +++ b/components/kargo/internal-staging/projects/kargo-konflux-infra/promotiontasks.yaml @@ -0,0 +1,67 @@ +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: PromotionTask +metadata: + name: promote-component-with-copy +spec: + vars: + - name: repoURL + value: https://github.com/redhat-appstudio/infra-deployments + - name: branch + value: main + - name: srcKustomization + - name: destKustomization + - name: commitMessage + + steps: + # Clone the Git repository that contains the Kustomize configuration + # to the ./src directory, and the environment configuration to ./out. + - uses: git-clone + as: git-clone + config: + repoURL: ${{ vars.repoURL }} + checkout: + - commit: ${{ commitFrom(vars.repoURL, warehouse(ctx.targetFreight.origin.name)).ID }} + path: ./src + as: src + - branch: ${{ vars.branch }} + path: ./main + as: main + + - uses: delete + config: + path: ./main/${{ vars.destKustomization }} + + - uses: copy + as: update-component + config: + inPath: ./src/${{ vars.srcKustomization }} + outPath: ./main/${{ vars.destKustomization }} + + # Commit the changes to the Git repository. + - uses: git-commit + as: commit + config: + path: ./main + message: ${{ vars.commitMessage }} + + # Push the changes to the Git repository. + - uses: git-push + as: push + config: + path: ./main + generateTargetBranch: true + + - uses: git-open-pr + as: open-pr + config: + repoURL: ${{ vars.repoURL }} + createTargetBranch: true + sourceBranch: ${{ task.outputs.push.branch }} + targetBranch: main + + - uses: git-wait-for-pr + as: wait-for-pr + config: + repoURL: ${{ vars.repoURL }} + prNumber: ${{ task.outputs['open-pr'].pr.id }} diff --git a/components/kargo/internal-staging/projects/kargo-konflux-infra/stages.yaml b/components/kargo/internal-staging/projects/kargo-konflux-infra/stages.yaml new file mode 100644 index 00000000..5791d1b6 --- /dev/null +++ b/components/kargo/internal-staging/projects/kargo-konflux-infra/stages.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: Stage +metadata: + name: staging-promote + annotations: + kargo.akuity.io/color: yellow +spec: + requestedFreight: + - origin: + kind: Warehouse + name: development-tekton-kueue + sources: + direct: true + promotionTemplate: + spec: + steps: + # promote tekton-kueue to staging + - task: + name: promote-component-with-copy + vars: + - name: srcKustomization + value: components/kueue/development/tekton-kueue + - name: destKustomization + value: components/kueue/staging/base/tekton-kueue + - name: commitMessage + value: "Promote tekton-kueue to staging" diff --git a/components/kargo/internal-staging/projects/kargo-konflux-infra/warehouse.yaml b/components/kargo/internal-staging/projects/kargo-konflux-infra/warehouse.yaml new file mode 100644 index 00000000..4d020328 --- /dev/null +++ b/components/kargo/internal-staging/projects/kargo-konflux-infra/warehouse.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: Warehouse +metadata: + name: development-tekton-kueue +spec: + subscriptions: + - git: + repoURL: https://github.com/redhat-appstudio/infra-deployments + branch: main + includePaths: + - components/kueue/development/tekton-kueue