Commit Graph

122 Commits

Author SHA1 Message Date
Tommy Li b219b2ee1e
fix(sdk): Add new logic to cover new tekton runafter condition (#1016)
* add new logic to cover new tekton runafter condition

* fix loop condition error
2022-07-28 20:30:55 +00:00
Tommy Li 909c4f2953
fix(sdk): fix exit handler param with empty exit task (#1015) 2022-07-27 19:18:11 +00:00
Tommy Li eaac53de79
Update result name to be case sensitive (#1013)
* update result name to be case sensitive

* add custom task test case
2022-07-26 21:03:16 +00:00
Tommy Li 126021b9d0
sdk(feat): Add big data passing with custom volume on kfp-tekton (#995)
* add big data passing with custom volume on kfp-tekton

* fix vscode typos and address errors

* Update compiler.py
2022-07-13 21:15:33 +00:00
Yihong Wang 66c09441a9
fix(sdk): update condition template (#975)
eliminate the use of `script`, replace it with
command and args. this also removes the init container that
prepares the script.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2022-06-07 22:11:15 +00:00
Yihong Wang 80739c0239
upgrade tekton to 0.36.0 (#938)
* upgrade tekton to 0.35.1

Upgrade tekton to 0.35.1, including:
- tekton manifests
- go.mod to use new pkg and update all related pkgs
- update pipeline-loops to also use new tekton pkg

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* update tekton to 0.36

update tekton, license files, and cache server

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* fix compile error on test code

for taskrun's step, it doesn't use container data struct
any more

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* update compiler

add `type` for the taskSpec.results and update all
yaml files accordingly

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2022-06-03 21:57:26 +00:00
Tommy Li 566b587a9d
Add pipelinerun pod template support for security context and automou… (#955)
* add pipelinerun pod template support for security context and automount_service_account_token

* update flag to the correct type

* update flag to the correct type

* update flag to the correct type

* update usage docs
2022-05-27 17:34:13 +00:00
Tommy Li 00eaffc4ea
fix(sdk): Fix param prefix replacement (#952) 2022-05-24 15:36:57 +00:00
Yihong Wang 282353d3f9
feat(sdk): Add helper class AddOnGroup (#920)
* feat(sdk): Add helper class AddOnGroup

add a helper class for users to write a custom
OpsGroup which maps to a custom task in Tekton.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* move finally under pipelineSpec

`finally` shall be  under `pipelineSpec`.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* Enhance params of AddOnGroup

make `params` argument of AddOnGroup class support
static and dynamic values.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* Add post_param() api in AddOnGroup

Add `post_param()` api to update the params of
the task

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* Handle intermediate params

Create a dedicated API to create intermediate params
which are only used by downstream Ops/OpsGroup, but not
list in the spec.params

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* fix incorrect param value

properly handle params that are created
from AddOnGroups in downstream Ops

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* handle nested AddOnGroup case

An AddOnGroup can contains another AddOnGroup
as downstream OpsGroup. The group name of an AddOnGroup
needs to follow the correct name pattern to allow
the compiler to calculate the nested case properly.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* clean up params inside the taskSpec.pipelineSpec

only keep params that are used by downstream tasks in
taskSpec.pipelineSpec.params

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* support annotations and labels

Add properties in AddOnGroup to store annotations
and labels. Then add their key/value pairs to
metadata.annotation and metadata.labels.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* rename the annotation property to annotations

amend the property name to plural

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2022-05-10 17:51:07 +00:00
Tommy Li ea1221a264
Fix multiple nested condition in loops issue (#928)
* fix multiple nested condition in loops issue

* update test cases to work with community cel custom task;
2022-05-04 20:58:33 +00:00
Tommy Li 7dd94985b3
Add resource op owner reference mapping (#922) 2022-04-28 16:27:32 +00:00
Tommy Li 8ba08e28ef
fix(SDK): Update sanitization logic to sync with kfp dsl (#919)
* map sanitization logic to original kfp

* update test data to reproduce sanitization bug

* fix upstream dsl bugs on undeterministic params on long names
2022-04-22 18:17:41 +00:00
Yihong Wang b14f952ceb
fix(sdk): Apply node_selector in PipelineConf (#918)
* fix(sdk): Apply node_selector in PipelineConf

Apply the node_selector in PipelineConf to spec.podTemplate
instead of taskPodTemplate of each task.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* update Makefile under pipelineloop

when running cli, it should do update target first

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2022-04-13 19:46:53 +00:00
Yihong Wang eac02f0633
fix(sdk): handle the node selectors (#916)
Handle the node selector info from PipelineConf in
compiler. Node selector info in Op level could overide
PipelinConf.
settings.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2022-04-12 20:43:56 +00:00
Yihong Wang 53fa9e7521
feat(sdk): extension function `Loop.enumerate()` (#901)
* feat(SDK): extension function `Loop.enumerate()`

Add helper function: `enumerate()` in Loop to
return indices and item. It could be used to get
current iteration number and item value.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

* add logic to handle nested loop

Add logic to handle nested loop and test cases

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
2022-04-01 22:30:05 +00:00
Michalina Kotwica b85d4e146f
fix(sdk) add tests for non-literal separator (#896)
* add tests for non-literal separator

* plug-in the tests

* process 'separator' like 'from'-'step'-'to'

* explicitly allow PipelineParam as a separator
2022-03-28 16:21:51 +00:00
Michalina Kotwica d5e2e43992
fix(sdk) add test for custom-tasks with literals. Fixes #880 (#881)
* add test for custom-tasks with literals

* fix orig_params check for custom tasks

* fix: style: min 2 spaces before inline comment

* fix: style: 2 empty line before function decl
2022-03-17 16:19:10 +00:00
Tommy Li 94dbd2a65a
Add caching labels for inline loops and custom tasks (#870) 2022-03-08 00:25:28 +00:00
Tommy Li 9843872b3a
Fix Tekton conditional dependency on sub-dag (#866)
* Fix Tekton conditional dependency on sub-dag

* fix tekton conditional dependency on group ops
2022-03-02 17:35:04 +00:00
Tommy Li 6166c7c2cc
Add loop numeric sdk support (#838)
* add loop numeric sdk support

* address comments

* fix comments

* add pipelineparam as input type for loop range function
2022-02-04 17:52:44 +00:00
Tommy Li ca81bf0c75
Add support to parse pipeline param in json string (#841)
* add support to parse pipeline param in json string

* update license
2022-01-27 19:47:11 +00:00
Michalina Kotwica dc74cb2374
feat(sdk): implement loop DSL ext: from_string. Part of #791 (#837)
* handle DSL for loop item separator

* handle compilation for separator

* add tests for loop with separator

* style: self -> cls in classmethods

* fix: dsl+compile

* update test results

* style: remove unused import

* style: blank lines

* add license to tests

* fix tests: no value passing of str loop src
2022-01-25 17:38:20 +00:00
Tommy Li ed7673cd37
Add option to produce pipelinerun taskspec as taskref (#810)
* add option to produce taskspec as taskref

* add rbac for task templates
2022-01-11 01:19:42 +00:00
Tommy Li c4f52e5f1c
Add taskrun name and uid into big data passing midpath (#771)
* add uid into big data passing midpath and update uid replacement to also replace with Tekton uid variable

* use taskrun name as midpath

* regenerate tests

* fix tests

* fix tests

* fix lint

* fix tests

* update midpath from uid to original pipelinerun

* fix lint

* replace original pipelinerun name in api to make metadata writer to work. Also add big data passing format to pipeline annotations

* update sdk loop logic to pass workspaces to sub-pipelines

* fix tests
2021-12-09 01:32:55 +00:00
Tommy Li e50795f125
Upgrade tekton api client and manifest to 0.30.0 & update default timeout (#798)
* upgrade tekton api client to 0.30.0

* update default timeout to non-zero
2021-12-08 20:41:59 +00:00
Tommy Li 5dfc36bb41
Add UI backward compatibility for dsl.container syntax (#768)
* add ui backward compat for dsl.container syntax

* add ui backward compat for dsl.container syntax
2021-11-09 11:58:05 -08:00
Michalina Kotwica 3e4f4d8d39
fix(sdk): "when" in some ParallelFor loops (#762)
* fix: "when" in some ParallelFor loops

* refactor: split long line
2021-10-27 09:17:28 -07:00
Prashant Sharma 1eea71606b
feat(sdk): Add an API to return prepared workflow as python dicts. (#757)
* Add a API to return prepared workflow as python dicts.

* Added guide and improved the prepare workflow signature.
2021-10-22 10:20:03 -07:00
Michalina Kotwica d15acfd472
fix(sdk) orig_params being overwritten in custom-tasks (#742) 2021-10-04 09:33:50 -07:00
Tommy Li 418528496b
Optimize kfp-tekon SDK compile time (#736)
* optimize kfp-tekon compile time

* fix lint
2021-09-22 18:42:35 -07:00
Tommy Li 043d734147
Fix(sdk): chain nested conditions to work on non-dependable condition tasks. (#732)
* chain nested conditions

* add missing license

* add dependency check to remove unnecessary when expression

* minor improvement to check for the exact condition rather than just the condition task
2021-09-15 15:08:55 -07:00
Prashant Sharma cdbb588c52
feat(sdk): Update SDK to support custom task timeout on Tekton 0.27 (#709) 2021-08-23 17:52:39 -07:00
Tommy Li 186a9e301f
Update code to limit loop resource group name (#686)
* update code to limit loop resource group name

* add license
2021-08-02 19:57:11 -07:00
Tommy Li df63b7853a
Fix merging issue from #512 (#674) 2021-07-22 12:42:06 -07:00
Tommy Li d9b8539b0d
feature(backend): Allow KFP apiserver to create recursion pipelineLoop CRs for the users (#512)
* add auto apply custom task CRs before pipelineRun creation

* fix lint

* store loop resource in ordered dict

* Update kfp-admin-guide.md

* sorted pipeline params to avoid randomness

* sorted pipeline params to avoid randomness

* regenerate tests

* convert template string from yaml to json

* regenerate tests

* clean up unnecessary helper function

* resolve merge conflicts

* resolve merge conflicts

* remove unnecessary go mod package

* only opt-in to embed the recursion loop annotations

* only opt-in to embed the recursion loop annotations

* enable opt-in only via package variable

* add example for how to inline recursive loops

* resolve conflicts

* regenerate tests

* make auto generate and apply recursive pipelineloop in annotations as default

* move parameter sorting to the end

* add parameter sorting for recursion loops

* sort recursive task parameters

* add more details on how to opt-out auto apply custom resource
2021-07-21 00:26:50 -07:00
Prashant Sharma bd2f5f669e
fix(sdk): sort params to fix flaky tests. (#662) 2021-07-08 06:35:49 -07:00
Michalina Kotwica 95a961c2d1
fix(sdk): loop argument jsonified, not stringified (#657)
Signed-off-by: Michalina Kotwica <michalina.kotwica.ibm@gmail.com>
2021-07-06 09:32:47 -07:00
Prashant Sharma dbd92cb7ec
feat(sdk): inline user defined custom tasks (#636) 2021-07-02 10:26:11 -07:00
Gang Pu 791fe5304a
Fix the issue when loop/graph inside a graph (#650) 2021-07-01 17:09:10 -07:00
Prashant Sharma 64d4324f2b
feat(sdk): Sdk ParallelFor task spec inline (#633)
* TODO1: PipelineLoop inlined including nested loops and added tests.

* Supported recursive and parallel tasks inlining.

    For recursive tasks, we simply skip them.
    For Parallel tasks, relevant tests were added.

* Run all tests against inlined taskSpec and normal taskRefs

* Added CLI Flag disable/enable spec inlining.
2021-06-29 19:07:36 -07:00
Tommy Li aae4671e7b
Fix nested recursion with condition custom task and parameter mapping (#625)
* fix nested recursion with condition custom task and parameter mapping

* fix alpine commands and add licenses
2021-06-18 14:56:14 -07:00
Gang Pu a033f33b30
Fix and verify nested recursive workflow (#600)
* Fix and verify nested recursive workflow

* Fix unit_test error

* Update compiler.py

* Try to fix travis error

* Refresh yaml

Co-authored-by: Tommy Li <Tommy.chaoping.li@ibm.com>
2021-06-01 00:25:04 -07:00
Tommy Li 73d5445482
Add support to generate custom task with custom task cr (#593) 2021-05-22 02:53:30 -07:00
Gang Pu 95557c6d36
Support parallelism feature on DSL side (#592) 2021-05-20 00:51:46 -07:00
Tommy Li 1bf5aa5d13
Fix custom task condition I/O behaviors on recursion and for loop (#587)
* fix custom task I/O behaviors on recursion and while loop

* Fix comment typo
2021-05-15 02:00:29 -07:00
Tommy Li 633848134d
Sanitize Tekton result parameters when passing to custom task inputs (#579) 2021-05-06 12:07:06 -07:00
Gang Pu 98b356cbb1
Fix the issue when there's a conditional loop (#562) 2021-04-23 09:44:43 -07:00
Tommy Li e68e03e6c3
Fix recursive loop bug with no sub_group.ops (#556) 2021-04-21 06:15:41 -07:00
Tommy Li 103ae3b79b
Fix long param compile errors (#549) 2021-04-20 10:13:41 -07:00
Tommy Li 6adfcc64f3
feature(sdk): Optimize unnecessary condition task when using User definable CEL Custom task (#478)
* add cel custom task poc

* apply suggestions with minor fixes

* add initial version of plugable cel template

* fix lint

* update staging code for converting containerOp to custom task

* update staging code for converting containerOp to custom task

* remove duplicate cel conditions

* update flip-coin example to use custom task

* update flip-coin example to use custom task

* remove dsl dependencies;

* add POC comments

* fix lint

* fix self-defined CEL custom task mapping

* move custom task condition example to a separate folder

* fix tests

* make the new custom task spec and CEL condition feature as opt-in

* update instructions and generalize custom task images

* only let custom task result comparasion to skip the condition container to provide backward compatibility

* only let custom task result comparasion to skip the condition container to provide backward compatibility

* update example

* update tests

* fix comment
2021-04-13 09:43:11 -07:00