Resource
The hera.workflows.resource module provides functionality for creating K8s resources via workflows inside task/steps.
Resource
Resource is a representation of a K8s resource that can be created by Argo.
The resource is a callable step that can be invoked in a DAG/Workflow. The resource can create any K8s resource,
such as other workflows, workflow templates, daemons, etc, as specified by the manifest field of the resource.
The manifest field is a canonical YAML that is submitted to K8s by Argo. Note that the manifest is a union of
multiple types. The manifest can be a string, in which case it is assume to be YAML. Otherwise, if it’s a Hera
objects, it is automatically converted to the corresponding YAML representation.
Source code in src/hera/workflows/resource.py
get_artifact
Finds and returns the artifact with the supplied name.
Note that this method will raise an error if the artifact is not found.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
name of the input artifact to find and return. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Artifact |
Artifact
|
the artifact with the supplied name. |
Raises:
| Type | Description |
|---|---|
KeyError
|
if the artifact is not found. |
Source code in src/hera/workflows/_mixins.py
get_parameter
Finds and returns the parameter with the supplied name.
Note that this method will raise an error if the parameter is not found.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
name of the input parameter to find and return. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Parameter |
Parameter
|
the parameter with the supplied name. |
Raises:
| Type | Description |
|---|---|
KeyError
|
if the parameter is not found. |