Commit Graph

612 Commits

Author SHA1 Message Date
Chen Sun 26de102f82 chore(release): bumped version to 1.4.0-rc.1 2021-02-01 00:18:50 -08:00
Vitalii Vokhmin 2f1db59798
fix(sdk): compile ParallelFor in a deterministic manner (#4926)
* fix(sdk): compile ParallelFor in a deterministic manner

During compilataion ParallelFor components end up with randomized names,
which makes it very inconvenient to compare two versions of a pipeline.
This commit fixes this issue.

* fix(sdk): fix new parallel-for test cases
2021-01-29 18:31:09 -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
Chen Sun ecb14f40bb
chore(sdk): Remove v2 components fork, use v1 instead. (#5042)
* Remove v2.components fork

* fix setup.py
2021-01-28 18:20:07 -08:00
Chen Sun f906dee88f
chore(sdk): Rename test_source.py to pipeline_source.py to make it compatible with pytest (#5024) 2021-01-22 01:01:27 -08:00
Jiaxiao Zheng 3ee0ae01eb
chore: Resolve comments in #5003 (#5009)
* use pathlib

* fix tests
2021-01-21 09:29:02 -08:00
Jiaxiao Zheng a36a62a700
feat(sdk): Artifact metadata related placeholder for components. (#5003)
* resolve comments.

* fix tests

* wip: add structures and skeleton for component resolution logic

* add generator

* fix the problem

* cleanup

* add a test

* fix tests
2021-01-19 08:57:45 -08:00
Chen Sun 0c600a2cb8
fix(sdk.v2): Fix the bug where pipeline_parameters is not used. (#5002)
* fix bug on pipeline parameters not being used.

* address review comments
2021-01-19 07:59:45 -08:00
Jiaxiao Zheng e0c814451d
chore(sdk): Add annotations for new-styled KFP component (#4989)
* undeprecate and add annotation

* fix the case for missing metadata

* resolve comments

* apply suggestion
2021-01-15 11:17:51 -08:00
Alexey Volkov 691eefc599
fix(sdk): Components - Fixed python components that use \n. Fixes #4939 (#4993)
* SDK - Components - Fixed python components that use \n

The escape sequence was being replaced by the `echo` command.

Apparently, unlike in the `bash` shell, the `echo` command of the `sh` shell expands the escape sequences by default and does not support an option to turn it off. (For some reason the -n option works properly even though it should not).

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

* Fixed the test data

* Fixed the deprecated container component builder

* Fixed the new compiler test case

* Added test
2021-01-14 18:21:51 -08:00
Jiaxiao Zheng 279694ec6d
feat(sdk): Container entrypoint used for new styled KFP component authoring (#4978)
* skeleton

* add entrypoint utils to parse param

* wip: artifact parsing

* add input param artifacts passing and clean unused code

* wip

* add output artifact inspection

* add parameter output

* finish entrypoint implementation

* add entrypoint_utils_test.py

* add entrypoint test

* add entrypoint test

* get rid of tf

* fix test

* fix file location

* fix tests

* fix tests

* resolving comments

* Partially rollback

* resolve comments in entrypoint.py

* resolve comments
2021-01-14 16:01:21 -08:00
Alexey Volkov d629397654
feat(sdk): Components - Support annotations when creating components from python (#4996)
The component specification has always supported component annotations, but there was no way to specify them for the components generated from python. This PR fixes that.
2021-01-14 13:59:31 -08:00
Mansoor Baba Shaik 0a7da2d2db
feat(sdk): Replace logging and print statements with click echo statements for cli (#4622) 2021-01-14 08:41:04 -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
Shu 23c12a9fb4
chore: add instruction detail in _auth.py print statement. Fixes #4987 (#4988)
* Update _auth.py with more instructions

* Update sdk/python/kfp/_auth.py

Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>

Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>
2021-01-13 10:30:36 -08:00
Niklas Hansson c2a8bd0b93
Added checks for parallism values (#4950)
* Added checks for parallism values

* fix variable name
2021-01-08 08:28:55 -08:00
Jiaxiao Zheng a56efb2061
feat(sdk): Merge artifact ontology from v2 to the classic KFP. (#4963)
* move modules back to v1

* move and fix ontology tests
2021-01-07 23:00:53 -08:00
Yang Pan c484cfa46c chore(release): bumped version to 1.3.0 2021-01-07 00:39:26 -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
Jiyong Jung e07ba451af
fix(sdk): fixes typo of 'desc'. (#4938) 2020-12-24 00:38:26 -08:00
Chen Sun a347765630
chore (sdk.v2): Error out on using InputPath placeholder for artifacts require importer. (#4929)
* throw error on importer-inputpath combination

* address review comments
2020-12-22 17:44:27 -08:00
Chen Sun 88dbfda02b
chore(sdk): Add inputUri and outputUri placeholders in v1 (#4913)
* SDK - Components - Added support for inputUri and outputUri placeholders

* remove InputUriSpec and OutputUriSpec

* Address review comments

Co-authored-by: Alexey Volkov <alexey.volkov@ark-kun.com>
2020-12-18 08:28:25 -08:00
Chen Sun 5445ce82c7 chore(release): bumped version to 1.2.0 2020-12-17 23:24:32 -08:00
Ilias Katsakioris 8f70bf325e
fix(sdk): Do not wait for resource deletion (#4820)
When calling the delete() method of a ResourceOp we need to ensure we do
not wait for its deletion.

The reason for this is described in [1]: If a pipeline creates a
resource which is being consumed by its steps (e.g., a PVC), the step
deleting the resource will hang waiting for the Kubernetes resource
deletion which, in turn, is waiting for the other steps to get deleted.
As a result, the pipeline never finishes.

This commit allows specifying flags for the ResourceOp kubectl commands
and defaults to the '--wait=false' flag for the deletion.

Specifying flags for a ResourceTemplate is not supported in Argo v2.7
that we currently deploy. But they will be once we upgrade to v2.11+
[2]. This does not affect the delete() method because we don't rely on
Argo's ResourceTemplate for it.

[1] https://github.com/kubeflow/pipelines/issues/4506
[2] https://github.com/kubeflow/pipelines/issues/4553

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2020-12-17 16:54:24 -08:00
Jiaxiao Zheng 2386471cdf
feat(sdk): Add artifact ontology and migrate compiler utils to onboard artifact types (#4901)
* update

* change get_artifact_type to classmethod

* fix NoneType serialization

* fix tests

* fix compiler cli tests

* fix tests

* resolve comments

* fix tests

* drop schema and metrics classes

* fix tests

* resolve comment

* resolve comment
2020-12-17 10:51:09 -08:00
Yuan (Bob) Gong 44fcda7dca
fix(sdk): make healthz exception visible in logs by default (#4904)
* fix(sdk): make healthz exception visible in logs by default

* only catch exceptions, but not keyboard interrupt

* address comments
2020-12-16 20:29:08 -08:00
Michalina Kotwica 5169489be5
feat(sdk): allow calling GroupOp.after with multiple ops (#4788)
* allow calling ContainerOp.after with multiple ops

* m: simplify signature of OpsGroup.after

as it's not public anyway, chances of calling it with by-keyword
argument are small compared to calling it with unpacking an arbitrary
list, which could be empty (previous signature would fail for empty list)
2020-12-16 15:51:09 -08:00
capri-xiyue 2b718f1bbd
docs(sdk): update comments of _create_job_config (#4899)
* update comments of _create_job_config

* cleand up comments

* fixed comments
2020-12-16 06:16:22 -08:00
Jiaxiao Zheng 7591805377
feat(SDK): adds Artifact base class. (#4895)
* Add base Artifact class

* add __repr__ test

* add __repr__ test

* add serialization

* add serialization tests

* add deserialization tests

* add absl-py

* update requirements

* Resolve comments
2020-12-15 13:18:20 -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
Alexey Volkov 7a66414cf7
feat(sdk): Components - Restored stack traces in lightweight python components. Fixes #4273, #4849 (#4861)
Currently were running the python code inline using `python -c <code>`.
This has two issues:
1) Python does not show source code line in exception stack traces
2) inspect.getsource does not work. This method is used in PyTorch JIT for example.

We solve these issues by writing the code into a file before executing it.

The disadvantage of the new approach is that it adds complexity, a filesystem write operation and also requires the `sh` executable to be present (we could replace it with python-based program if needed).
2020-12-14 14:33:49 -08:00
Vitalii Vokhmin 2f3a686e54
feat(sdk): add ability to set retry policy (#4858)
* feat(sdk): add ability to set retry policy

This fixes the second part of the issue described in #4333
The first part was addressed in #4392

* feat(sdk): validate retry policy name

* feat(sdk): simplify retry policy interface
2020-12-11 14:47:29 -08:00
Chen Sun dc5386e801
chore(release): bump kfp sdk version to 1.1.2 (#4870) 2020-12-04 15:59:25 -08:00
Chen Sun a4807820d5
chore(sdk): v2.components code cleanup (#4737)
* Fix bug where we missed injecting importer node

* moved files

* address review comments

* Add InputUriPlaceholder and OutputUriPlaceholder

* support uri placholder in v2

* lint

* test

* Preserve a test case with inputPath and outputPath usage.

* fix ut

* fix import and setup

* cleanup v2.components

* address comments

* remove InputTextFile, InputBinaryFile, OutputTextFile, OutputBinaryFile

* address review comment
2020-12-04 14:45:26 -08:00
Rui Fang a0a1a5d0cf chore(release): bumped version to 1.1.2-rc.1 2020-12-04 07:09:17 +00:00
Rui Fang 518b8b886d
[Doc] update docs that still refer to KFP latest SDK reference (#4845)
* Initial execution cache

This commit adds initial execution cache service. Including http service
and execution key generation.

* fix master

* fix go.sum

* update docs that still refer to KFP latest SDK reference
2020-12-02 20:02:59 -08:00
Chen Sun 03904ebacd
chore(sdk.v2): Error out on invalid pipeline name (#4851) 2020-12-01 14:36:51 -08:00
hilcj c1aebb5d22 chore(release): bumped version to 1.1.1-beta.1 2020-11-26 17:58:04 +00:00
hilcj 4fe4a30545 Revert "chore(release): bumped version to 1.1.1-beta.1"
This reverts commit 9af3e79c10.
2020-11-26 16:10:10 +00:00
hilcj 9af3e79c10 chore(release): bumped version to 1.1.1-beta.1 2020-11-26 04:32:09 +00:00
hilcj bd86072a8c Revert "chore(release): bumped version to 1.1.1.beta.1"
This reverts commit 5928a2659b.
2020-11-26 04:20:10 +00:00
hilcj 5928a2659b chore(release): bumped version to 1.1.1.beta.1 2020-11-26 03:07:26 +00:00
DavidSpek 0df9473bba
feat: Set current namespace for in-cluster SDK in multi-user mode and add healthz endpoint to API backends (#4638)
* Set current namespace in local KFP context if running from notebook

* Create "~/.config/kfp/" instead of ".config/kfp/"

At first it was assumed the `get_user_namespace` command would be executed from the home directory.

* Create local context file if it doesn't exist during set_user_namespace

* Grab path from LOCAL_KFP_CONTEXT when creating folder

Instead of harcoding the os.mkdirs path to `~/.config/kfp` it now grabs it from the LOCAL_KFP_CONTEXT. Also, removed path creation in `get_user_namespace` as that is now handled in `set_user_namespace`. Also, it now checks if the path exists rather than the local_context_file to remove the situation where it tries to create ~/.config/kfp/ because the context.json doesn't exist when the path does.

* add multi-user setting to healthz api

* Add http prefix to health api url

* move healtz api call to own function and fix multi_user boolean

* Fix HEALTH_PATH declaration

* Move check to Client __init__ and change get_kfp_healthz to avoid breaking in case of old apiserver image

* Add multi_user to frontend healthz

* Expose multi_user in frontend and add integration test

* Fix integration test

* Fix host hardcoding and error handling

* Handle empty API response, check if API up to date

* Fix response return

* remove API check due to empty response

* retry API call if first response empty

* retry getting healthz api if no response

* change health_api to https

The healthz_api has been returning empty responses which might be caused by sending an http request to an https endpoint. Although requests handles redirects, this commit is to test if this solves the issue.

* Add some debug info to healthz exception

* add url to debug and lower retries to 1

* Use api_client to get healthz data

* Debug info for API response

* Follow API redirect history

* Fix indentation

* Add healthz proto

* Try getting healthz api with new python backend

* Add installation of kfp_server_api in tests

* Fix incorrect setup location

* Replace old .get with new http backend .multi_user

* Code clean up

* Small fixes and TimeOutError for retries healthz api

* Remove changes to go dependencies

* Send empty proto request and fix exception client

* Remove unused commit_sha and tag_name
2020-11-24 15:36:39 -08:00
Chen Sun 6b8bd4c7ab
chore(sdk.v2): Support explicit task dependency (#4824) 2020-11-24 12:10:40 -08:00
Chen Sun 6931fe84f5
chore(sdk.v2): Allow component to be reused in a pipeline (#4784)
* Allow component to be reused in a pipeline

* cleanup

* cleanup

* fix missing test
2020-11-24 11:26:40 -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 ab21ec9845
feat(sdk): Client - Getting access token without gcloud CLI (#4811) 2020-11-23 01:03:35 -08:00
Alexey Volkov 5c1b919793
fix(sdk): Client - Fixed wait_for_run_completion (#4808)
The default timeout value is of type timedelta which cannot be compared with a plain number later in the code.
Also replaced time_delta.seconds with time_delta.total_seconds() which gives out correct value.
2020-11-22 15:19:34 -08:00
David Przybilla 5f992f5d06
fix(sdk): VolumeOp has apiVersion as parameter (#4694) 2020-11-21 03:05:33 -08:00