forked from volcano-sh/kubegene
/
simple-sample.yaml
91 lines (90 loc) · 2.72 KB
/
simple-sample.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
version: genecontainer_0_1
inputs:
sub-folder:
default: sample-x
description: The path of the output file in the hostpath volume
type: string
result:
default: test-result.txt
description: Output file name
type: string
output:
default: result
description: Output file path
type: string
samplemountpath:
default: /sample
description: hostpath mount path
type: string
output-prefix:
default: '$(date "+%F %r"): '
description: Prefix when outputting to the result file
type: string
wait-base:
default: 1
description: Base of waiting time
type: number
prepare-command:
default: "echo job-prepare"
description: Execute commands before all commands
type: string
sample-pvc:
default: sample-pvc
description: name of pvc used
type: string
workflow:
jobprepare:
tool: nginx:latest
commands:
- ${prepare-command}; rm -rf ${samplemountpath}/${output}/${sub-folder}; mkdir -p ${samplemountpath}/${output}/${sub-folder}; ls ${samplemountpath}/* echo ${output-prefix}prepare | tee -a ${samplemountpath}/${output}/${sub-folder}/${result};
joba:
tool: nginx:latest
commands:
- sleep `expr 3 \* ${wait-base}`; echo ${output-prefix}job-a | tee -a ${samplemountpath}/${output}/${sub-folder}/${result};
- sleep `expr 3 \* ${wait-base}`; echo ${output-prefix}job-a | tee -a ${samplemountpath}/${output}/${sub-folder}/${result};
depends:
- target: jobprepare
type: whole
jobb:
tool: nginx:latest
commands_iter:
command: sleep `expr ${1} \* ${wait-base}`; echo ${output-prefix}job-b-${item} | tee -a ${samplemountpath}/${output}/${sub-folder}/${result};
vars_iter:
- range(0, 3)
depends:
- target: joba
type: whole
jobc:
tool: nginx:latest
commands_iter:
command: sleep `expr ${1} \* ${wait-base}`; echo ${output-prefix}job-c-${item} | tee -a ${samplemountpath}/${output}/${sub-folder}/${result};
vars_iter:
- [3, 20]
depends:
- target: joba
type: iterate
- target: jobprepare
type: whole
jobd:
tool: nginx:latest
commands_iter:
command: sleep `expr ${1} \* ${wait-base}`; echo ${output-prefix}job-d-${item} | tee -a ${samplemountpath}/${output}/${sub-folder}/${result};
vars_iter:
- [3, 5]
depends:
- target: jobb
type: whole
- target: jobc
type: iterate
jobfinish:
tool: nginx:latest
commands:
- cat ${samplemountpath}/${output}/${sub-folder}/${result} | tee -a ${samplemountpath}/${output}/${result};
depends:
- target: jobd
type: whole
volumes:
samplepv:
mount_path: ${samplemountpath}
mount_from:
pvc: ${sample-pvc}