Commit Graph

131 Commits

Author SHA1 Message Date
Chen Sun 439d8c87c1
chore(sdk): remove dead code on importer check in v1. (#6508)
* remove dead code

* Update RELEASE.md

* Update compiler.py

* Update v2_compatible_compiler_test.py

* Update compiler_tests.py

* Update RELEASE.md
2021-09-07 15:01:06 -07:00
Chen Sun 2f19a26ffd
chore(sdk): Format all Python files under SDK folder. (#6501)
* Reformat sdk only using the new yapf config.

* Reformat docstrings using docformatter.

* update golden files to resolve diff caused by whitespaces

* fix some tests

* format .py files under sdk/python/tests using yapf

* additional docformatter

* fix some tests
2021-09-03 11:25:11 -07:00
Chen Sun 434e5c3489
fix(sdk): block dsl.importer usage in KFP OSS. Fixes: #6323 (#6330)
* block dsl.importer in KFP OSS

* address cr comments
2021-08-16 01:02:06 -07:00
Yuan (Bob) Gong befd89c6ec
fix(sdk): pipeline name is required in v2 compatible mode. Fixes #6197 (#6332)
* fix(sdk): pipeline name is required in v2 compatible mode

* Update xgboost_sample.py
2021-08-13 14:00:04 -07:00
Niklas Hansson ed2ba1a6b3
chore(sdk): Argo lint requires '--kinds=workflows' argument for offline linting. (#6135) 2021-07-26 00:40:41 -07:00
Chen Sun b200e1bc7d
fix(sdk): Fix URI placeholder in v2 compatible mode. (#6040)
* fix uri placeholder in v2 compatible mode

* fix tests

* fix path generation

* fix tests

* fix test

* cleanup

* clean up

* fix test

* fix test

* fix test
2021-07-21 08:32:50 -07:00
Niklas Hansson 354e4251e8
chore: add offline linting (#5981)
* Added the offline linting

* update after feedback
2021-07-20 08:39:15 -07:00
Yuan (Bob) Gong fff62e1521
chore(v2): unify pipeline name between MLMD and KFP DB. Fixes #5978 (#6038)
* chore(sdk): unify pipeline name between MLMD and KFP DB

* backend changes pipeline-name during upload

* update sdk snapshots

* add backend tests

* fix launcher

* fix tests

* address feedback
2021-07-14 20:53:51 -07:00
Yuan (Bob) Gong 8a256db1bf
feat(sdk/dsl/compiler): dsl-compile --mode flag to turn on V2_COMPATIBLE, defaults to KF_PIPELINES_COMPILER_MODE env var. Fixes #5840 (#5952)
* feat(sdk/dsl/compiler): support --mode flag which can turn on v2 compatible mode

* override compiler default mode using KF_PIPELINES_COMPILER_MODE env var

* update V1_LEGACY to V1

* add unit tests

* address feedback

* clean up

* cleanup again

* use absl.testing.parameterized for table driven tests

* update
2021-07-03 02:22:49 -07:00
Yaqi Ji e7c281bd65
chore: Change python/kfp/compiler and cli folders from relative to absolute path (#5891)
* Update deprecated download_as_string to download_as_bytes

* Add more usage

* chore: Change python/kfp/cli from relative to absolute path

* chore: Change python/kfp/compiler from relative to absolute path
2021-06-22 11:28:31 -07:00
Chen Sun 2991602cfc
feat(sdk): Better error message when compiling for v2. Fixes #5688, Fixes #5727 (#5759)
* Better error message when compiling for v2

* update samples
2021-05-31 13:39:03 -07:00
Chen Sun fa5ac25678
fix(sdk): Avoid inserting duplicate input parameters in v2 compatible mode. (#5740) 2021-05-28 15:06:00 -07:00
Yuan (Bob) Gong 7629e10130
chore(sdk): warn v2 compatible mode is Beta quality (#5658) 2021-05-17 21:55:40 -07:00
capri-xiyue 6717434978
[SDK] Add pod labels for telemetry purpose (#5582)
* Add pod labels for telemetry purpose

* fixed test

* added sdk label in pods

* added sdk type label

* fixed test

* added UT back

* updated UT
2021-05-05 10:43:27 -07:00
Alexey Volkov cc83e1089b
Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
capri-xiyue 0dba00518c
chore(sdk.v2):add v2 compact metrics label (#5566)
* add-v2-compact-metrics-label

* add telemetry pod label
2021-04-29 16:06:30 -07:00
Chen Sun 5dafda1270
feat(sdk.v2): Support explicit importer (#5502) 2021-04-19 13:14:09 -07:00
Chen Sun 5f97a4502d
feat(sdk.v2): remove pipeline_root from compiler interface (#5492) 2021-04-16 08:49:13 -07:00
Chen Sun f32915e88f
feat(sdk.v2): Support setting custom job spec in v2. (#5454)
* Support setting custom job spec.

* auto fill custom job jobSpec using container spec.

* fix test

* address comments
2021-04-10 09:20:04 -07:00
Ajay Gopinathan a1d453af21
chore(sdk): Allow the launcher image to be configurable. (#5360)
* Allow the launcher image to be configurable. This is especially useful
for tests.

* Address PR comments.
2021-03-23 08:27:44 -07:00
Niklas Hansson 8a32632edf
fix(sdk): make workflow validation compatible with argo CLI v2.12+. Fixes #4775, Fixes #5296 (#4804)
* updated the validation default test

* updated the version

* Update compiler.py

* Update compiler.py

* Update compiler.py

Co-authored-by: Yuan (Bob) Gong <4957653+Bobgy@users.noreply.github.com>
2021-03-18 21:10:16 -07:00
Ajay Gopinathan 83eded130c
feat(sdk): Introduce experimental v2-compatibility in KFP SDK (#5218)
* WIP: Enable v2 compatibility in KFP SDK compiler.

* First pass clean up

* Clean up and introduce enum instead of boolean for execution mode.

* More cleanup

* Clean up and add comments.

* Undo formatting changes.

* Undo formatting changes.

* Add method to unconditionally add kfp pod env.

* minor formatting change.

* Update docstrings.

* Undo formatting changes.

* fix imports.

* fix pod_env tests

* rebased.

* undo format changes.

* Undo compiler changes.:

* format _default_transformers.py for consistency

* Fix various rebasing issues.

* fix bug referring to pipeline_name/pipeline_root in v1 pipelines.

* revert output dir name.

* allow both types of attributes for pipeline root.

* fix pod env yaml golden.

* fix for input/output uri tests.

* Add v2 compatible compiler test.

* Use ordereddict to fix flaky golden file tests.

* Address PR comments.

* Address PR comments.

* Address PR comments.
2021-03-08 15:40:23 -08:00
S N Munendra 37d6554e5f
fix(sdk): update default value for type_check in compiler docstrings (#5169) 2021-03-01 02:16:16 -08:00
Chen Sun f27d3b81b8
chore(sdk): remove redundant method: `_pipelineparam_full_name()` (#5174) 2021-02-25 16:52:15 -08:00
Yuku Takahashi cfe59139be
fix(sdk): generate valid pipeline from non-ascii name. Fixes #5119 (#5120) 2021-02-18 18:20:30 -08:00
Jiaxiao Zheng 846423a870
feat(sdk): Always add pipeline root as a pipeline parameter (#5122)
* refactor pipeline root passing

* fix test
2021-02-10 16:29:57 -08:00
Jiaxiao Zheng 86f03a90a3
chore: Improve the error message when incompatible placeholders are connected (#5082) 2021-02-03 00:10:36 -08:00
Michalina Kotwica ce985bc287
fix(sdk): Allow keyword-only arguments in pipeline function signature (#4544)
* add test for keyword-only arguments in pipeline func

* fix: kwargs-only argument for pipeline func

* test: kwargs generate same yaml as args

* remove whole metadata

* assert -> self.assertEqual

* programmatic example --> fixed example

* same name for both

Co-authored-by: Alexey Volkov <alexey.volkov@ark-kun.com>
2021-01-29 18:31:02 -08:00
radcheb 5633b9abda
fix(sdk): fixes unresolved PipelineParam when static list passed to dsl.ParallelFor. Fixes #4890 (#4891)
* fix parallelfor compiling items + add tests

* remove debug print

* fix tests

* fix parallelfor_pipeline_param_in_items_resolving test

* debug test

* fix tests

* Revert "debug test"

This reverts commit 57451143bd.

* fix tests
2021-01-14 00:09:03 -08:00
Jiaxiao Zheng 7540ba5c3b
feat(sdk): Implements artifact URI placeholder. (#4932)
* add placeholder to spec

* add output_directory to pipeline

* respect uri placeholder in file outputs

* wip: add data passing rewriting logic to respect the uri semantics

* merge input_uri and paths when instantiating ContainerOp

* fix

* fix workflow rewriting

* Add topology rewriting

* add a test case, and various fixes

* make the test case more complex

* Fix the case when working with OpsGroup

* Fix test case

* fix resolving test

* fix redundant cmd lines

* fix redundant cmd lines

* resolve comments

* fix file outputs

* resolve comments

* copy file outputs instead of modifying inplace.
2021-01-05 20:39:51 -08:00
Niklas Hansson 24732b9dae
feat(compiler): add dsl operation for parallelism on sub dag level (#4199)
* Added subdag parallelism

Authored-by: NikeNano <niklas.sven.hansson@gmail.com>
Co-authored-by: guanhuichen <guanhuichen@gmail.com>

* added error handling, fixed comment and refactored

* updated with sleep and TODO

* fix imports

Co-authored-by: guanhuichen <guanhuichen@gmail.com>
2020-12-26 22:10:27 -08:00
Kenta Onishi 5a4b70e37c
feat(sdk): Add settings of the dnsConfig field. Fixes #4836 (#4837)
* feat(sdk): Add settings of the dnsConfig field. Fixes #4836

* feat(sdk): Add dnsConfig example and sample.

* feat(sdk): Refactor dnsConfig param.

* feat(sdk): Refactor dnsConfig param.
2020-12-14 20:05:49 -08:00
Jiaxiao Zheng fb15223f7e
chore: Add doc strings marking the feature stages for SDK. (#4575)
* add doc strings

* Simplify the docstring

* fix unittest

* recover cli.py

* recover cli.py

* substitute docstring in resource ops with TODOs

* revert stable labels
2020-11-24 00:19:00 -08:00
Alexey Volkov f7874d38ff
fix(sdk): Compiler - Fixed pipeline parameters with empty default values (#4552)
Fixes https://github.com/kubeflow/pipelines/issues/4549
2020-11-12 15:52:28 -08:00
Asav Patel 9efc9e59b2
fix(sdk) - fixes missing import in KFP compiler (#4741) 2020-11-09 17:30:41 -08:00
Niklas Hansson c32ea232d5
feat(compiled): set pod disruption budget for pipelines. Fixes #3877 (#4178)
* Update _client.py

* Update _client.py

* added pod disruption budget

* clean up

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

* fixed parameter

* updated after feedback

* removed selector
2020-09-14 13:45:26 -07:00
Victor 22b7b99a8b
fix(sdk): Fix opsgroups dependency resolution (#4370) 2020-08-27 09:03:53 -07:00
Alex Latchford 704c8c7660
chore: Clean up KFP SDK docstrings, make formatting a little more consistent (#4218)
* Prepare SDK docs environment so its easier to understand how to build the docs locally so theyre consistent with ReadTheDocs.

* Clean up docstrings for kfp.Client

* Add in updates to the docs for compiler and components

* Update components area to add in code references and make formatting a little more consistent.

* Clean up containers, add in custom CSS to ensure we do not overflow on inline code blocks

* Clean up containers, add in custom CSS to ensure we do not overflow on inline code blocks

* Remove unused kfp.notebook package links

* Clean up a few more errant references

* Clean up the DSL docs some more

* Update SDK docs for KFP extensions to follow Sphinx guidelines

* Clean up formatting of docstrings after Ark-Kuns comments
2020-08-04 00:33:47 +08:00
Alexey Volkov bbc9ff5ec3
SDK - Compiler - Validating Argo validator (#3874)
* SDK - Compiler - Validating Argo validator

* Added warning if argo is available, but not working
2020-07-10 19:07:21 -07:00
Niklas Hansson c6ac83f72c
feat: add parallelism for dsl.ParallelFor. Fixes #4089 (#4149)
* Added parallism at sub-dag level

* updated the parallism

* remove yaml file

* reformatting

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

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

* Update samples/core/loop_parallelism/loop_parallelism.py

Co-authored-by: Alexey Volkov <alexey.volkov@ark-kun.com>

Co-authored-by: Alexey Volkov <alexey.volkov@ark-kun.com>
2020-07-08 11:27:13 -07:00
Alexey Volkov 48889a99d1
fix(sdk): Compiler - Fixed input artifact name sanitization when using raw string arguments. Fixes #4110 (#4120) 2020-07-08 10:43:09 -07:00
Alexey Volkov 6960366846
fix(sdk): Compiler - Fixed the input argument mapping when using dsl.graph_component. Fixes #3915 (4082)
* SDK - Compiler - Fixed the input argument mapping when using dsl.graph_component

Fixes https://github.com/kubeflow/pipelines/issues/3915

* Stopped relying on the argument order at all

This can make the compilation less fragile.
2020-06-29 02:31:37 -07:00
Jiaxiao Zheng b099c6f5d3
chore: Rollback telemetry related changes (4088)
* Revert "fix length (#3934)"

This reverts commit 7fbb7cae

* Revert "[SDK] Add first party component label (#3861)"

This reverts commit 1e2b9d4e

* Revert "[SDK] Add pod labels for telemetry purpose. (#3578)"

This reverts commit aa8da64b
2020-06-27 15:46:14 -07:00
Alexey Volkov 54a596abd8
SDK - Compiler - Added support for volume-based data passing (3371)
* SDK - Compiler - Added support for volume-based data passing

Currently artifact passing is performed by Argo sidecar containers what download input data and upload output data to artifact repository (usually, S3-compatible blob storage like Minio).
The performance of this method is not optimal and it requires that pod disks have enough capacity to hold all artifact data.

This commit adds support for volume-based data passing.
This method involves using a single milti-write Kubernetes data volume to pass all intermediate data.
Parts of the volume are mounted to the input/output artifact directories, so when the user program reads and writes files, the files actually reside in the data volume.
This method improves the performance and reduces storage resource requirements.

The data volume must exist and support "READ_WRITE_MANY".

Limitations:
* All artifact file names must be the same (e.g. "data"). All auto-generated paths are already consistent. Avoid using any hard-coded paths.
* Passing constant values (text) as arguments for artifact inputs is not supported.
* The feature is experimental.

* Added data_passing_methods.KubernetesVolume

This class represents a configured volume-based artifact passing method.

* Added PipelineConf.data_passing_method

This property allows setting the method that will be used for intermediate data passing.
Added the compiler support for the new feature.

Example:
```python
from kfp.dsl import PipelineConf, data_passing_methods
from kubernetes.client.models import V1Volume, V1PersistentVolumeClaim
pipeline_conf = PipelineConf()
pipeline_conf.data_passing_method = data_passing_methods.KubernetesVolume(
    volume=V1Volume(
        name='data',
        persistent_volume_claim=V1PersistentVolumeClaim('data-volume'),
    ),
    path_prefix='artifact_data/',
)
```

* Added unit test

* Fixed bug in the unit test

Kubernetes does not validate the structures at all...

* Fixed bug in the result structure

* Fixed the test data

The class should be V1PersistentVolumeClaimVolumeSource, not V1PersistentVolumeClaimSpec.

* Fixed the test
2020-06-25 16:11:31 -07:00
Alexey Volkov 757d43c7fd
SDK - Compiler - Fixed error message (#4053)
Fixes https://github.com/kubeflow/pipelines/issues/4021
2020-06-24 11:42:46 -07:00
Alexey Volkov 374b3b02d2
SDK - Compiler - Made compiler compatible with @wraps (#3956)
Fixes https://github.com/kubeflow/pipelines/issues/3367
2020-06-11 20:03:55 -07:00
Alexey Volkov 40372e5c86
SDK - Compiler - Using properly serialized pipeline parameter defaults (#3832)
* SDK - Compiler - Using properly serialized pipeline parameter defaults

Fixes https://github.com/kubeflow/pipelines/issues/3806

* Sort the keys so that the serialized defaults are stable in python 3.5
2020-06-09 13:10:04 -07:00
Jiaxiao Zheng 1e2b9d4e7e
[SDK] Add first party component label (#3861)
* add OOB component dict and utility function

* add test

* add a transformer, which appends the component name label

* add transformer function, compiler and test

* move telemetry test

* fix none uri

* applies comments

* revert dependency on frozendict

* fixes some tests

* resolve comments
2020-05-29 08:55:16 -07:00
Thi Nguyen ec9445aa01
Allow PipelineParams in dict keys too. (#3565)
Co-authored-by: Thi Nguyen <duongnt@users.noreply.github.com>
2020-05-19 17:54:19 -07:00
Niklas Hansson 05c1537f28
Add Nodeselector to pipelineconfig fix issue #2863 (#3616)
* updated version

* added pipeline nodeselector

* removed old legacy

* renaming

* update test

* Update sdk/python/kfp/compiler/compiler.py
2020-05-05 00:11:08 -07:00