Commit Graph

282 Commits

Author SHA1 Message Date
Riley Bauer 3882c306cd Update manifests for 0.1.23 (#1567)
* Updates KFP manifests for v0.1.23

* Bump version in sdk
2019-06-28 11:32:58 -07:00
Ning 812ca7f883 configurable timeout and namespace in docker magic (#1550)
* configurable timeout and namespace in docker magic

* debug

* remove debug code
2019-06-26 15:09:20 -07:00
Derek Hao Hu 0c724fe194 Sort keys in nested dictionaries for fixing unit tests (#1558)
* Sort keys in nested dictionaries

* Formatting
2019-06-25 17:33:15 -07:00
Derek Hao Hu 64bf621902 Use sorted(dict.items()) for stable output (#1554)
* Use sorted(dict.items()) for stable output

* Update unit test
2019-06-25 07:42:37 -07:00
Alexey Volkov 3aeab312f2 SDK/Lightweight - Use argparse for command-line parsing (#1534)
It's required to correctly handle None arguments or None default values (also needed for optional and variable-number inputs).
It's easier to understand and generates better command-line code.
2019-06-23 16:45:53 -07:00
Alexey Volkov ce8df162a9 SDK/Lightweight - Added python version compatibility checks (#1524)
* SDK - Refactored the code in kfp.components._python_op._capture_function_code_using_cloudpickle

* SDK/Lightweight - Added python version compatibility checks

See my compatibility analysis: https://github.com/cloudpipe/cloudpickle/issues/293
2019-06-23 14:41:54 -07:00
Fábio Franco Uechi c5cf323bf7 add optional param name to upload_pipeline (#1543) 2019-06-23 13:21:53 -07:00
Alexey Volkov 34cde15152 SDK/Client - Added support for all APIs (#1536) 2019-06-20 20:18:35 -07:00
Alexey Volkov f679f786a1 SDK/Client - Added the upload_pipeline API (#1535)
* SDK - Client Added the upload_pipeline API

* Using _get_url_prefix

Also fixing the URL.
2019-06-20 19:12:37 -07:00
Alexey Volkov 94f793c64a SDK - Generated paths will be in /tmp by default (#1531)
This makes them more compatible with images that have non-root user
2019-06-20 18:04:35 -07:00
Kevin Bache 5a5e39dc51 Release v0.22 (#1525)
* Updated component images to version d4960d3379

* Updated components to version d0aa15dfb3

* setup version inc
2019-06-20 15:28:35 -07:00
Alexey Volkov 79411b7bba SDK - Fixed import (#1522) 2019-06-18 21:08:33 -07:00
Alexey Volkov 627b412f24 SDK/Lightweight - Disabled code pickling by default (#1512)
I've introduced code pickling to capture dependencies in https://github.com/kubeflow/pipelines/pull/1372
Later I've discovered that there is a serious opcode incompatibility between python versions 3.5 and 3.6+. See my analysis of the issue: https://github.com/cloudpipe/cloudpickle/issues/293

Dues to this issue I decided to switch back to using source code copying by default and to continue improving it.

Until we stop supporting python 3.5 (https://github.com/kubeflow/pipelines/pull/668) it's too dangerous to use code pickling by default.

Code pickling can be enabled by specifying `pickle_code=True` when calling `func_to_container_op`
2019-06-18 19:44:30 -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
Alexey Volkov b935836c30 SDK/Lightweight - Enable cloudpickle installation from non-root users (#1511) 2019-06-17 18:56:15 -07:00
Alexey Volkov e90085ecb3 SDK - Refactored _func_to_component_spec to split code generation from signature analysis (#1334)
* SDK - Refactored _func_to_component_spec to split out the function signature analyzer

* Renamed function to _extract_component_interface
2019-06-17 18:02:16 -07:00
Alexey Volkov 8d5d264b2f SDK - Make it easier to compile and submit a pipeline run (#1484)
* SDK - Make it easier to compile and submit a pipeline run
Adds the `Client.run_pipeline_func_on_kfp(func)` function that compiles the pipeline and submits it for execution on KFP-enabled cluster.

* Renamed run_pipeline_func_on_kfp to create_run_from_pipeline_func
2019-06-17 15:34:15 -07:00
Alexey Volkov aee1b5e2e5 SDK - Improving python component logs by making stdout and stderr unbuffered (#1510)
Without this the output and error lines can be printed in wrong order and sometimes not printed at all.
2019-06-14 00:20:20 -07:00
Krassimir Valev 8938669d7d Base64 encode the pickled code (#1476)
Due to its nature, Argo will replace any strings it encounters
that are enclosed in double curly braces, which will make the code
non-executable. To workaround this, the code is encoded in the Argo
yaml template and decoded on the fly, before the execution.
2019-06-13 23:30:25 -07:00
Ilias Katsakioris d4960d3379 SDK/DSL: Make 'name' argument of a PipelineVolume omittable (#1402)
* SDK/DSL: Make 'name' argument of a PipelineVolume omittable

Also remove unused imports from _pipeline_volume module

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

* Use hashlib.sha256() instead of id()

* Fix not maintaining provided name
2019-06-13 22:42:22 -07:00
hongye-sun a39ae8eb77 KFP CLI (#1449)
* kfp CLI

* Add fire dependency

* Use click instead of fire

* Refactor the cli command groups.
2019-06-08 00:39:05 -07:00
Alexey Volkov d724a4b68d SDK - Controlling which modules are captured with Lightweight components (#1435)
* SDK - Controlling which modules are captured with Lightweight components

All func_to_* functions now accept the modules_to_capture parameter: List of module names that will be captured (instead of just referencing) during the dependency scan. By default the func.__module__ is captured.

* Described the behavior more in depth.

* Added a test to check that only dependencies are captured
2019-06-07 18:47:06 -07:00
Krassimir Valev 381083a7c3 SDK/Compiler - Invoke the op_transformers as early as possible (#1464)
* Add reproducible test case

* Invoke the op_transformers as early as possible
2019-06-07 14:05:57 -07:00
Krassimir Valev 858346561a SDK/Compiler - Fix s3 artifact key names (#1451)
* Fix s3 artifact key names

* Compiler test to verify the bugfix
2019-06-06 21:15:57 -07:00
hongye-sun b1fa929442 Add op_to_templates_handler to compiler (#1458)
* Add op_to_templates_handler to compiler

* Update tests.
2019-06-06 20:13:58 -07:00
Alexey Volkov 90214f50e7 SDK - Use different volume names for different secrets (#1379)
* SDK - Use different volume names for different secrets

* Show a DeprecationWarning for now instead of removing the paramater outright.
2019-06-06 19:21:59 -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
Alexey Volkov 52d4dc8229 SDK - Improved test script compatibility with editable package installation (#1200) 2019-06-06 16:37:59 -07:00
Ilias Katsakioris e92019c8c7 SDK/Compiler: Add add_pvolumes() method to ContainerOp (#1353)
Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-06-06 15:48:01 -07:00
Ning 9f97a94f5e
remove support for deserializing a string of a dict for typemeta (#1439) 2019-06-06 13:58:31 -07:00
Ning 86a49e9f42
expose add_op_transformer in the PipelineConf and add an example (#1440)
* expose add_op_transformer in the PipelineConf and add an example
2019-06-06 13:10:09 -07:00
Alexey Volkov ab97d5708d SDK - Only install cloudpickle if it's not available (#1434)
This makes unit tests much faster.
Also:
Pined the version to 1.1.1.
Made the installation quiet.
2019-06-04 17:57:53 -07:00
hongye-sun f7eb0ccfaa Load auth from kube config. (#1443)
* Load auth from kube config.

* Return config
2019-06-04 16:19:52 -07:00
Alexey Volkov 16213ba62d SDK - Dynamically installing cloudpickle module (#1429)
Fixes https://github.com/kubeflow/pipelines/issues/1426
2019-06-03 16:45:53 -07:00
Ning b6967d88aa add default value type checking (#1407)
* add default value type checking

* add jsonschema dependency

* fix unit test error

* workaround for travis python package installation

* add back jsonschema version

* fix sample test error in type checking sample

* add jsonschema in requirements such that sphinx works fine
2019-06-03 15:33:32 -07:00
Alexey Volkov a2eab56ae8 Fixed the handling of PipelineParam-based default values in extract_metadata (#1380) 2019-05-31 20:48:23 -07:00
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
Alexey Volkov 0a086170a2 Stabilized the artifact ordering during the compilation (#1097) 2019-04-08 18:17:04 -07:00
Kevin Bache 52d7c7bd9e incremented app version (#1107) 2019-04-08 16:27:05 -07:00
Nathan DeMaria 8468b253f9 Reference correct object in k8s->json tuple conversion (#1088) 2019-04-05 14:01:55 -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
Ning 1a04e86ed7 Recursion bug fix (#1061)
* remove the graph component output; add support for dependency on graph component

* fix bug; adjust unit tests

* add support for explicit dependency of graph component

* adjust unit test

* add a todo

* bug fixes for unit tests

* refactor condition_param code; fix bug when the inputs task name is None; need to remove the print later

* do not pass condition param as arguments to downstream ops, remove print logs; add unit tests

* add unit test golden yaml

* fix bug

* fix the sample
2019-04-02 09:49:19 -07:00
Ilias Katsakioris 3a10425692 SDK: Fix wrong indentation in extract_pipelineparams_from_any() (#1076)
Remove a level of indentation from `return` statement in dict case which
resulted in checking only the first value

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-04-01 16:04:34 -07:00
Alexey Volkov 291691a9f9 SDK/Components - Handling public GCS URIs in load_component (#1057) 2019-03-28 15:55:56 -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
Ning f59c25bd04 Add type check samples (#955)
* add core types and type checking function

* fix unit test bug

* avoid defining dynamic classes

* typo fix

* add component metadata format

* add a construct for the component decorator

* add default values for the meta classes

* add input/output types to the metadata

* add from_dict in TypeMeta

* small fix

* add unit tests

* use python struct for the openapi schema

* add default in parameter

* add default value

* remove the str restriction for the param default

* bug fix

* add pipelinemeta

* add pipeline metadata

* ignore annotation if it is not str/BaseType/dict

* update param name in the check_type functions
remove schema validators for GCRPath, and adjust for GCRPath, GCSPath
change _check_valid_dict to _check_valid_type_dict to avoid confusion
fix typo in the comments
adjust function order for readability

* remove default values for non-primitive types in the function signature
update the _check_valid_type_dict name

* pass metadata from component decorator and task factory to containerOp

* pass pipeline metadata to Pipeline

* fix unit test

* typo in the comments

* move the metadata classes to a separate module

* fix unit test

* small change

* add __eq__ to meta classes
not export _metadata classes

* nothing

* fix unit test

* unit test python component

* unit test python pipeline

* fix bug: duplicate variable of args

* fix unit tests

* move python_component and _component decorator in _component file

* remove the print

* change parameter default value to None

* add functools wraps around _component decorator

* TypeMeta accept both str and dict

* fix indent, add unit test for type as strings

* do not set default value for the name field in ParameterMeta, ComponentMeta, and PipelineMeta

* add type check in task factory

* output error message

* add type check in component decorator; move the metadata assignment out of the containerop __init__ function

* fix bug; add unit test

* add more unit tests

* more unit tests; fix bugs

* more unit tests; fix bugs

* add unit tests

* more unit tests

* add type check switch; add unit tests

* add compiler option for type check

* add a notebook sample

* resolving pr comments

* add unit test for pipeline param check with component types; fix the bug; also fix the bug when there are not a single return annotations

* add dsl static type checking sample

* fix bug: op_to_template resolve the raw arguments by mapping to the argument_inputs but the argument_inputs lost the type information

* fix type pattern matching

* convert orderedDict to dict from the component module

* add unit test to the pipelineparam with types

* create TypeMeta deserialize function, add comments

* strongly typed pipelineparamtuple

* remove GCSPath fields to avoid artifact type confusion
change the type json schema field name to openAPIV3Schema

* fix unit tests; add unit test for openapishema property

* add comments

* add unit test at the component module; fix bug

* add ignore_type in pipelineparam

* update sample: no artifact types but only parameter types; add pipelineparam ignore_type example

* configure the default type checking to enabled

* change openAPIV3Schema to lower case with underscore

* revert change from the merge

* add code blocks, add the benefits of static type checking
add more comments within the code block
add documentation about the type definition in both yaml and decorated
components.

* fix the comment

* update dsl.type namespace
2019-03-27 19:58:42 -07:00
Alexey Volkov e452385a55 Fixed handling parameters with default values in task factory construction (#1047)
* Fixed handling default inputs in task factory construction

* Added tests.
2019-03-26 19:14:47 -07:00
Ning e90a334758 fix bug (#1048) 2019-03-26 17:12:47 -07:00
Ning 554731e478 dsl generate zip file (#855)
* dsl generate zip file

* minor fix

* fix zip read in the unit test

* update sample tests

* dsl compiler generates pipeline based on the input name suffix

* add unit tests for different output format

* update the sdk client to support tar zip and yaml

* fix typo

* fix file write
2019-03-26 15:14:50 -07:00
Ning 8c09090985 Support recursions in a function (#1014)
* add a While in the ops group

* deepcopy the while conditions when entering and exiting

* add while condition resolution in the compiler

* define graph component decorator

* remove while loop related codes

* fixes

* remove while loop related code

* fix bugs

* generate a unique ops group name and being able to retrieve by name

* resolve the opsgroups inputs and dependencies based on the pipelineparam in the condition

* add a recursive ops_groups

* fix bugs of the recursive opsgroup template name

* resolve the recursive template name and arguments

* add validity checks

* add more comments

* add usage comment in graph_component

* add unit test for the graph opsgraph

* refactor the opsgroup

* add unit test for the graph_component decorator

* exposing graph_component decorator

* add recursive compiler unit tests

* fix the bug of opsgroup name
adjust the graph_component usage example
fix index bugs
use with statement in the graph_component instead of directly calling
the enter/exit functions

* add a todo to combine the graph_component and component decorators
2019-03-26 14:17:18 -07:00