Commit Graph

321 Commits

Author SHA1 Message Date
Connor McCarthy 13736b85b6
chore(sdk): clean up kfp code style (#8027)
* remove unused imports

* use google as isort profile

* sort imports

* format with yapf

* clean end of file new line, trailing whitespace, double quoted strings
2022-07-15 00:06:34 +00:00
Connor McCarthy 4621aec146
chore(sdk): apply yapf formatting (#7414) 2022-03-16 20:34:36 +00:00
Yaqi Ji 8bb0d0e025
feat(sdk)!: move v2 to main namespace (#7376)
* feat(sdk)!: move v2 to main namespace

* edit samples
2022-03-04 21:56:51 +00:00
Yaqi Ji b693909a08
feat(sdk)!: move v1 to deprecated folder (#7291)
* chore(sdk): move v1 to deprecated

* fix testsg

* fix testsg

* fix setup.py

* fix test

* s'

* fix tests

* fix test

* retore v2 test changes

* fix py3.6 test

* fix py3.6 test

* fix py3.6 import fallback error

* remove deprecated

* fix samples test

* sample test

* fix samples

* add readme

* restroe test

* python require

* remove path

* fix tests

* inteegration tests

* remove tfx tests for dependency with kfp v1

* fix e2e

* fix e2e

* fix integration tests

* fix sampe

* move client down

* change to kfp

* add import alias

* fix

* runid

* fix dsl

* only use kfp for function

* revert train_until_good

* tfx test

* kfp

* try import

* onprem
2022-03-04 00:52:59 +00:00
Seb 577902ca46
fix(sdk): Support per workflow TTL (ttl_seconds_after_finished) with new format of Argo workflow manifest (#7141)
* Support per workflow TTL (ttl_seconds_after_finished) with new format of Argo workflow manifest

* Update test for TTL

* Declare fix in release note of SDK

* update syntaxe

* Update RELEASE.md

Add Braking change due to incompatibility with  KFP pre 1.7 due to Argo 2.X
2022-01-20 00:43:52 +00:00
Chen Sun 8aee62142a
feat(sdk)!: Deprecate V2 compatible mode in v1 compiler (#6958)
* Deprecate V2 compatible mode in v1 compiler

* release note

* fix tests
2021-11-24 22:11:34 +00:00
Yaqi Ji c4d8dfd8c6
feat(sdk): ImporterSpec v2 (#6917)
* importer

* compiler

* check diff

* fix format

* remove v1 node test

* remove importer v2 compat test

* release note

* address comments
2021-11-18 23:11:32 +00:00
juliusvonkohout b482ba83d8
fix(sdk): visualizations and metrics do not work with data_passing_methods (#6882)
* Update _data_passing_using_volume.py

* Update _data_passing_using_volume.py

* Update _data_passing_using_volume.py

* Update _data_passing_using_volume.py

* Update _data_passing_using_volume.py

* Update artifact_passing_using_volume.yaml

* Update artifact_passing_using_volume.py

* Update _data_passing_using_volume.py
2021-11-16 01:33:12 +00:00
Lin Yiming 36e627d28f
feat(sdk): Local runner supports additional docker options. Fixes #6598 (#6599)
* bump kfp-pipeline-spec to 0.1.11, tests for local runner will fail with kfp-pipeline-spec 0.1.9

* Local client supports additional docker options

* Format _local_client.py using yapf

* Add release note that local runner supports additional docker options
2021-09-24 07:58:37 -07:00
Judah Rand 8c470f324d
chore(sdk): fix sdk/python/tests/run_tests.sh to run all the tests in the folder. (#6543) 2021-09-13 17:08:31 -07:00
Niklas Hansson 343350a5f3
fix(sdk): podSpecPatch bug. Fixes 6512 (#6514)
* Fix podSpecPatch bug

* wrong structure for nodeselector and bring back integreation test

* updated python compiler test

* updated to use the correct GPU type

* missed to commit the updated test config

* Updated release notes

* remove test to see if it solved the issue
2021-09-09 15:26:51 -07:00
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
Joshua Carp f43ecc223d
chore(sdk): Import mock from stdlib and drop dependency. (#6456)
* Import mock from stdlib and drop dependency.

* Drop mock from requirements.

h/t @chensun
2021-08-31 16:38:44 -07:00
Yaqi Ji 937cacd4ce
feat(sdk): add default schema_version to pipeline (#6366)
* feat(sdk): add default schema_version to pipeline

* sync api for go

* Fix tests and address comments

* Bump pipeline_spec version

* Fix v1 tests

* rebase to master

* sync api for go

* Fix tests and address comments

* Bump pipeline_spec version

* Fix v1 tests
2021-08-24 01:04:39 -07:00
Ajay Gopinathan f3f383c2ff
chore(sdk): Refactor and move all v2 related code to under the v2 namespace. (#6358)
* Refactor and move all v2 related code to under the v2 namespace.

Most of the changes are around imports and restructuring of the
codebase. While it looks like a lot of code was added, most of the code
already existed and was simply moved or copied over to v2. The only
exceptions are:
- under kfp/v2/components/component_factory.py: some helper functions
  were copied with simplification from _python_op.py
- we no longer strip the `_path` suffix in v2 components.

Note: there is still some duplication of code (particularly between
component_factory.py and _python_op.py), but it's ok for now since we
intend to replace some of this with v2 ComponentSpec + BaseComponent.

* Update setup.py.

* update tests.

* revert accidental change of gcpc

* Fix component entrypoint.

* Update goldens.

* fix tests.

* fix merge conflict.

* revert gcpc change.

* fix tests.

* fix tests.

* Add type aliases for moved files.

* merge and update goldens.
2021-08-17 19:25:37 -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
Chen Sun 7559e27cfb
feat(backend/sdk): Rename `pipeline-output-directory` to `pipeline-root`. Fixes #6307 (#6329) 2021-08-13 00:41:54 -07:00
Chen Sun d48792c373
test(sdk): restore a v2-compatible unit test (#6263) 2021-08-09 11:18:23 -07:00
Niklas Hansson e6becd71ff
feat(sdk): add GPU runtime resource request and fix spelling in runtime_resouce_request. Fixes #4877. Fixes #1252 (#5972)
* Add runtime resource request for GPUs

* clean up

* Updated docks and add check

* updated with test

* remove from branch

* run tests

* fix gpu vendor format

* Update after feedback

* add unit tet

* remove integration test

* clean up

* Clean up

* Updated to resource_constraints instead of resource
2021-08-01 22:52:38 -07:00
Chen Sun f4c6631e51
chore: release KFP SDK and v2 launcher 1.6.6 (#6125)
* release 1.6.6

* skip failing UT
2021-07-23 14:49:39 -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
Yuan (Bob) Gong ee663d9593
chore(v2): standardize MLMD data model. Fixes #5669 (#6054)
* chore(v2): standardize MLMD data model

* change context type to system namespace

* update sdk snapshots

* fix go v2 tests

* update

* update v2 compat snapshots

* fix all samples

* fix must specify pipeline root

* add artifact display name

* add UI rendering of new fields

* fix sample tests

* let ui read artifact and execution names consistently

* fix samples

* fix frontend tests

* fix sample test

* fix last sample

* address feedback
2021-07-19 22:26:15 -07:00
Yaqi Ji c6cb8acf7a
feat(sdk): Add interface for enable_caching at task level. (#6007)
* feat(sdk): Add pipeline level caching options

* Update golden

* fixing caching options

* fix tests

* add a caching disabled case

Co-authored-by: Chen Sun <chensun@users.noreply.github.com>
2021-07-13 17:33:58 -07:00
Joe Liedtke ade34542e0
chore: Updates argoproj/argo URLs to argoproj/argo-workflows (#5969)
* Updt argoproj/argo URLs to argoproj/argo-workflows

* Update link to workflows.ts

* Update license.txt to reduce # of changed lines

* Revert changes to backend Dockerfile & license.txt

* Update license.txt, keep line endings
2021-07-06 21:52:20 -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
Niklas Hansson 5db843102a
feat(sdk): add runtime resource requests. Fixes #1956 (#5447)
* added resource request at runtime

* fixed things

* Update to use read only parameter insteadt

* added test case and better example

* Updated again

* add the validation

* add to the test suit

* work in progress

* update after feedback

* fix the test

* clean up

* clean up

* fix the path

* add the test again

* clean up

* fix tests

* feedback fix

* comment out and clean up
2021-06-10 16:27:59 -07:00
Chen Sun 58f74d3347
feat(sdk): special handling for type annotation using `typing.Optional` (#5716)
* handle type annotation with Optional

* remove typing._GenericAlias, which is available only after Py 3.7

* fix

* fix py3.6 test

* address review comments
2021-05-25 06:57:09 -07:00
Chen Sun b7084f2906
fix(sdk.v2): fix a small bug in `io_types.is_artifact_annotation()` (#5699)
* fix is_artifact_annotation

* move tests
2021-05-19 15:58:46 -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
Ajay Gopinathan b46f1b86f1
fix(sdk): Update syntax for lightweight components v2. (#5568)
* Update syntax for lightweight components v2.

Use Input[T] and Output[T] for representing input/output artifacts
of type T. This enables users to see these annotations as merely the
classes T, enabling autocompletion, reducing verbosity and simplifying
I/O types code. Users also no longer

Other changes include:
- no longer need to use .get() to obtain the artifact class
- no auto-creation of the `data` file for output artifacts. This enables
  artifacts to be either directories or files.

* fix for Py 3.6

* Remove stray file.

* Add error message if Input/Output are used with non Artifact types.

* Fix e2e test.
2021-04-29 19:27:30 -07:00
Ajay Gopinathan 55c14ccb2d
fix(sdk): Minor API fixes to Metrics classes. (#5494)
* Minor updates to Metrics classes.

* update goldens.

* fix tests.
2021-04-15 22:31:13 -07:00
Chen Sun 1a357a0ebe
chore(sdk.v2): Deprecate dsl.ontology_artifacts, and migrate to using dsl.io_types (#5472)
* merge ontology_artifacts to io_types

* remove tests importing ontology_artifacts

* fix tests
2021-04-15 21:38:13 -07:00
dushyanthsc 2c68229920
Fixes the Confusion Matrix storage format (#5463)
This change fixes the Confusion Matrix storage format to strictly adhere
with the schema type checking if supported.
2021-04-13 11:23:11 -07:00
Chen Sun a80421191d
feat(sdk.v2): surface metrics output artifacts to pipeline outputs (#5445)
* populates metrics outputs in root

* avoid kfp import in io_types.py

* populates outputs following the right path
2021-04-09 16:37:04 -07:00
Alexey Volkov ba3a92f6d0
chore(sdk): Refactored command-line resolving (#5379)
* SDK - Refactored command-line resolving

Moved the execution engine specific code to the component bridge.

* Added placeholder_resolver

This simplifies adding custom placeholder resolving logic.
2021-04-09 13:44:03 -07:00
dushyanthsc 0e7e543694
Adds classification metrics type to io_types (#5387)
Change to add support for Classification Metrics to io_types.

Also udpates IO types type_name from kfp. to system.
2021-03-30 20:46:18 -07:00
Asei Sugiyama d8028c5d9e
Fix(sdk): Enable FutureWarning with PipelineParam. Fix #5280 (#5299)
* init

* Update type annotation.

Arguments can be String, Integer, Float, Bool and PipelineParam passed from pipeline.

* Fix type annotation consistently.

* Add unit test.

* Fix unit test case.

* Fix after review, simplify by converting arguments and command to lists of str.
2021-03-30 02:56:17 -07:00
Alexey Volkov d0cbca7629
fix(sdk): Local runner - Fixed the local runner on Windows (#5313)
Sume of the fixed issues could also affect Linux OSes.
2021-03-18 23:19:16 -07:00
Chen Sun 0d2a341bad
chore(sdk): fix metrics schema title, and missing mapping (#5317)
* fix metrics schema title, and missing mapping

* fix tests

* fix tests
2021-03-18 12:19:16 -07:00
Ilias Katsakioris a12e88d1da
feat(sdk): Enable setting OwnerReference on ResourceOps. Fixes #1779 (#4831)
Argo supports a field in the ResourceTemplate that makes the controller
add an owner reference of the workflow to the created resource since
v2.4.0 [1].
With the upgrade of Argo client [2] and deployment [3] we are now able
to exploit it.

We set it to 'false' by default on all ResourceOps (actually, leave it
empty).

Setting the field to 'true' for VolumeOps allows the garbage collection
of PVCs upon workflow cleanup [4].

[1] https://github.com/argoproj/argo/blob/v2.4.0/pkg/apis/workflow/v1alpha1/workflow_types.go#L1044-L1045
[2] https://github.com/kubeflow/pipelines/pull/4498
[3] https://github.com/kubeflow/pipelines/pull/3537
[4] https://github.com/kubeflow/pipelines/issues/1779

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2021-03-12 06:45:24 -08:00
dushyanthsc 2323568267
feat(sdk): Adds Metrics & ClassificationMetrics ontology types (#5259)
Adds Metrics, ClassificationMetrics SlicedClassificationMetrics to ontology types.
Common methods used by helper metric classes and Artifact class are moved to
_artifact_utils.py
2021-03-12 03:19:24 -08:00
Tommy Li 9708a2ae0f
fix(sdk/tests) fix parallelfor_item_argument_resolving compiler test, Fixes #5270 (#5271)
* fix parallelfor_item_argument testdata typo

* remove parentheses instead of brackets
2021-03-11 14:06:24 -08: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
dushyanthsc 3e55bd3637
Artifact class update to support protobuf Struct (#5197)
Change updates dsl Artifact class to support protobuff based metadata
removing existing implementation that uses properties/custom_properties
to handle metadata.

This change modifies the ontology artifacts with enhanced schemas for
model and datasets.
2021-03-03 16:14:48 -08:00
StefanoFioravanzo fa135fc0bc
feat(sdk): Support backoffs in retry strategy (#5060)
* feat(sdk): Support backoffs in retry strategy

Signed-off-by: Stefano Fioravanzo <stefano@arrikto.com>

* Add Optional type hint

Signed-off-by: Stefano Fioravanzo <stefano@arrikto.com>
2021-03-03 03:59:48 -08:00
Chen Sun 45c5c18716
fix(tests): Disable the SDK unittest that requires docker binary in local environment. (#5211) 2021-02-28 22:42:34 -08:00
Jiaxiao Zheng ec7201db5a
feat(sdk.v2): Implement AI Platform (Unified) Custom job component in KFP v2 SDK (#5146)
* code skeleton

* wip

* add param scaffold

* add param scaffold

* wip: add new DSL class for AiPlatformCustomJob

* wip: play with container op i/o

* wip

* wip

* enhance get_parameter_type

* add tests

* add get_ir_type and tests

* add get_ir_type and tests

* wip: implementing get_custom_job, without IO

* add op IO

* clean up

* fix issues in aiplatform module

* cmd/arg resolution

* fix

* fix nonetyped cmds

* revert _structures

* revert component_tests

* revert component_bridge

* add basic tests

* add an e2e test

* fix tests

* resolve comments.

* fix test

* fix test
2021-02-24 17:18:15 -08:00
Lin Yiming 8af15a3ad0
feat(sdk): Add local runner which will run ops in docker or locally. Fixes #1138 (#4983)
* add local runner which will run ops in docker or locally

* use str.format rather than f-string

* add some brief doc string in local client

* comment the unittest about running op in docker, which is not supported in CI env for now

* Add some brief docstring about DAG used in local client

* make graph/reverse_graph of DAG as property to keep them in sync

* make some methods of LocalClient static

* remove circular reference in local client

* Incapsulate artifact storage root in the constuctor of LocalClient

* Add Alpha notice for kfp.run_pipeline_func_locally

* Support list of local images in kfp.run_pipeline_func_locally

* make staticmethod to module level private method

* Trivial modification according to code review, some renaming or docstring

* local runner support components without '--' as argument prefix

* make output file of op in loop unique

* Local runner decides whether run component in docker or in local process base on ExecutionMode
2021-02-23 21:07:14 -08:00