|
2 | 2 | status: implementable |
3 | 3 | title: Matrix |
4 | 4 | creation-date: '2021-10-13' |
5 | | -last-updated: '2022-02-14' |
| 5 | +last-updated: '2022-06-09' |
6 | 6 | authors: |
7 | 7 | - '@jerop' |
8 | 8 | - '@pritidesai' |
@@ -42,6 +42,7 @@ see-also: |
42 | 42 | - [Alternatives](#alternatives) |
43 | 43 | - [Fan Out](#fan-out) |
44 | 44 | - [Concurrency Control](#concurrency-control) |
| 45 | + - [Failure Strategies](#failure-strategies) |
45 | 46 | - [Design](#design) |
46 | 47 | - [Parameters](#parameters) |
47 | 48 | - [Substituting String Parameters in the Tasks](#substituting-string-parameters-in-the-tasks) |
@@ -206,18 +207,16 @@ specified in a `matrix`. |
206 | 207 |
|
207 | 208 | The following are out of scope for this TEP: |
208 | 209 |
|
209 | | -1. Terminating early when one of the `TaskRuns` or `Runs` created in parallel fails. As is currently, running `TaskRuns` |
210 | | -and `Runs` have to complete execution before termination. |
211 | | -2. Controlling the concurrency of `TaskRuns` or `Runs` created in a given `matrix`. This will be addressed more broadly |
| 210 | +1. Controlling the concurrency of `TaskRuns` or `Runs` created in a given `matrix`. This will be addressed more broadly |
212 | 211 | in Tekton Pipelines ([tektoncd/pipeline: issue#2591][issue-2591], [tektoncd/experimental: issue#804][issue-804]). |
213 | | -3. Configuring the `TaskRuns` or `Runs` created in a given `matrix` to execute sequentially. This remains an option that |
| 212 | +2. Configuring the `TaskRuns` or `Runs` created in a given `matrix` to execute sequentially. This remains an option that |
214 | 213 | we can explore later. |
215 | | -4. Excluding generating a `TaskRun` or `Run` for a specific combination in the `matrix`. This can be handled using |
| 214 | +3. Excluding generating a `TaskRun` or `Run` for a specific combination in the `matrix`. This can be handled using |
216 | 215 | guarded execution through `when` expressions. This remains an option we can explore later if needed. |
217 | | -5. Including generating a `TaskRun` or `Run` for a specific combination in the `matrix`. This can be handled by adding |
| 216 | +4. Including generating a `TaskRun` or `Run` for a specific combination in the `matrix`. This can be handled by adding |
218 | 217 | the items that produce that combination into the `matrix`, and using guarded execution through `when` expressions to |
219 | 218 | exclude the combinations that should be skipped. This remains an option we can explore later if needed. |
220 | | -6. Supporting producing `Results` from fanned out `PipelineTasks`. We plan to address this after [TEP-0075][tep-0075] |
| 219 | +5. Supporting producing `Results` from fanned out `PipelineTasks`. We plan to address this after [TEP-0075][tep-0075] |
221 | 220 | and [TEP-0076][tep-0076] have landed. |
222 | 221 |
|
223 | 222 | ### Requirements |
@@ -721,6 +720,18 @@ If needed, we can also explore providing more granular controls for maximum numb |
721 | 720 | or `Runs` from `Matrices` - either at `PipelineRun`, `Pipeline` or `PipelineTask` levels - later. |
722 | 721 | This is an option we can pursue after gathering user feedback - it's out of scope for this TEP. |
723 | 722 |
|
| 723 | +### Failure Strategies |
| 724 | + |
| 725 | +In failure scenarios, the `TaskRuns` or `Runs` created from a `Matrix` will fail fast. That is, when |
| 726 | +any `TaskRun` or `Run` from a given fanned-out `PipelineTask` fails or is cancelled then the other |
| 727 | +`TaskRuns` or `Runs` from the same `PipelineTask` will be cancelled. |
| 728 | + |
| 729 | +This approach makes it easier to control the execution of the many `TaskRuns` or `Runs` that can be |
| 730 | +created from a `Matrix` (up to 256 for now). Moreover, failing fast is the default behavior of `Matrix` |
| 731 | +in other Continuous Delivery systems - see [GitHub Actions - Handling Failures in Matrix][ghm-failfast]. |
| 732 | + |
| 733 | +If needed, we can explore supporting other failure strategies later. |
| 734 | + |
724 | 735 | ## Design |
725 | 736 |
|
726 | 737 | In this section, we go into the details of the `Matrix` in relation to: |
@@ -1650,4 +1661,5 @@ However, this approach has the following disadvantages: |
1650 | 1661 | [git-clone]: https://github.com/tektoncd/catalog/tree/main/task/git-clone/0.5 |
1651 | 1662 | [when]: https://github.com/tektoncd/pipeline/blob/6cb0f4ccfce095495ca2f0aa20e5db8a791a1afe/docs/pipelines.md#guard-task-execution-using-when-expressions |
1652 | 1663 | [retries]: https://github.com/tektoncd/pipeline/blob/6cb0f4ccfce095495ca2f0aa20e5db8a791a1afe/docs/pipelines.md#using-the-retries-parameter |
1653 | | -[timeouts]: https://github.com/tektoncd/pipeline/blob/6cb0f4ccfce095495ca2f0aa20e5db8a791a1afe/docs/pipelines.md#configuring-the-failure-timeout |
| 1664 | +[timeouts]: https://github.com/tektoncd/pipeline/blob/6cb0f4ccfce095495ca2f0aa20e5db8a791a1afe/docs/pipelines.md#configuring-the-failure-timeout |
| 1665 | +[ghm-failfast]: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#handling-failures |
0 commit comments