pipelines/samples/core/volume_snapshot_ops
Yaqi Ji b693909a08
feat(sdk)!: move v1 to deprecated folder (#7291)
* chore(sdk): move v1 to deprecated

* fix testsg

* fix testsg

* fix setup.py

* fix test

* s'

* fix tests

* fix test

* retore v2 test changes

* fix py3.6 test

* fix py3.6 test

* fix py3.6 import fallback error

* remove deprecated

* fix samples test

* sample test

* fix samples

* add readme

* restroe test

* python require

* remove path

* fix tests

* inteegration tests

* remove tfx tests for dependency with kfp v1

* fix e2e

* fix e2e

* fix integration tests

* fix sampe

* move client down

* change to kfp

* add import alias

* fix

* runid

* fix dsl

* only use kfp for function

* revert train_until_good

* tfx test

* kfp

* try import

* onprem
2022-03-04 00:52:59 +00:00
..
README.md Restructure samples (#1710) 2019-08-01 17:31:37 -07:00
volume_snapshot_ops.py feat(sdk)!: move v1 to deprecated folder (#7291) 2022-03-04 00:52:59 +00:00
volume_snapshot_ops_test.py feat(sdk)!: move v1 to deprecated folder (#7291) 2022-03-04 00:52:59 +00:00

README.md

Simplify the creation of VolumeSnapshot instances

VolumeSnapshotOp: A specified ResourceOp for VolumeSnapshot creation.


NOTE: VolumeSnapshots is an Alpha feature. You should check if your Kubernetes cluster admin has them enabled.


Arguments:

The following arguments are an extension to the ResourceOp arguments. If a k8s_resource is passed, then none of the following may be provided.

  • resource_name: The name of the resource which will be created. This string will be prepended with the workflow name. This may contain PipelineParams. (required)
  • pvc: The name of the PVC to be snapshotted. This may contain PipelineParams. (optional)
  • snapshot_class: The snapshot storage class to be used. This may contain PipelineParams. (optional)
  • volume: An instance of a V1Volume, or its inherited type (e.g. PipelineVolume). This may contain PipelineParams. (optional)
  • annotations: Annotations to be patched in the VolumeSnapshot. These may contain PipelineParams. (optional)

NOTE: One of the pvc or volume needs to be provided.

Outputs

Additionally to the whole specification of the resource and its name (ResourceOp defaults), a VolumeSnapshotOp also outputs the restoreSize of the bounded VolumeSnapshot (as step.outputs["size"]). This is the minimum size for a PVC created by that snapshot.

Useful attribute

The VolumeSnapshotOp step has a .snapshot attribute which is a V1TypedLocalObjectReference. This can be passed as a data_source to create a PVC out of that VolumeSnapshot. The user may otherwise use the step.outputs["name"] as data_source.