* Add pipeline_id to run and recurring run protos * Add pipeline_id to run and recurring_run * Set status when creating a new job. Closes #9125. * Enable sample tests |
||
|---|---|---|
| .. | ||
| README.md | ||
| volume_ops.py | ||
README.md
Simplify the creation of PersistentVolumeClaim instances
VolumeOp: A specified ResourceOp for PVC creation.
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 containPipelineParams. (required) -
size: The requested size for the PVC. This may containPipelineParams. (required) -
storage_class: The storage class to be used. This may containPipelineParams. (optional) -
modes: TheaccessModesof the PVC. Check this documentation for further information. The user may find the following modes built-in:VOLUME_MODE_RWO:["ReadWriteOnce"]VOLUME_MODE_RWM:["ReadWriteMany"]VOLUME_MODE_ROM:["ReadOnlyMany"]
Defaults to
VOLUME_MODE_RWM. -
annotations: Annotations to be patched in the PVC. These may containPipelineParams. (optional) -
data_source: It is used to create a PVC from aVolumeSnapshot. Can be either aV1TypedLocalObjectReferenceor astring, and may containPipelineParams. (Alpha feature, optional)
Outputs
Additionally to the whole specification of the resource and its name (ResourceOp defaults), a
VolumeOp also outputs the storage size of the bounded PV (as step.outputs["size"]).
However, this may be empty if the storage provisioner has a WaitForFirstConsumer binding mode.
This value, if not empty, is always ≥ the requested size.
Useful attributes
- The
VolumeOpstep has a.volumeattribute which is aPipelineVolumereferencing the created PVC. APipelineVolumeis essentially aV1Volumesupplemented with an.after()method extending the carried dependencies. These dependencies can then be parsed properly by aContainerOp, if used with thepvolumesattribute, to extend theContainerOp's dependencies. - A
ContainerOphas apvolumesargument in its constructor. This is a dictionary with mount paths as keys and volumes as values and functions similarly tofile_outputs(which can then be used asop.outputs["key"]orop.output). For example:vop = dsl.VolumeOp( name="volume_creation", resource_name="mypvc", size="1Gi" ) step1 = dsl.ContainerOp( name="step1", ... pvolumes={"/mnt": vop.volume} # Implies execution after vop ) step2 = dsl.ContainerOp( name="step2", ... pvolumes={"/data": step1.pvolume, # Implies execution after step1 "/mnt": dsl.PipelineVolume(pvc="existing-pvc")} ) step3 = dsl.ContainerOp( name="step3", ... pvolumes={"/common": step2.pvolumes["/mnt"]} # Implies execution after step2 )