Skip to content

Commit

Permalink
chore(docs): Move loop to custom feature since it's not Tekton native (
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomcli authored Oct 28, 2022
1 parent de32d58 commit 93f726f
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions sdk/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ and test pipelines found in the KFP repository.
- [Affinity, Node Selector, and Tolerations](#affinity-node-selector-and-tolerations)
- [ImagePullSecrets](#imagepullsecrets)
- [Exit Handler](#exit-handler)
- [Pipeline Loops](#pipeline-loops)
- [Any Sequencer](#any-sequencer)
- [Tekton Pipeline Variables](#tekton-pipeline-variables)
- [Sidecars](#sidecars)
Expand All @@ -31,6 +30,7 @@ and test pipelines found in the KFP repository.
- [Input Artifacts](#input-artifacts)
- [Output Artifacts](#output-artifacts)
- [Caching](#caching)
- [Pipeline Loops](#pipeline-loops)
- [Enforce Artifact Tracking](#enforce-artifact-tracking)
- [Features with Limitations](#features-with-limitations)
- [Variable Substitutions](#variable-substitutions)
Expand Down Expand Up @@ -128,25 +128,6 @@ the [exit_handler](/sdk/python/tests/compiler/testdata/exit_handler.py) compiler

The `finally` syntax is supported since Tekton version `0.14.0`.

### Pipeline Loops

PipelineLoops is a feature for running a component or a set of component tasks multiple times in a loop. Right now, Tekton supports loop pipeline/tasks via an implementation of [Tekton Custom Tasks Controller](https://github.com/tektoncd/community/blob/master/teps/0002-custom-tasks.md) named as "PipelineLoop". Please refer to the examples [here](/tekton-catalog/pipeline-loops/examples) to understand more details about the usage of loops.

By default, the SDK will not compile all the recursion loop resources in the pipelineRun annotations. If you want to apply the recursion loop resources together with pipelinerun as an admin, add the following code snippet before compiling the pipeline.
```python
import kfp_tekton
kfp_tekton.compiler.LOOP_RESOURCES_IN_SEPARATE_YAML=False
```

To use this feature, please ensure Tekton version >= v0.19, and "data.enable-custom-tasks" is "true" in feature-flags configmap:
`kubectl edit cm feature-flags -n tekton-pipelines`

To see how the Python SDK provides this feature, refer to the examples below:
- [loop_static](/sdk/python/tests/compiler/testdata/loop_static.py)
- [withparam_global](/sdk/python/tests/compiler/testdata/withparam_global.py)
- [withitem_nested](/sdk/python/tests/compiler/testdata/withitem_nested.py)
- [parallelfor_item_argument_resolving](/sdk/python/tests/compiler/testdata/parallelfor_item_argument_resolving.py)

### Any Sequencer

When any one of the task dependencies completes successfully and the conditions meet, the dependent task will be started. Order of execution of the dependencies doesn’t matter, and the pipeline doesn't wait for all the task dependencies to complete before moving to the next step. Condition can be applied to enforce the task dependencies completes as expected. The condition expression should be the same format as is in Kubeflow ConditionOperator, and the result of containerOps can be used in expression. Notice the expression should only contain results from only one task because the purpose here is to check the simple condition for the task's output when a task complete. And also the operand in the expression should be int or string, other python types will be transferred to string automatically.
Expand Down Expand Up @@ -257,6 +238,25 @@ By default compiling a pipeline will add metadata annotations and labels so that

The specific annotations and labels that are added to the task spec metadata to enable caching are: `annotations={'tekton.dev/template': ""}` and `labels={'pipelines.kubeflow.org/cache_enabled': 'true', 'pipelines.kubeflow.org/pipelinename': '', 'pipelines.kubeflow.org/generation': ''}`.

### Pipeline Loops

PipelineLoops is a feature for running a component or a set of component tasks multiple times in a loop. Right now, Tekton supports loop pipeline/tasks via an implementation of [Tekton Custom Tasks Controller](https://github.com/tektoncd/community/blob/master/teps/0002-custom-tasks.md) named as "PipelineLoop". Please refer to the examples [here](/tekton-catalog/pipeline-loops/examples) to understand more details about the usage of loops.

By default, the SDK will not compile all the recursion loop resources in the pipelineRun annotations. If you want to apply the recursion loop resources together with pipelinerun as an admin, add the following code snippet before compiling the pipeline.
```python
import kfp_tekton
kfp_tekton.compiler.LOOP_RESOURCES_IN_SEPARATE_YAML=False
```

To use this feature, please ensure Tekton version >= v0.19, and "data.enable-custom-tasks" is "true" in feature-flags configmap:
`kubectl edit cm feature-flags -n tekton-pipelines`

To see how the Python SDK provides this feature, refer to the examples below:
- [loop_static](/sdk/python/tests/compiler/testdata/loop_static.py)
- [withparam_global](/sdk/python/tests/compiler/testdata/withparam_global.py)
- [withitem_nested](/sdk/python/tests/compiler/testdata/withitem_nested.py)
- [parallelfor_item_argument_resolving](/sdk/python/tests/compiler/testdata/parallelfor_item_argument_resolving.py)

### Enforce Artifact Tracking

If you pipelines require artifact tracking in order to run, enforce artfact tracking to be always on for your pipelines using one of the two ways.
Expand Down

0 comments on commit 93f726f

Please sign in to comment.