Commit Graph

70 Commits

Author SHA1 Message Date
Mai Nakagawa ef94ccd734
fix(sdk): Resolves issue when using ParallelFor with param and depending tasks (#11903)
Signed-off-by: Mai Nakagawa <nakagawa.mai@gmail.com>
2025-05-09 15:49:41 +00:00
Matt Prahl f9d487cb60
fix(sdk): Add SDK support for setting resource limits on older KFP versions (#11839)
For context, the commit 70aaf8a9a4 removed
support for the old fields (without a resource_ prefix). This was
added back in commit 6ebf4aae03 but done in a way
that broke any usage of pipeline input parameters but was to support the
current KFP backend which did not yet support the new fields. In commit
7c931ae201, the old fields were removed
again but added support for the new field in KFP backend.

This commit addresses the case where a user is using a new SDK but with
a KFP backend prior to 2.4.

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
2025-04-21 13:46:27 +00:00
Stijn Tratsaert d1b15ef4da
fix(sdk): avoid conflicting component names in DAG when reusing pipelines (#11071)
* make component names in dag more unique

Signed-off-by: Stijn Tratsaert <stijn.tratsaert.it@gmail.com>

* tweak ordering so that renaming is handled in LIFO fashion

Signed-off-by: Stijn Tratsaert <stijn.tratsaert.it@gmail.com>

* add test that reuses a pipeline multiple times

Signed-off-by: Stijn Tratsaert <stijn.tratsaert.it@gmail.com>

---------

Signed-off-by: Stijn Tratsaert <stijn.tratsaert.it@gmail.com>
2025-03-18 23:25:45 +00:00
Ze Mao 42fc132616
feat: Introduce cache_key to sdk (#11466)
Signed-off-by: Ze Mao <zemao@google.com>
Co-authored-by: Ze Mao <zemao@google.com>
2025-02-10 09:10:49 -08:00
Matt Prahl 7c931ae201
feat(sdk/backend): Add support for placeholders in resource limits (#11501)
The API introduced new fields prefixed with Resource (e.g.
ResourceCpuLimit) to replace the old fields without the prefix. The
Driver hadn't been updated to honor those fields but the SDK started
using them which led to unexpected behavior.

The Driver now honors both fields but prioritizes the new fields. The
SDK now only sets the new fields.

The outcome is that resource limits/requests can now use input
parameters.

Note that pipeline_spec_builder.py was doing some validation on the
limits/requests being set, but that's already handled in the user facing
method (e.g. set_cpu_limit).

Resolves:
https://github.com/kubeflow/pipelines/issues/11500

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
2025-01-09 15:35:24 +00:00
Humair Khan 22e85de2bc
feat(sdk/backend): enable parameterization of container images (#11404)
This change allows component base images to be parameterized using runtime pipeline parameters. The container images can be specified within an @pipeline decorated function, and takes precedence over the @component(base_image=..) argument.

This change also adds logic to resolve these runtime parameters in the argo driver logic. It also includes resolution steps for resolving the accelerator type which functions the same way but was missing the resolution logic. The resolution logic is a generic workaround solution for any run time pod spec input parameters that cannot be resolved because they cannot be added dynamically in the argo pod spec container template.

Signed-off-by: Humair Khan <HumairAK@users.noreply.github.com>
2024-12-04 12:45:00 +00:00
Ricardo Martinelli de Oliveira 6ebf4aae03
fix(sdk): Backport fixes in kubeflow/pipelines#11075 (#11392)
Introduced back the functions to convert k8s size values to float, but
moved to kfp.dsl.utils

Signed-off-by: Ricardo M. Oliveira <rmartine@redhat.com>
2024-12-03 22:32:59 +00:00
Dharmit Dalvi 3f495229f2
feat(sdk): Allow disabling default caching via a CLI flag and env var (#11222)
* feat(sdk): Allow setting a default of execution caching disabled via a compiler CLI flag and env var

Co-authored-by: Greg Sheremeta <gshereme@redhat.com>
Signed-off-by: ddalvi <ddalvi@redhat.com>

* Add tests for disabling default caching var and flag

Signed-off-by: ddalvi <ddalvi@redhat.com>

---------

Signed-off-by: ddalvi <ddalvi@redhat.com>
Co-authored-by: Greg Sheremeta <gshereme@redhat.com>
2024-09-25 22:28:35 +00:00
KevinGrantLee 70aaf8a9a4 feat(sdk): support dynamic machine type parameters in pipeline task setters (#11097)
* temp title: change title

Signed-off-by: KevinGrantLee <kglee@google.com>
2024-09-20 17:30:32 +00:00
Kevin James 0b92f86408
refactor: fix invalid escape sequences (#11147)
Signed-off-by: Kevin James <KevinJames@thekev.in>
2024-09-20 16:24:30 +00:00
Diego Lovison 123ed1eb30
chore: Set Python 3.9 as the Minimum Supported Version (#11159)
Signed-off-by: Diego Lovison <diegolovison@gmail.com>
2024-09-12 19:10:22 +00:00
KevinGrantLee c051e55dc3
test: Add ParallelFor compile test over single artifact. (#10531)
* .

* formatting
2024-02-28 06:14:59 +00:00
KevinGrantLee 144761c948
fix(sdk): Prevents dsl.ParallelFor over single parameter from compiling. (#10494)
* fix(sdk): Prevents dsl.ParallelFor over single paramter from compiling.

* fix(sdk): Prevents dsl.ParallelFor over single paramter from compiling.

* update PR number in release notes

* formatting

* Add compiler_test.py test for single param compile failure

* Update some docstrings and add todo

* formatting

* Update sdk/python/kfp/compiler/compiler_test.py

Co-authored-by: Connor McCarthy <mccarthy.connor.james@gmail.com>

* Update sdk/python/kfp/compiler/compiler_test.py

Co-authored-by: Connor McCarthy <mccarthy.connor.james@gmail.com>

* Update sdk/python/kfp/dsl/for_loop.py

Co-authored-by: Connor McCarthy <mccarthy.connor.james@gmail.com>

* Use print_and_return and other small changes

* typo

* typo

---------

Co-authored-by: Connor McCarthy <mccarthy.connor.james@gmail.com>
2024-02-27 23:41:59 +00:00
Connor McCarthy 21c5ffebb0
fix(sdk): fix bug where `dsl.OneOf` with multiple consumers cannot be compiled (#10452) 2024-02-08 23:51:37 +00:00
rickyxie0929 fe04a5a842
fix(sdk): fixes type issues for ParallelFor. Fixes #9366 (#10436)
* fix type issues

* fix type issue

* fix format

* fix failed test

* fix format

* delete comments

* resolve comments

* resolve comments

* resolve format

* resolve import

* move unnecessary file

* resolve compiler_test failures

* resolve comments

* remove unnecessary imports

* fix format sort

* fix nits

* add new compiled yaml file

* solve merge conflicts

* solve conflicts

* format

* sort

* resolve comments

* resolve comments
2024-02-08 18:34:37 +00:00
Connor McCarthy 11f60d813a
feat(sdk): support `.after()` referencing task in `ParallelFor` group (#10257) 2023-11-29 10:22:14 -05:00
Connor McCarthy c0adea9946
chore(sdk): add test for key error bug resolved in #10067 (#10128) 2023-10-19 23:49:03 +00:00
Connor McCarthy 8d00d0eb9a
feat(sdk): support a Pythonic artifact authoring style (#9932)
* chore(sdk): test observability, refactorings, and cleanup

* implement unified i/o syntax

* clarify container component error message

* address review feedback

* add dill to packages_to_install

* update get_uri logic for KFP and tests

* update execution tests & cleanup
2023-10-19 18:49:58 +00:00
Connor McCarthy 2d3171cbfe
feat(sdk): support collecting outputs from conditional branches using `dsl.OneOf` (#10067)
* support dsl.OneOf

* address review feedback

* address review feedback
2023-10-18 02:34:55 +00:00
Connor McCarthy 55f174e5bb
chore(sdk): clean up compiler_test.py (#10070) 2023-10-09 20:50:18 +00:00
Connor McCarthy fcdff294a6
fix(sdk): fix incorrect sub-DAG output type when using `dsl.Collected` (#10069) 2023-10-09 17:04:18 +00:00
Connor McCarthy 87005cc015
chore(sdk): wrap conditional branch groups in outer pipeline (#10034) 2023-10-05 02:45:15 +00:00
Connor McCarthy e99f2704fc
feat(sdk): support `PipelineTaskFinalStatus` in tasks that use `.ignore_upstream_failure()` (#10010)
* support taskfinalstatus in tasks that ignore upstream failure

* address review feedback
2023-09-21 01:46:37 +00:00
Connor McCarthy c6b236d1a0
feat(sdk): support dsl.If, dsl.Elif, and dsl.Else (#9894)
* support if/elif/else

* deprecate dsl.Condition

* alter rebase

* update release notes

* address review feedback

* change BinaryOperation to ConditionOperation
2023-09-11 20:19:35 +00:00
Connor McCarthy c9e54798cd
chore(sdk): undo creation of kfp-dsl namespace package (#9874)
* revert to c8204d0

* reapply #9742

* modify #9791

* reapply #9800

* reapply #9827

* revert parts of #9738

* reapply parts of #9785

* remove duplicated dsl-test code

* reapply parts of #9791

* correct version
2023-08-15 16:24:52 -07:00
Connor McCarthy 309c5b9f0a
chore(sdk): release KFP SDK 2.1.0 (#9782) 2023-07-26 17:09:02 +00:00
Connor McCarthy c8204d0285
chore(sdk): partition KFP SDK source code into runtime and non-runtime code (#9710) 2023-07-07 23:18:52 +00:00
Chen Sun a727783abd
chore: remove 'dummy_root' in test samples (#9640)
* remove 'dummy_root' in test samples

* more cleanup
2023-06-21 23:51:41 +00:00
Connor McCarthy 48ecc7d879
fix(sdk): fix bug when iterating over output from upstream task in nested parallelfor loops (#9580)
* refactor for clarity

* fix iter over upstream output in nested parallelfor

* update release notes

* support empty `List` generic annotation

* fix typos

* add comment about refactoring opportunity

* fix annotation

* update comment again
2023-06-09 08:58:28 -07:00
Connor McCarthy 96947e6fb9
fix(sdk): fix compilation of boolean constant passed to component (#9390) 2023-05-12 17:13:39 +00:00
Connor McCarthy c01288d673
feat(sdk): support writing `TASK_FINAL_STATUS` parameter type (#9080)
* write new parameter type

* update golden snapshots

* add compiler tests
2023-05-12 17:13:32 +00:00
Connor McCarthy 946c51bafe
feat(sdk): support extracting input/output descriptions from component/pipeline docstrings (#9156)
* feat(sdk): support extracting input/output descriptions from component/pipeline docstrings

* remove numpydoc tests
2023-04-24 17:16:44 +00:00
Connor McCarthy 91abbeaf2f
feat(sdk): support `display_name` and `description` in `@dsl.pipeline` decorator (#9153)
* feat(sdk): support display_name and description in @dsl.pipeline decorator

* add release note

* test additional case
2023-04-17 14:15:39 -07:00
Chen Sun a6ef77b784
feat(sdk): Support setting cpu/memory requests. (#9121)
* Support setting cpu/memory requests.

* address review comments

* address review comments
2023-04-10 23:35:16 -07:00
Connor McCarthy 0cbcebcf88
fix(sdk): support accessing `.dsl` attribute on `kfp` module object (#9048) 2023-03-27 15:12:17 -07:00
Ze Mao 0fd1e69c74
cpu and memory resource can be optional (#8992)
Co-authored-by: Ze Mao <zemao@google.com>
2023-03-16 09:23:55 -07:00
Connor McCarthy a38d7479d7
feat(sdk): support compiling platform specific features (#8940)
* support compiling platform-specific features

* fix map size change during iteration
2023-03-10 11:18:25 -08:00
Connor McCarthy c046879dda
support fanning-in artifacts (#8808) 2023-02-22 10:39:00 -08:00
Connor McCarthy 41752608bc
support list of artifact input placeholders (#8484) 2023-02-16 09:26:53 -08:00
JOCSTAA 1e1a02066a
fix(sdk): Add outputDefinitions of root pipeline to compiled components IR YAML file (#8848)
* base

* add to readme

* adress comments
2023-02-15 09:28:33 -08:00
JOCSTAA 5684bfccff
feat(sdk): Ignore upstream failure (#8838)
* main

* adress comments

* adress comments

* adress comments 2

* address comments 3

* address comments 4
2023-02-13 11:40:42 -08:00
Connor McCarthy b575950a75
feat(sdk): support for fan-in from `dsl.ParallelFor` (#8631)
* implement parallelfor fan-in

* temporarily block fan-in of artifacts

* clean up

* unify and clarify error messages

* remove comment

* remove unnecessary compiler condition

* make test cases more realistic

* use better ParallelFor variable name

* add and rename test cases

* add ParallelFor fan-in test cases

* fix return collected bug

* clean up compilation tests

* update docstrings; update error message

* remove fan-in artifacts read/write tests

* implement review feedback

* change use of additional_input_name_for_pipeline_channel

* move additional_input_name_for_pipeline_channel

* provide additional pipeline topology validation and tests; refactor existing validation

* add release note for parameter fan-in
2023-02-04 20:50:51 -08:00
Connor McCarthy 151e8a3c6e
feat(sdk): support optional artifact inputs (#8623)
* add compiler tests

* support optional artifact inputs

* update executor test

* update existing golden snapshot

* add new compiler test/snapshot

* add release note

* bump kfp-pipeline-spec dependency
2022-12-28 13:40:12 -05:00
Connor McCarthy 5491f6f3db
fix(sdk): support writing/reading isOptional for input parameters (#8612)
* add tests

* support writing/reading isOptional for parameters

* update golden snapshots

* temporarily maintain workaround for v1 optional artifact inputs

* add release note
2022-12-21 14:46:59 -08:00
JOCSTAA 49db63c916
feat(sdk): Add comments to IR YAML file (#8467)
* base

* add tests

* fix bug

* adress comments

* address comments 2

* sort comments

* sort signatures

* add indempotent test

* add indempotent test2

* support multiline docstring

* review

* docformatter presubmit exclude

* docformatter presubmit exclude

* docformatter

* docformatter

* merge 1

* update readme

* nit .items()

* remove reduntant test
2022-12-05 14:43:14 -08:00
JOCSTAA 614c231ae6
fix(sdk): unblock valid topology. (#8416)
* unblock valid topology

* add more tests

* handle git fork

* sample_test_cases

* main

* restore to master

* resolve comments on PR

* resolve conflicts

* resolve conflict 2

* revert conflict fix

* fix changes

* address comments

* review

* docformatter presubmit

* revert docformatter

* update release.md
2022-12-02 00:15:15 +00:00
Connor McCarthy 9e9e1081c6
fix(sdk): fix boolean default value serialization bug (#8444)
* add test cases

* fix bug

* add v1 component yaml back compat changes

* update golden snapshot
2022-11-11 15:42:33 -08:00
Connor McCarthy 24e17f7352
chore(sdk): quiet noisy SDK unit test output (#8434) 2022-11-09 17:47:39 +00:00
Connor McCarthy e371fa3795
feat(sdk): add compilation logic for google artifact types (support custom artifact types pt. 2) (#8232)
* remove dependency of deprecated on v2

* use new artifact identification logic

* add custom artifact type compiler test

* compile schema_version from non-kfp artifacts

* update tests

* add importer to compiler test

* update golden snapshots

* fix type checking code

* undo executor_test diff

* remove gcpc types compiler test

* add compilation test comment

* update google artifact handling

* update compiler test

* only permit system. and google. artifact types; add tests

* update compiler test

* simplify type checking logic

* use bundled artifact types in PipelineArtifactChannel

* raise error on unknown v1 input or output

* add type utils and move functions

* add type utils tests

* remove schema_version from inputspec and outputspec

* update artifact proto creation and tests

* propogate bundled artifact type string changes throughout sdk

* update golden snapshot

* remove unused v1 compat and tests

* update type checking and tests to validate schema_version using semantic versioning

* update importer sample

* update test data config

* update test_data config

* clean up sample

* clean up sample
2022-09-12 14:00:02 -06:00
Connor McCarthy 16c7d6658e
test(sdk): create SDK execution test suite and restructure read/write tests (#8245)
* update client for graph components

* use yaml for config

* simplify read write tests

* add test script

* restructure yaml and read/write tests

* add execution test file

* move test_data; update paths; update readme

* update kfp endpoint

* update pipeline with env

* update logging

* update config

* update kfp endpoint and timeout

* add kfp as requirement

* mock kfp_package_path for lightweight component execution

* revert pipeline name changes

* update config with name

* update read write tests to use explicit name

* update execution tests to use explicit name
2022-09-12 18:33:06 +00:00