Last active
July 11, 2022 03:13
-
-
Save jmettes/3aac603eb04eb51931dbcb3869066811 to your computer and use it in GitHub Desktop.
Basic usage of Argo WorkflowTemplates, with minimal duplication and boiler plate. The DAG is the only template, using inline sub-templates for tasks (instead of additional task templates), and a single global parameter passed by Workflow at top level (without having redefine the DAG structure to pass separate parameters)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: WorkflowTemplate | |
metadata: | |
name: workflow-template-submittable | |
spec: | |
entrypoint: dag | |
templates: | |
- name: dag | |
inputs: | |
parameters: | |
- name: global-parameter | |
dag: | |
tasks: | |
- name: A | |
inline: | |
container: | |
image: docker/whalesay | |
command: [cowsay] | |
args: ["hello A"] | |
- name: B | |
depends: "A" | |
inline: | |
container: | |
image: docker/whalesay | |
command: [cowsay] | |
args: ["{{inputs.parameters.global-parameter}}"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: workflow-template-hello-world- | |
namespace: processing | |
spec: | |
arguments: | |
parameters: | |
- name: global-parameter | |
value: "from workflow" | |
workflowTemplateRef: | |
name: workflow-template-submittable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment