# This workflow illustrates the use of DAG "targets". Targets can be thought of similarly to make # targets. If specified, only a subset of the DAG tasks will be executed, just the tasks necessary # to reach the target(s). For example, given the following DAG workflow, specifying a dag.target of # 'E' will result in the execution of A, C, and E, while skipping execution of B and D. # # DAG Executed # A A # / \ \ # B C C # \ / \ \ # D E E # apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: dag-target- spec: entrypoint: dag-target arguments: parameters: - name: target value: E templates: - name: dag-target dag: # dag.target can optionally be specified to restrict the execution of the workflow to only the # dependant chain of tasks to reach the desired target. Multiple targets can be specified, as # space delimited targets, and can be parameterized. An empty/omitted target will execute all # tasks. Submit this example again with different values for target to see how it affects the # execution: # argo submit dag-targets.yaml -p target="B E" target: "{{workflow.parameters.target}}" tasks: - name: A template: echo arguments: parameters: [{name: message, value: A}] - name: B dependencies: [A] template: echo arguments: parameters: [{name: message, value: B}] - name: C dependencies: [A] template: echo arguments: parameters: [{name: message, value: C}] - name: D dependencies: [B, C] template: echo arguments: parameters: [{name: message, value: D}] - name: E dependencies: [C] template: echo arguments: parameters: [{name: message, value: E}] - name: echo inputs: parameters: - name: message container: image: alpine:3.7 command: [echo, "{{inputs.parameters.message}}"]