Commit Graph

42 Commits

Author SHA1 Message Date
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 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
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
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
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
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
Alexey Volkov cc83e1089b
Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
Ajay Gopinathan 5651bd1efd
feat(v2): Support v2 components in KFP v2-compatible mode. (#5458)
* Support v2 components in KFP v2-compatible mode.

Adds support in v2-compatible mode for the following
* v2 lightweight function components
* support for passing ExecutorInput to component
* support for parsing ExecutorOutput from component

Also renamed several variables in RuntimeInfo as follow ups to previous
PR.

* Remove newly irrelevant variables in runtimeInfo

* update goldens.

* Renaming in runtimeInfo.

* Add v2 component pipeline tests and update goldens.

* create output directory for parameter files.

* Fix output schemas.

* Support concat placeholder.

* Use Path and MetadataPath

* update launcher.go too with new names.

* move functions around.

* add some TODOs, replace cmd placeholder.

* fix tests
2021-04-15 17:44:13 -07: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
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
Alexey Volkov 80e1d7063d
fix(sdk): Fixed UI metadata and metrics (#4672)
Reverting most of the #2334 which inadvertently broke those artifacts by causing the names to be mangled.

KFP's DSL compiler prepends template names to output names to ensure global uniqueness of *input* names (DSL's ContainerOp does not have concept of inputs, so the inputs are generated during the compilation including input names). But prepending template names to the output names stops the backend from recognizing the mlpipeline-ui-metadata and mlpipeline-metrics artifacts.
2020-10-25 19:37:00 -07:00
Alexey Volkov e8fb58a221
feat(sdk): Preserve parameter arguments and input names (#4563)
ContainerOp has no concept of inputs, so it looses any information about them such as input names and in some cases even the passed argument values (which are just injected into the command line).
This commit fixes that issue by preserving the paramater arguments map and ultimately storing it in an Argo template annotation.

Fixes https://github.com/kubeflow/pipelines/issues/4556
2020-10-11 20:32:48 -07:00
Alexey Volkov d87c3be611
DEPRECATE(sdk): DSL - Deprecated output_artifact_paths parameter in ContainerOp constructor (#2334)
The users should switch to file_outputs instead.
Previously `file_outputs` only supported small data outputs, but now it supports big files.
2020-08-07 21:44:19 -07:00
Alexey Volkov db0af86e53
feat(sdk): SDK - Enable placeholders in task display names. Fixes #4163 (#4164) 2020-07-09 18:42:35 -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
Alexey Volkov 8ba366b03f
SDK - Made outputs with original names available in ContainerOp.outputs (#3734)
* SDK - Made outputs with original names available in ContainerOp.outputs

Previously, ContainerOp had strict requirements for the output names, so we had to convert all the names before passing them to the ContainerOp constructor. Outputs with non-pythonic names could not be accessed using their original names.
Now ContainerOp supports any output names, so we're now using the original output names.
However to support legacy pipelines, we're also adding output references with pythonic names.

* Fixed the compiler test data

* Fixed the duplicate parameter outputs in the compiled workflow

* Fixed long line

* Stabilized the output naming conflict resolution

* Fix case of missing special outputs
2020-05-12 19:08:26 -07:00
Alexey Volkov 2279bde698
SDK - Annotate pods with component_ref (#3727)
* SDK - Annotate pods with component_ref

This preserves the information about the digest of the component and the location from which the component was loaded.

* Fixed compiler tests
2020-05-11 17:18:21 -07:00
Alexey Volkov b63ad7e614
SDK - Removed the ArtifactLocation feature (#3517)
* SDK - Removed the ArtifactLocation feature

The feature was deprecated in v0.1.34 https://github.com/kubeflow/pipelines/pull/2326

* Removed the artifact_location sample
2020-04-23 00:49:44 -07:00
Alexey Volkov 95aec25db4
SDK - Support kubernetes client v11 (#3319)
Fixes https://github.com/kubeflow/pipelines/issues/3275
2020-03-22 02:54:44 -07:00
Alexey Volkov 734b43e3db
SDK - Added support for maxCacheStaleness (#3318)
* SDK - Added support for maxCacheStaleness

* Added the vendor prefix to the annotation
2020-03-20 13:38:09 -07:00
Alexey Volkov 735e627a03 SDK - Refactoring - Split the K8sHelper class (#2333)
* SDK - Refactoring - Split the K8sHelper class

One part was only used by container builder and provided higher-level API over K8s Client.
Another was used by the compiler and did not use the kubernetes library.

* Updated the license year.
2019-10-21 14:57:22 -07:00
Alexey Volkov 132940be45 SDK - Compiler - Added the component spec annotations to the compiled workflow (#2323)
Currently most of the component spec information (original input/output names, types, descriptions) is lost during the compilation.
This change adds that data to the workflow as annotation.
This will make it possible for the Frontend (and other services) to get the full component specs information and use it to improve the UX.
2019-10-07 19:31:11 -07:00
Alexey Volkov 181de66cf9 SDK - Compiler - Move Argo volume specifications to templates (#2229)
* SDK - Compiler - Move volumes to templates

Argo v2.3.0+ supports per-template volume specs similiar to Kubernetes. Prior to version 2.3.0 Argo only supported workflow-level volume specs.
We had several outstanding issues caused by the need to put all volumes in the same place.
There was also the issue with input parameter reference placeholders in volume specifications which were placed outside their home templates declaring the inputs.

 This change fixes those issues.

* Removed dead code line
2019-10-07 16:55:12 -07:00
Alexey Volkov e3c72fc251 SDK - Persisting all output values (#2134)
Currently, the parameter output values are not saved to storage and their values are lost as soon as garbage collector removes the workflow object.
This change makes is so the parameter output values are persisted.
2019-09-16 19:44:24 -07:00
Alexey Volkov 5360f3fcab SDK - Compiler - Stopped adding mlpipeline artifacts to every compiled template (#2046)
* Explicitly added mlpipeline outputs to the components that actually produce them

* Updated samples

* SDK - DSL - Stopped adding mlpipeline artifacts to every compiled template
Fixes https://github.com/kubeflow/pipelines/issues/1421
Fixes https://github.com/kubeflow/pipelines/issues/1422

* Updated the Lighweight sample

* Updated the compiler tests

* Fixed the lightweight sample

* Reverted the change to one contrib/samples/openvino
The sample will still work fine as it is now.
I'll add the change to that file as a separate PR.
2019-09-05 17:56:57 -07:00
Alexey Volkov f911742d1a SDK - Compiler - Fixed handling of PipelineParams in artifact arguments (#2042)
Previously only constant strings were supported and serialized PipelineParams were not resolved, producing incorrect workflows.
2019-09-05 15:16:58 -07:00
Alexey Volkov 0fc68bbdd4 SDK - Added support for raw input artifact argument values to ContainerOp (#791)
* SDK - Added support for raw artifact values to ContainerOp

* `ContainerOp` now gets artifact artguments from command line instead of the constructor.

* Added back input_artifact_arguments to the ContainerOp constructor.
In some scenarios it's hard to provide the artifact arguments through the `command` list when it already has resolved artifact paths.

* Exporting InputArtifactArgument from kfp.dsl

* Updated the sample

* Properly passing artifact arguments as task arguments
as opposed to default input values.

* Renamed input_artifact_arguments to artifact_arguments to reduce confusion

* Renamed InputArtifactArgument to InputArgumentPath
Also renamed input_artifact_arguments to artifact_argument_paths in the ContainerOp's constructor

* Replaced getattr with isinstance checks.
getattr is too fragile and can be broken by renames.

* Fixed the type annotations

* Unlocked the input artifact support in components
Added the test_input_path_placeholder_with_constant_argument test
2019-08-28 21:09:57 -07:00
Kevin Bache 96fd19356c WithItems Support (#1868)
* hacking

* hacking 2

* moved withitems to opsgroup

* basic loop test working

* fixed nested loop bug, added tests

* cleanup

* gitignore; compiler tests

* cleanup

* tests fixup

* removed format strings

* removed uuid override from test

* cleanup

* responding to comments

* removed compiler withitems test

* removed pipeline param typemeta
2019-08-23 21:00:28 -07:00
Hamed 55d62fe9fd Support Affinity for ContainerOps (#1886) 2019-08-22 17:09:18 -07:00
IronPan 8bc464409b add init container for container op (#1650)
* add init container

* update test

* update tests

* address comments
2019-07-22 20:40:54 -07:00
Alexey Volkov cd0aeb6c62 SDK+Frontend - Fixed the task display name annotation key (#1526)
Turns out, Kubernetes only allows a single slash character in annotation key.
2019-06-18 14:50:33 -07:00
Ning 5061fcffcf
Add timeout out in dsl (#1465)
* add timeout in dsl
* add pipeline level timeout
2019-06-06 17:42:10 -07:00
Alexey Volkov 7d69cda69c
Frontend - Show customized task display names (#1463)
* Frontend - Show customized task display names

* Added customized name test

* Added ContainerOp.set_display_name(name) method

* Stopped writing human_name to display_name annotation for now
Reason: It's a change to existing pipelines.

* Added test for op.set_display_name

* Fix for tests that have workflows with status nodes, but without any spec or templates

* Fixed the test workflow

* Fix linter error
Error: "The key 'metadata' is not sorted alphabetically"
2019-06-06 17:36:32 -07:00
Eterna2 91d941d6e5 [Feature] Supports parameterized S3Artifactory for Pipeline and ContainerOp in kfp package (#1064)
* kfp can declare custom artifact location in pipeline and containerop.

* Removed default artifact location

* Minor fixes
2019-05-14 19:48:20 -07:00
Alexey Volkov be4e56a247 SDK - Stopped hard-coding artifact storage configuration in the pipeline packages (#1297)
We should follow Argo's prefferred way to configure the artifact storage: https://github.com/argoproj/argo/blob/master/ARTIFACT_REPO.md#configure-the-default-artifact-repository and use a cluster-local configMap. This way the pipelines remain clean and portable: https://github.com/argoproj/argo/blob/master/examples/artifact-passing.yaml
Kubeflow deployer has already been pre-installing the configMap for several months: https://github.com/kubeflow/kubeflow/pull/2238
2019-05-13 17:29:08 -07:00
Hamed ce6066136d support tolerations for ContainerOps (#1269)
* add tolerations to ContainerOps

* add test

* add type for tolerations

* remove fix

* remove print
2019-05-09 16:37:59 -07:00
Alexey Volkov 6b0d4d13e7 Marking the UI-metadata and Metrics artifacts as optional (#1260)
* Marking the UI-metadata and Metrics artifacts as optional

* Updated the compiler tests

* Updates one more test.
2019-04-29 17:27:37 -07:00
Tommy Li bb0a5e36f6 Parameterize the artifact path for mlpipeline ui-metadata and metrics (#998)
* parameterize artifact path for ui-metadata and metrics

* change output_artifact_paths as containerops args

* change output_artifact_paths default args to None
2019-04-25 12:08:34 -07:00
Ilias Katsakioris 07cb50ee0c Extend the DSL to implement the design of #801 (#926)
* SDK: Create BaseOp class

* BaseOp class is the base class for any Argo Template type
* ContainerOp derives from BaseOp
* Rename dependent_names to deps

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: In preparation for the new feature ResourceOps (#801)

* Add cops attributes to Pipeline. This is a dict having all the
  ContainerOps of the pipeline.
* Set some processing in _op_to_template as ContainerOp specific

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: Simplify the consumption of Volumes by ContainerOps

Add `pvolumes` argument and attribute to ContainerOp. It is a dict
having mount paths as keys and V1Volumes as values. These are added to
the pipeline and mounted by the container of the ContainerOp.

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: Add ResourceOp

* ResourceOp is the SDK's equivalent for Argo's resource template
* Add rops attribute to Pipeline: Dictionary containing ResourceOps
* Extend _op_to_template to produce the template for ResourceOps
* Use processed_op instead of op everywhere in _op_to_template()
* Add samples/resourceop/resourceop_basic.py
* Add tests/dsl/resource_op_tests.py
* Extend tests/compiler/compiler_tests.py

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: Simplify the creation of PersistentVolumeClaim instances

* Add VolumeOp: A specified ResourceOp for PVC creation
* Add samples/resourceops/volumeop_basic.py
* Add tests/dsl/volume_op_tests.py
* Extend tests/compiler/compiler_tests.py

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: Emit a V1Volume as `.volume` from dsl.VolumeOp

* Extend VolumeOp so it outputs a `.volume` attribute ready to be
  consumed by the `pvolumes` argument to ContainerOp's constructor
* Update samples/resourceop/volumeop_basic.py
* Extend tests/dsl/volume_op_tests.py
* Update tests/compiler/compiler_tests.py

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: Add PipelineVolume

* PipelineVolume inherits from V1Volume and it comes with its own set of
  KFP-specific dependencies. It is aligned with how PipelineParam
  instances are used. I.e. consuming a PipelineVolume leads to implicit
  dependencies without the user having to call the `.after()` method on
  a ContainerOp.
* PipelineVolume comes with its own `.after()` method, which can be used
  to append extra dependencies to the instance.
* Extend ContainerOp to handle PipelineVolume deps
* Set `.volume` attribute of VolumeOp to be a PipelineVolume instead
* Add samples/resourceops/volumeop_{parallel,dag,sequential}.py
* Fix tests/dsl/volume_op_tests.py
* Add tests/dsl/pipeline_volume_tests.py
* Extend tests/compiler/compiler_tests.py

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* SDK: Simplify the creation of VolumeSnapshot instances

* VolumeSnapshotOp: A specified ResourceOp for VolumeSnapshot creation
* Add samples/resourceops/volume_snapshotop_{sequential,rokurl}.py
* Add tests/dsl/volume_snapshotop_tests.py
* Extend tests/compiler/compiler_tests.py

NOTE: VolumeSnapshots is an Alpha feature at the time of this commit.

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* Extend UI for the ResourceOp and Volumes feature of the Compiler

* Add VolumeMounts tab/entry (Run/Pipeline view)
* Add Manifest tab/entry (Run/Pipeline view)
* Add & Extend tests
* Update tests snapshot files

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>

* Cleaning up the diff (before moving things back)

* Renamed op.deps back to op.dependent_names

* Moved Container, Sidecar and BaseOp classed back to _container_op.py
This way the diff is much smaller and more understandable. We can always split or refactor the file later. Refactorings should not be mixed with genuine changes.
2019-04-25 10:40:48 -07:00
Alexey Volkov 0a086170a2 Stabilized the artifact ordering during the compilation (#1097) 2019-04-08 18:17:04 -07:00
Alexey Volkov 9269bac716
SDK - Configure artifact name and path separately (again) (#1067)
Restoring the https://github.com/kubeflow/pipelines/pull/900 change that was overwritten by https://github.com/kubeflow/pipelines/pull/879
2019-04-04 14:31:13 -07:00
Eterna2 825f64d672 Feature: sidecar for ContainerOp (#879)
* Feature: sidecar for ContainerOp

* replace f-string with string format for compatibility with py3.5

* ContainerOp now can be updated with any k8s V1Container attributes as well as sidecars with Sidecar class. ContainerOp accepts PipelineParam in any valid k8 properties.

* WIP: fix conflicts and bugs with recent master. TODO: more complex template with pipeline params

* fix proxy args

* Fixed to work with latest master head

* Added container_kwargs to ContainerOp to pass in k8s container kwargs

* Fix comment bug, updated with example in ContainerOp docstring

* fix copyright year

* expose match_serialized_pipelineparam as public for compiler to process serialized pipeline params

* fixed pydoc example and removed unnecessary ContainerOp.container.parent

* Fix conflicts in compiler tests
2019-03-28 11:11:30 -07:00