forked from kubeflow/kfp-tekton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop-example-workspaces.yaml
132 lines (132 loc) · 3.02 KB
/
loop-example-workspaces.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
apiVersion: v1
kind: ConfigMap
metadata:
name: recipe-storage
data:
recipe: |
1. dry roast split green gram 1 cup
2. turn it into a fine powder somehow
3. While it is still warm add jaggery powder 1 cup
4. In a seperate pan, heat clarified butter to molten consistency
5. Mix all the items, and add only as much ghee that mixture can be bound into sphere ball
6. Tasty and healthy (great source of protein/energy) sunnandulu laddus are ready
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared-task-storage
spec:
resources:
requests:
storage: 16Mi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: print-data
spec:
workspaces:
- name: storage
readOnly: true
params:
- name: filename
steps:
- name: print-recipe
image: ubuntu
script: cat $(workspaces.storage.path)/$(params.filename)
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: fetch-store-data
spec:
workspaces:
- name: recipe-ws
- name: storage
params:
- name: src-filename
- name: dst-filename
steps:
- name: fetch-store-recipe-data
image: ubuntu
script: |
cp $(workspaces.recipe-ws.path)/$(params.src-filename) $(workspaces.storage.path)/$(params.dst-filename)
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: fetch-and-print-recipe
spec:
params:
- name: dst-filename
type: string
workspaces:
- name: shared-data
- name: recipe-store
tasks:
- name: fetch-the-recipe
taskRef:
name: fetch-store-data
params:
- name: src-filename
value: recipe.txt
- name: dst-filename
value: $(params.dst-filename)
workspaces:
- name: recipe-ws
workspace: recipe-store
- name: storage
workspace: shared-data
- name: print-the-recipe
runAfter:
- fetch-the-recipe
taskRef:
name: print-data
params:
- name: filename
value: $(params.dst-filename)
workspaces:
- name: storage
workspace: shared-data
---
apiVersion: custom.tekton.dev/v1alpha1
kind: PipelineLoop
metadata:
name: pipelineloop-ws-example
spec:
pipelineRef:
name: fetch-and-print-recipe
workspaces:
- name: recipe-store
configMap:
name: recipe-storage
items:
- key: recipe
path: recipe.txt
- name: shared-data
persistentVolumeClaim:
claimName: shared-task-storage
iterateParam: dst-filename
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pr-ws-loop-example
spec:
pipelineSpec:
tasks:
- name: produce-recipies
retries: 3
params:
- name: dst-filename
value:
- first-recipe.txt
- second-recipe.txt
- third-recipe.txt
taskRef:
apiVersion: custom.tekton.dev/v1alpha1
kind: PipelineLoop
name: pipelineloop-ws-example