Commit Graph

195 Commits

Author SHA1 Message Date
IronPan 7447eb3dab update DSL client documentation (#1403)
* update DSL client documentation

* Update _client.py
2019-05-30 21:40:26 -07:00
IronPan 511c10c2f3 Fix auto generated resource link for DSL (#1400)
In case of IAP endpoint, the prefix is https instead of http. without the change the link will be resolved into 
http://https://foo.endpoints.bar.cloud.goog/pipeline
/assign @Ark-kun @hongye-sun
2019-05-30 09:42:24 -07:00
Alexey Volkov 9a1d47a185 SDK - Capturing function dependencies when creating lightweight components (#1372)
* Transitively capturing code dependencies
Using cloudpickle.

* Got rid of func_type_declarations_code variable

* Extracted the function code extraction functions

* Improved support for capturing module-level dependencies

* Added test for capturing module-level dependencies

* Removed the _capture_function_code_using_source_copy function
As requested by Ning
2019-05-28 18:18:18 -07:00
IronPan 02313e4e5e Cleanup Kaniko code (#1394)
/assign @gaoning777 @Ark-kun
2019-05-28 16:46:17 -07:00
Alexey Volkov 2a9bbdf120 SDK/Compiler - Added the ability to apply a function to all ops in a pipeline (#1209)
* SDK/Compiler - Added op and template transformers
They can be used to apply some functions (e.g. to add secrets) to all pipeline ops.

* Removed the template_transformers for now

* Moved the op_transformers to PipelineConf

* Added op_transformers test
2019-05-22 19:48:23 -07:00
Alexey Volkov f4436c2ab9 SDK - Added Argo to requirements.txt (#1367) 2019-05-22 14:40:28 -07:00
eldar nugaev d160425fc6 Fix docstring for _ops_group Condition (#1356)
A fix of a docstring
2019-05-21 19:46:02 -07:00
Alexey Volkov f419b9be53 SDK/DSL - ContainerOp.apply method now supports functions that do not return anything (#1226) 2019-05-21 10:24:10 -07:00
Alexey Volkov 329e8a50f0 Added the auto-generated python SDK docs (#1256)
* Added Python API reference docs

* Switched to the RTD theme

* Imporved the documentation

* Improved the docs

* Simplified the generator files

* Added sdk/python/requirements.txt

* Added licenses

* Added more information and comments to the conf.py file

* Added kfp.aws

* Fixed typos

* Removed the header

* Hiding some private classes

* Removed the explicit inclusion of kfp.components.structures as per Ning's request

* Added OWNERS file

* Changed the index title

* Removed the subheader

* Added the links to main documentation and source code

* Removed the listing of the kfp.components._structures
2019-05-17 18:55:06 -07:00
Ilias Katsakioris 78bfdaffa9 SDK/Compiler: Fix Ops after() method to handle multiple arguments (#1346)
Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-05-16 16:50:27 -07:00
Alexey Volkov 8382595a98 SDK - Made description and name parameters optional in the @pipeline decorator (#1335) 2019-05-16 14:36:28 -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 a41bd106a1 SDK - Removing unneeded uses of dsl.Pipeline (#1229)
* SDK - Removing unneeded usages of dsl.Pipeline

* Fixed the naming-related issue
2019-05-14 18:48:18 -07:00
IronPan a2fd16e94e bump kfp version in sdk (#1330)
/assign @gaoning777
2019-05-14 13:49:18 -07:00
Ning 6fcab51a44 Add dsl support for preemptible vm/gpus (#1306)
* add dsl support for preemptible vm/gpus

* change name to nodepool to avoid confusion
2019-05-13 19:13:09 -07:00
Ilias Katsakioris 611f6e15ed Fix typo in ContainerOp contructor's help string (#1314)
Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-05-13 18:17:10 -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
Ilias Katsakioris b675e0272b Remove cops and rops pipeline attributes (#1298)
* Remove the separated dictionaries for ContainerOps and ResourceOps
* Fix the sanitization performed by the compiler to iterate through ops
  dict and do type-check for the special fields file_outputs and
  attribute_outputs

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-05-09 17:25:57 -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
Ilias Katsakioris c4c2d166fe Fix PipelineParam pattern bug (#1300)
* Generate a pattern in the constructor if one is not provided
* Add compiler tests

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-05-09 15:43:58 -07:00
Alexey Volkov dcd5ba5ef7 SDK - Failing faster in python_op tests (#1291)
* SDK - Failing faster in python_op tests

* Switched to `subprocess.run(full_command, check=True)`
2019-05-08 13:10:36 -07:00
Alexey Volkov b61bef04a3 SDK - Renamed ModelBase.from_struct/to_struct to from_dict/to_dict (#1290) 2019-05-07 14:06:35 -07:00
Alexey Volkov 892e3082b7 SDK/Client - Supporting pipeline packages with multiple files (#1207)
* SDK/Client - Supporting pipeline packages with multiple files

* Extracted the pipeline yaml file selection function
2019-05-06 16:11:39 -07:00
Alexey Volkov 819d91d2f1 Retaining the component url, digest or tag when loading (#1090) 2019-05-03 16:55:38 -07:00
hongye-sun f56a8cb72a
Comp yaml eb830cd73c (#1282) 2019-05-03 13:11:31 -07:00
hongye-sun eb830cd73c Component 727c48c690 (#1280) 2019-05-03 11:20:40 -07:00
Alexey Volkov c8fb25ade0 SDK - Preventing errors when importing kfp.notebook (#1215)
* SDK - Preventing errors when importing kfp.notebook

* Made the %%docker magic function visible outside IPython
2019-04-30 12:28:55 -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
Alexey Volkov 467adb5a3b SDK - Separated the generated api client package (#1214)
* SDK - Separated the generated api client package

* Splitting the package build scripts

* Pinning the API client package version

* Moved import kfp_server_api to the top of the file

* Added the Mac OS X prerequisite install instructions

* Moved the build_kfp_server_api_python_package.sh script to the backend dir

* Updated the dependency version span
2019-04-29 15:49:37 -07:00
Ning d6a9f60ddb display kaniko log if failed (#1247) 2019-04-29 13:03:35 -07:00
Alexey Volkov 7228ba1f0b Release b0147bdbed (#1238)
* Updated component images to version b0147bdbed

* Updated components to version e8524eefb1

* Updated the Python SDK version
2019-04-26 10:24:26 -07:00
Alexey Volkov b0147bdbed SDK - Fixed the non-string items in the command-line arguments (#1197)
* SDK - Fixed the non-string items if the command-line arguments
Fixes a bug discovered by Makoto.
When you pass non-string arguments to the ContainerOp.command, they're passed as such to the resulting Argo workflow which then cannot be loaded in back-end due to the item types.
This PR ensures the items are converted to string.

* Removed the if_none parameter

It wasn't used anywhere.

* Specified that the argument is optional.
2019-04-25 17:30:26 -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 f40a22a3f4 SDK - Made ComponentSpec.implementation field optional (#1188)
* SDK - Made ComponentSpec.implementation field optional
Improved the error message when trying to convert tasks to ContainerOp.

* Switched from attribute checking to type checking
2019-04-24 12:54:46 -07:00
Alexey Volkov 6920aceeba SDK - Removed SourceSpec structure (#1119)
It has never been used and ComponentSpec.metadata.annotations['source'] is a better place for such metadata.
2019-04-24 12:06:26 -07:00
Alexey Volkov 848d4fb99c SDK - Replaced insecure yaml.load with yaml.safe_load (#1170)
This improves security and gets rid of security warnings.
See https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
2019-04-23 15:26:00 -07:00
Alexey Volkov b588ba087a SDK/Tests - Properly closing tar files opened for writing (#1169) 2019-04-23 14:34:01 -07:00
Alexey Volkov c777401bf1 SDK - Decoupling ContainerOp from compiler (#1168)
* SDK - Decoupling ContainerOp from compiler
Currently, some code in DSL module depends on some classes that belong to the DSL-compiler.
Ideally, the dependency should go the the other way - the DSL-compiler should depend on DSL, but not the other way around.

This commit fixes that issue for the ContainerOp class.

* Switched from a list of handlers to a single handler
2019-04-23 13:42:01 -07:00
Alexey Volkov 99c40a22cf Fix package version conflict (#1201)
* Fix package version conflict

* Fixing component_sdk requirements.txt
2019-04-22 17:52:06 -07:00
Alexey Volkov ee119ec627 SDK - Got rid of the global variable collecting all created pipelines (#1167)
* SDK - Got rid of the global variable collecting all created pipelines
This list was only used by the command-line compiler.
The command-line compiler can still collect the created pipelines by registering a handler function in `_pipeline_decorator_handlers`.

* Replaced handler stack with a single handler.
2019-04-18 18:19:54 -07:00
John Paton 0b40672f96 Make Python Client robust to existing IPython installations (#1186)
* Make Client robust to IPython installations

* Return false directly instead of raising

Co-Authored-By: JohnPaton <john@johnpaton.net>
2019-04-18 17:23:54 -07:00
Alexey Volkov f92024f8eb SDK/Client - Stopped extracting pipeline file to disk during submission (#1178) 2019-04-17 09:22:05 -07:00
Alexey Volkov 871a97883c SDK - Simplified the @component decorator (#1166)
Moved metadata-related code to _metadata.
2019-04-15 19:43:06 -07:00
Ning 71325c3316 new kubernetes packages contain breaking change, thus fixing the version in the sample test image (#1159)
* new kubernetes packages contain breaking change, thus fixing the version

* also fixing the kubernetes version in the python sdk dependency

* fix bug
2019-04-14 21:36:00 -07:00
Ajay Gopinathan 7043862da0 Allow adding pipeline with name and description. (#1139) 2019-04-12 19:28:02 -07:00
Jiaxin Shan af9d48ac25 Allow users to add aws secrets (#1133) 2019-04-12 18:38:04 -07:00
Alexey Volkov c67aea779e SDK - Simplified the @pipeline decorator (#1120)
* SDK - Simplified the @pipeline decorator
Moved metadata-related code to _metadata.
`Pipeline.get_pipeline_functions` now returns the list of pipeline functions.

* Addressed @gaoning777's PR feedback
2019-04-12 13:14:47 -07:00
Ajay Gopinathan 9a11de78a7 Allow later versions of dependencies to be used with Python KFP package. (#1137) 2019-04-12 00:20:46 -07:00
Alexey Volkov 929ff52fd2 Passing the annotations and labels to the ContainerOp (#1077)
Currently the annotations and labels are not passed from component to the ContainerOp. This PR fixes that.

Fixes https://github.com/kubeflow/pipelines/issues/1013
2019-04-08 22:03:05 -07:00