forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparallelism-nested-workflow.yaml
52 lines (49 loc) · 1.17 KB
/
parallelism-nested-workflow.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
# Example on specifying parallelism on the outer workflow and limiting the number of its
# children workflows to be run at the same time.
#
# As the parallelism of A is 1, the four steps of seq-step will run sequentially.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: parallelism-nested-workflow-
spec:
arguments:
parameters:
- name: seq-list
value: |
["a","b","c","d"]
entrypoint: A
templates:
- name: A
parallelism: 1
inputs:
parameters:
- name: seq-list
steps:
- - name: seq-step
template: B
arguments:
parameters:
- name: seq-id
value: "{{item}}"
withParam: "{{inputs.parameters.seq-list}}"
- name: B
inputs:
parameters:
- name: seq-id
steps:
- - name: jobs
template: one-job
arguments:
parameters:
- name: seq-id
value: "{{inputs.parameters.seq-id}}"
withParam: "[1, 2]"
- name: one-job
inputs:
parameters:
- name: seq-id
container:
image: alpine
command: ['/bin/sh', '-c']
args: ["echo {{inputs.parameters.seq-id}}; sleep 30"]