Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEP-0090: Add TaskRuns to ResolvedPipelineRunTask and implement isFailure #4951

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

jerop
Copy link
Member

@jerop jerop commented Jun 9, 2022

Changes

TEP-0090: Matrix proposed executing a PipelineTask in parallel TaskRuns and Runs with substitutions from combinations of Parameters in a Matrix.

In this change, we add TaskRuns field to ResolvedPipelineRunTask alongside the TaskRun field.

  • When a PipelineTask does not have a Matrix, the TaskRun field is populated (as is already being done, no change here).
  • When a PipelineTask has a Matrix, TaskRuns will be populated to track all TaskRuns from a given matrixed ResolvedPipelineRunTask.

When we promote Matrix to Beta, we could remove TaskRun field and migrate to using TaskRuns field only where it would have one TaskRun only when the PipelineTask does not have a Matrix. However, the current separation is helpful to isolate the Matrix feature in alpha.

In this change, we also implement the isFailure and other member functions of ResolvedPipelineRunTask that isFailure uses: isCancelled and hasRemainingRetries. The failure strategy in Matrix is to fail fast. We can explore other failure strategies, if needed, before promoting to Beta.

/kind feature

Submitter Checklist

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

  • [n/a] Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Release notes block below has been filled in (if there are no user facing changes, use release note "NONE")

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 9, 2022
@tekton-robot tekton-robot requested review from dibyom and vdemeester June 9, 2022 12:29
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 9, 2022
@jerop jerop force-pushed the tep-0090-arrays branch from f8ae371 to 3a9b3fa Compare June 9, 2022 12:40
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 93.7% 93.8% 0.2

@jerop jerop force-pushed the tep-0090-arrays branch 2 times, most recently from 7cc1907 to 2c55235 Compare June 9, 2022 12:44
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 93.7% 93.8% 0.2

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 93.7% 93.8% 0.2

@jerop jerop force-pushed the tep-0090-arrays branch from 2c55235 to 9895b4e Compare June 9, 2022 12:47
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 93.7% 93.8% 0.2

[TEP-0090: Matrix][tep-0090] proposed executing a `PipelineTask` in
parallel `TaskRuns` and `Runs` with substitutions from combinations
of `Parameters` in a `Matrix`.

In this change, we add `TaskRuns` field to `ResolvedPipelineRunTask`
alongside the `TaskRun` field.
- When a `PipelineTask` does not have a `Matrix`, the `TaskRun` field
is populated (as is already being done, no change here).
- When a `PipelineTask` has a `Matrix`, `TaskRuns` will be populated
to track all `TaskRuns` from a given matrixed `ResolvedPipelineRunTask`.

When we promote `Matrix` to Beta, we could remove `TaskRun` field and
migrate to using `TaskRuns` field only where it would have one `TaskRun`
only when the `PipelineTask` does not have a `Matrix`. However, the
current separation is helpful to isolate the Matrix feature in  alpha.

In this change, we also implement the `isFailure` and other member
functions of `ResolvedPipelineRunTask` that `isFailure` uses:
`isCancelled` and `hasRemainingRetries`. The failure strategy
in `Matrix` is to fail fast. We can explore other failure strategies,
if needed, before promoting to Beta.

[tep-0090]: https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md
@jerop jerop force-pushed the tep-0090-arrays branch from 9895b4e to c33604a Compare June 9, 2022 15:56
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 93.7% 93.8% 0.1

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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:

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2022
@jerop
Copy link
Member Author

jerop commented Jun 9, 2022

/hold

need to update the TEP-0090: Matrix with fail-fast failure strategy - tektoncd/community#724

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2022
@jerop jerop mentioned this pull request Jun 9, 2022
4 tasks
@abayer
Copy link
Contributor

abayer commented Jun 10, 2022

/lgtm

I don’t love this - it’s fine for just supporting matrixed TaskRuns, but it feels like it’ll get messy when we add support for matrixed custom tasks (and eventually, matrixed PipelineRuns). But given that matrixed custom tasks aren’t in scope for this PR, and matrixed PipelineRuns aren’t coming in the near future, this will do.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2022
@jerop
Copy link
Member Author

jerop commented Jun 10, 2022

opened tektoncd/community#724 to discuss the failure strategies, will unhold this PR so that we can make progress - matrix is not yet fully functional so we can update this if we land on a different approach other than fail-fast

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 10, 2022
@jerop
Copy link
Member Author

jerop commented Jun 10, 2022

/test tekton-pipeline-unit-tests

@tekton-robot tekton-robot merged commit 71a291f into tektoncd:main Jun 10, 2022
@lbernick
Copy link
Member

It doesn't look like my comments about the function docstrings were resolved?

@pritidesai
Copy link
Member

/lgtm

I don’t love this - it’s fine for just supporting matrixed TaskRuns, but it feels like it’ll get messy when we add support for matrixed custom tasks (and eventually, matrixed PipelineRuns). But given that matrixed custom tasks aren’t in scope for this PR, and matrixed PipelineRuns aren’t coming in the near future, this will do.

thank you @abayer 👍

Runs are coming in the next milestone - https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md#milestone-2-execute-runs

I haven't gotten chance to review this PR but please feel free to suggest better approach, best to follow @vdemeester's reference quote - No is temporary, yes is permanent.

@jerop
Copy link
Member Author

jerop commented Jun 10, 2022

It doesn't look like my comments about the function docstrings were resolved?

@lbernick my bad, forgot to push that update to docstrings, here you go: #4970

@jerop jerop deleted the tep-0090-arrays branch June 11, 2022 01:40
jerop added a commit to jerop/pipeline that referenced this pull request Jun 13, 2022
In tektoncd#4951, we implemented
`isFailure` for matrixed `TaskRuns` where we applied fail-fast
failure strategy. We discussed failure strategies further in this
PR - tektoncd/community#724 - and API WG
on 13 June 2022. We agreed to leave early termination upon failure
out of scope for the initial release of Matrix. We plan to explore
failure strategies, including fail-fast, in future work. And these
failure strategies may apply more broadly beyond Matrix.

In this change, we update `isFailure` to evaluate to `true` only when
there's a failure and there are no running `TaskRuns` in the `rprt`.
jerop added a commit to jerop/pipeline that referenced this pull request Jun 13, 2022
In tektoncd#4951, we implemented
`isFailure` for matrixed `TaskRuns` where we applied fail-fast
failure strategy. We discussed failure strategies further in this
PR - tektoncd/community#724 - and API WG
on 13 June 2022. We agreed to leave early termination upon failure
out of scope for the initial release of Matrix. We plan to explore
failure strategies, including fail-fast, in future work. And these
failure strategies may apply more broadly beyond Matrix.

In this change, we update `isFailure` to evaluate to `true` only when
there's a failure and there are no running `TaskRuns` in the `rprt`.
jerop added a commit to jerop/pipeline that referenced this pull request Jun 14, 2022
In tektoncd#4951, we implemented
`isFailure` for matrixed `TaskRuns` where we applied fail-fast
failure strategy. We discussed failure strategies further in this
PR - tektoncd/community#724 - and API WG
on 13 June 2022. We agreed to leave early termination upon failure
out of scope for the initial release of Matrix. We plan to explore
failure strategies, including fail-fast, in future work. And these
failure strategies may apply more broadly beyond Matrix.

In this change, we update `isFailure` to evaluate to `true` only when
there's a failure and there are no running `TaskRuns` in the `rprt`.
tekton-robot pushed a commit that referenced this pull request Jun 14, 2022
In #4951, we implemented
`isFailure` for matrixed `TaskRuns` where we applied fail-fast
failure strategy. We discussed failure strategies further in this
PR - tektoncd/community#724 - and API WG
on 13 June 2022. We agreed to leave early termination upon failure
out of scope for the initial release of Matrix. We plan to explore
failure strategies, including fail-fast, in future work. And these
failure strategies may apply more broadly beyond Matrix.

In this change, we update `isFailure` to evaluate to `true` only when
there's a failure and there are no running `TaskRuns` in the `rprt`.
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. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants