Commit Graph

9 Commits

Author SHA1 Message Date
Alexey Volkov f39cbdca70 SDL - DSL - Stabilized the PipelineVolume names (#2794)
The name no longer depends on unset parameters or the version of the Kubernetes package.
Needed for https://github.com/kubeflow/pipelines/pull/2780
Fixes  https://travis-ci.com/kubeflow/pipelines/jobs/270786161
2020-01-03 18:07:40 -08:00
Ilias Katsakioris 4624ac817d SDK/DSL: Fix PipelineVolume name length (#2739)
* SDK/DSL: Fix PipelineVolume name length

Volume name must be no more than 63 characters

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

* Change which part of the hash value we make use of

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
2019-12-18 12:52:04 -08:00
Alexey Volkov 301186cc87 SDK - Refactoring - Reduced the usage of dsl.Pipeline context (#2034)
Also reduced the unnecessary explicit usage of PipelineParam bu the end users
2019-09-05 01:26:52 -07:00
Ilias Katsakioris df4bc2365e SDK/DSL: Fix bug when using PipelineParam in `pvc` of PipelineVolume (#2018)
If no `name` is provided to PipelineVolume constructor, a custom name is
generated. It relies on `json.dumps()` of the struct after getting
converted to dict.
When `pvc` is provided and `name` is not, the following error is raised:
  TypeError: Object of type PipelineParam is not JSON serializable

This commit fixes it and extends tests to catch it.
2019-09-04 11:32:23 -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
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
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