Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): Enable re-use of PVC with VolumeOp #6582

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Bug Fixes and Other Changes
* Fix duplicate function for `list_pipeline_versions()`. [\#6594](https://github.com/kubeflow/pipelines/pull/6594)

* Support re-use of PVC with VolumeOp. [\#6582](https://github.com/kubeflow/pipelines/pull/6582)
## Documentation Updates

# 1.8.2
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/kfp/dsl/_volume_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class VolumeOp(ResourceOp):
VolumeSnapshot name (Alpha feature)
volume_name: VolumeName is the binding reference to the PersistentVolume
backing this claim.
generate_unique_name: Generate unique name for the PVC
kwargs: See :py:class:`kfp.dsl.ResourceOp`

Raises:
Expand All @@ -68,6 +69,7 @@ def __init__(self,
annotations: Dict[str, str] = None,
data_source=None,
volume_name=None,
generate_unique_name: bool = True,
**kwargs):
# Add size to attribute outputs
self.attribute_outputs = {"size": "{.status.capacity.storage}"}
Expand Down Expand Up @@ -103,7 +105,7 @@ def __init__(self,
if not match_serialized_pipelineparam(str(resource_name)):
resource_name = sanitize_k8s_name(resource_name)
pvc_metadata = V1ObjectMeta(
name="{{workflow.name}}-%s" % resource_name,
name="{{workflow.name}}-%s" % resource_name if generate_unique_name else resource_name,
annotations=annotations)
requested_resources = V1ResourceRequirements(requests={"storage": size})
pvc_spec = V1PersistentVolumeClaimSpec(
Expand Down