Skip to content

Conversation

dorzel
Copy link
Contributor

@dorzel dorzel commented Feb 26, 2025

Changes

This PR originally aimed to enable simpler multi-arch builds with Matrix by adding PodTemplate to Tasks (originally prompted by #6742). After some discussion, it now aims to do the same thing by adding param substitution on nodeSelector fields in TaskRunSpecs in a PipelineRun.

The current changes do work to accomplish this goal, with an example PipelineRun as below working:

apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  generateName: matrix-podtemplate-taskrunspecs-test-
spec:
  taskRunSpecs:
  - pipelineTaskName: build-and-push-manifest
    podTemplate:
      nodeSelector:
        kubernetes.io/arch: $(params.arch)
  - pipelineTaskName: create-manifest-list
    podTemplate:
      nodeSelector:
        kubernetes.io/arch: amd64
  pipelineSpec:
    tasks:
      - name: build-and-push-manifest
        matrix:
          params:
          - name: arch
            value: ["amd64", "arm64"]
        taskSpec:
          results:
            - name: manifest
              type: string
          params:
            - name: arch
          steps:
            - name: build-and-push
              image: ubuntu
              script: |
                echo "building on $(params.arch)"
                echo "testmanifest-$(params.arch)" | tee $(results.manifest.path)
      - name: create-manifest-list
        params:
          - name: manifest
            value: $(tasks.build-and-push-manifest.results.manifest[*])
        taskSpec:
          steps:
            - name: echo-manifests
              image: ubuntu
              args: ["$(params.manifest[*])"]
              script: echo "$@"

Feedback appreciated, thanks!

Fixes #6742

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

TaskRuns and TaskRunSpecs now support param substitution on podTemplate fields. This allows operability with Matrix.

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 26, 2025
Copy link

linux-foundation-easycla bot commented Feb 26, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@tekton-robot tekton-robot requested a review from abayer February 26, 2025 16:56
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 26, 2025
@afrittoli
Copy link
Member

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 26, 2025
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/pod.go 93.3% 92.9% -0.3
pkg/reconciler/taskrun/resources/apply.go 99.4% 98.7% -0.6

@jeffdyoung
Copy link

@waveywaves
Copy link
Member

/assign

@waveywaves
Copy link
Member

@dorzel thank you for opening the draft PR, not sure if a TEP is required as the issue #6742 mentioned doesn't mention a requirement for one. But I will defer to the rest of the team for views on this.

@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 16, 2025
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/apply.go 99.4% 64.7% -34.7

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/apply.go 99.4% 99.6% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/apply.go 99.4% 99.6% 0.3

@dorzel
Copy link
Contributor Author

dorzel commented Apr 28, 2025

Ok, I pushed up some updates to this for tests as well as param substitution on all podTemplate fields (at least where it made sense. Bool and Int fields I have left out). Not sure if I covered all the needed areas for testing, let me know.

@chmouel @waveywaves Would you be able to take another look at this?

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/apply.go 99.4% 99.6% 0.3

@dorzel dorzel requested a review from waveywaves May 5, 2025 17:18
@dorzel
Copy link
Contributor Author

dorzel commented Jul 23, 2025

e2e tests passed except for an error with my example pipeline where it (assumedly) needed to be in the beta folder. Waiting on retest to confirm that worked

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/apply.go 99.4% 99.2% -0.2
pkg/reconciler/taskrun/taskrun.go 85.9% 86.1% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/apply.go 99.4% 99.2% -0.2
pkg/reconciler/taskrun/taskrun.go 85.9% 86.1% 0.3

@waveywaves
Copy link
Member

/retest

@dorzel
Copy link
Contributor Author

dorzel commented Jul 28, 2025

thanks @waveywaves, that retest didn't seem to work for some reason however

@aThorp96
Copy link
Member

/retest

1 similar comment
@waveywaves
Copy link
Member

/retest

@waveywaves
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 29, 2025
@vdemeester vdemeester modified the milestones: v1.3.0 (LTS), v1.4.0 Jul 29, 2025
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2025
@afrittoli
Copy link
Member

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [afrittoli,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@afrittoli
Copy link
Member

@waveywaves I'll let you lgtm since you requested changes on the PR 🙏

@vdemeester
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2025
@tekton-robot tekton-robot merged commit a2198ad into tektoncd:main Jul 30, 2025
29 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tekton Community Roadmap Jul 30, 2025
@dorzel dorzel deleted the multiarch branch July 30, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Pipeline: Support set pod template for tasks