forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdag-targets.yaml
67 lines (64 loc) · 2.04 KB
/
dag-targets.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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
depends: "A"
template: echo
arguments:
parameters: [{name: message, value: B}]
- name: C
depends: "A"
template: echo
arguments:
parameters: [{name: message, value: C}]
- name: D
depends: "B && C"
template: echo
arguments:
parameters: [{name: message, value: D}]
- name: E
depends: "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}}"]