forked from machine-learning-exchange/katalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wml-pipeline.yaml
385 lines (385 loc) · 16.1 KB
/
wml-pipeline.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# Copyright 2021 The MLX Contributors
#
# SPDX-License-Identifier: Apache-2.0
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: kfp-on-wml-training
annotations:
tekton.dev/output_artifacts: '{"create-secret-kubernetes-cluster": [{"key": "artifacts/$PIPELINERUN/create-secret-kubernetes-cluster/secret_name.tgz",
"name": "create-secret-kubernetes-cluster-secret_name", "path": "/tmp/outputs/secret_name/data"}],
"deploy-model-watson-machine-learning": [{"key": "artifacts/$PIPELINERUN/deploy-model-watson-machine-learning/model_uid.tgz",
"name": "deploy-model-watson-machine-learning-model_uid", "path": "/tmp/outputs/model_uid/data"},
{"key": "artifacts/$PIPELINERUN/deploy-model-watson-machine-learning/scoring_endpoint.tgz",
"name": "deploy-model-watson-machine-learning-scoring_endpoint", "path": "/tmp/outputs/scoring_endpoint/data"}],
"store-model-watson-machine-learning": [{"key": "artifacts/$PIPELINERUN/store-model-watson-machine-learning/model_uid.tgz",
"name": "store-model-watson-machine-learning-model_uid", "path": "/tmp/outputs/model_uid/data"}],
"train-model-watson-machine-learning": [{"key": "artifacts/$PIPELINERUN/train-model-watson-machine-learning/run_uid.tgz",
"name": "train-model-watson-machine-learning-run_uid", "path": "/tmp/outputs/run_uid/data"},
{"key": "artifacts/$PIPELINERUN/train-model-watson-machine-learning/training_uid.tgz",
"name": "train-model-watson-machine-learning-training_uid", "path": "/tmp/outputs/training_uid/data"}]}'
tekton.dev/input_artifacts: '{"deploy-model-watson-machine-learning": [{"name":
"store-model-watson-machine-learning-model_uid", "parent_task": "store-model-watson-machine-learning"}],
"store-model-watson-machine-learning": [{"name": "train-model-watson-machine-learning-run_uid",
"parent_task": "train-model-watson-machine-learning"}], "train-model-watson-machine-learning":
[{"name": "create-secret-kubernetes-cluster-secret_name", "parent_task": "create-secret-kubernetes-cluster"}]}'
tekton.dev/artifact_bucket: mlpipeline
tekton.dev/artifact_endpoint: minio-service.kubeflow:9000
tekton.dev/artifact_endpoint_scheme: http://
tekton.dev/artifact_items: '{"create-secret-kubernetes-cluster": [["secret_name",
"$(results.secret-name.path)"]], "deploy-model-watson-machine-learning": [["model_uid",
"$(results.model-uid.path)"], ["scoring_endpoint", "$(results.scoring-endpoint.path)"]],
"store-model-watson-machine-learning": [["model_uid", "$(results.model-uid.path)"]],
"train-model-watson-machine-learning": [["run_uid", "$(results.run-uid.path)"],
["training_uid", "$(results.training-uid.path)"]]}'
sidecar.istio.io/inject: "false"
pipelines.kubeflow.org/big_data_passing_format: $(workspaces.$TASK_NAME.path)/artifacts/$ORIG_PR_NAME/$TASKRUN_NAME/$TASK_PARAM_NAME
pipelines.kubeflow.org/pipeline_spec: '{"description": "Kubeflow pipelines running
on WML performing tensorflow image recognition.", "inputs": [{"default": "",
"name": "GITHUB_TOKEN", "optional": true}, {"default": "https://raw.githubusercontent.com/user/repository/branch/creds.ini",
"name": "CONFIG_FILE_URL", "optional": true}, {"default": "tf-model.zip", "name":
"train_code", "optional": true}, {"default": "''python3 convolutional_network.py
--trainImagesFile ${DATA_DIR}/train-images-idx3-ubyte.gz --trainLabelsFile ${DATA_DIR}/train-labels-idx1-ubyte.gz
--testImagesFile ${DATA_DIR}/t10k-images-idx3-ubyte.gz --testLabelsFile ${DATA_DIR}/t10k-labels-idx1-ubyte.gz
--learningRate 0.001 --trainingIters 20000''", "name": "execution_command",
"optional": true}, {"default": "tensorflow", "name": "framework", "optional":
true}, {"default": "1.15", "name": "framework_version", "optional": true}, {"default":
"python", "name": "runtime", "optional": true}, {"default": "3.6", "name": "runtime_version",
"optional": true}, {"default": "wml-tensorflow-definition", "name": "run_definition",
"optional": true}, {"default": "wml-tensorflow-run", "name": "run_name", "optional":
true}, {"default": "wml-tensorflow-mnist", "name": "model_name", "optional":
true}, {"default": "tf-mnist-test-payload.json", "name": "scoring_payload",
"optional": true}, {"default": "k80", "name": "compute_name", "optional": true},
{"default": "1", "name": "compute_nodes", "optional": true}], "name": "Watson
Machine Learning"}'
spec:
params:
- name: CONFIG_FILE_URL
value: https://raw.githubusercontent.com/user/repository/branch/creds.ini
- name: GITHUB_TOKEN
value: ''
- name: compute_name
value: k80
- name: compute_nodes
value: '1'
- name: execution_command
value: '''python3 convolutional_network.py --trainImagesFile ${DATA_DIR}/train-images-idx3-ubyte.gz
--trainLabelsFile ${DATA_DIR}/train-labels-idx1-ubyte.gz --testImagesFile ${DATA_DIR}/t10k-images-idx3-ubyte.gz
--testLabelsFile ${DATA_DIR}/t10k-labels-idx1-ubyte.gz --learningRate 0.001
--trainingIters 20000'''
- name: framework
value: tensorflow
- name: framework_version
value: '1.15'
- name: model_name
value: wml-tensorflow-mnist
- name: run_definition
value: wml-tensorflow-definition
- name: run_name
value: wml-tensorflow-run
- name: runtime
value: python
- name: runtime_version
value: '3.6'
- name: scoring_payload
value: tf-mnist-test-payload.json
- name: train_code
value: tf-model.zip
pipelineSpec:
params:
- name: CONFIG_FILE_URL
default: https://raw.githubusercontent.com/user/repository/branch/creds.ini
- name: GITHUB_TOKEN
default: ''
- name: compute_name
default: k80
- name: compute_nodes
default: '1'
- name: execution_command
default: '''python3 convolutional_network.py --trainImagesFile ${DATA_DIR}/train-images-idx3-ubyte.gz
--trainLabelsFile ${DATA_DIR}/train-labels-idx1-ubyte.gz --testImagesFile
${DATA_DIR}/t10k-images-idx3-ubyte.gz --testLabelsFile ${DATA_DIR}/t10k-labels-idx1-ubyte.gz
--learningRate 0.001 --trainingIters 20000'''
- name: framework
default: tensorflow
- name: framework_version
default: '1.15'
- name: model_name
default: wml-tensorflow-mnist
- name: run_definition
default: wml-tensorflow-definition
- name: run_name
default: wml-tensorflow-run
- name: runtime
default: python
- name: runtime_version
default: '3.6'
- name: scoring_payload
default: tf-mnist-test-payload.json
- name: train_code
default: tf-model.zip
tasks:
- name: create-secret-kubernetes-cluster
params:
- name: CONFIG_FILE_URL
value: $(params.CONFIG_FILE_URL)
- name: GITHUB_TOKEN
value: $(params.GITHUB_TOKEN)
taskSpec:
steps:
- name: main
args:
- /app/config.py
- --token
- $(inputs.params.GITHUB_TOKEN)
- --url
- $(inputs.params.CONFIG_FILE_URL)
- --name
- kfp-creds
- --output-secret-name-file
- $(results.secret-name.path)
command:
- python3
image: docker.io/aipipeline/wml-config:latest
params:
- name: CONFIG_FILE_URL
- name: GITHUB_TOKEN
results:
- name: secret-name
description: /tmp/outputs/secret_name/data
metadata:
labels:
pipelines.kubeflow.org/pipelinename: ''
pipelines.kubeflow.org/generation: ''
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
pipelines.kubeflow.org/component_spec_digest: '{"name": "Create Secret
- Kubernetes Cluster", "outputs": [{"description": "Kubernetes secret
name", "name": "secret_name"}], "version": "Create Secret - Kubernetes
Cluster@sha256=902baeb855ce424cc0efea20e61f1b51acfad6cdcaef65ca9f3e9e503a5bbae6"}'
tekton.dev/template: ''
timeout: 525600m
- name: train-model-watson-machine-learning
params:
- name: compute_name
value: $(params.compute_name)
- name: compute_nodes
value: $(params.compute_nodes)
- name: create-secret-kubernetes-cluster-secret_name
value: $(tasks.create-secret-kubernetes-cluster.results.secret-name)
- name: execution_command
value: $(params.execution_command)
- name: framework
value: $(params.framework)
- name: framework_version
value: $(params.framework_version)
- name: run_definition
value: $(params.run_definition)
- name: run_name
value: $(params.run_name)
- name: runtime
value: $(params.runtime)
- name: runtime_version
value: $(params.runtime_version)
- name: train_code
value: $(params.train_code)
taskSpec:
steps:
- name: main
args:
- -u
- /app/wml-train.py
- --config
- $(inputs.params.create-secret-kubernetes-cluster-secret_name)
- --train-code
- $(inputs.params.train_code)
- --execution-command
- $(inputs.params.execution_command)
- --framework
- $(inputs.params.framework)
- --framework-version
- $(inputs.params.framework_version)
- --runtime
- $(inputs.params.runtime)
- --runtime-version
- $(inputs.params.runtime_version)
- --run-definition
- $(inputs.params.run_definition)
- --run-name
- $(inputs.params.run_name)
- --author-name
- default-author
- --compute-name
- $(inputs.params.compute_name)
- --compute-nodes
- $(inputs.params.compute_nodes)
- --output-run-uid-path
- $(results.run-uid.path)
- --output-training-uid-path
- $(results.training-uid.path)
command:
- python3
image: docker.io/aipipeline/wml-train:latest
imagePullPolicy: Always
volumeMounts:
- mountPath: /app/secrets
name: kfp-creds
params:
- name: compute_name
- name: compute_nodes
- name: create-secret-kubernetes-cluster-secret_name
- name: execution_command
- name: framework
- name: framework_version
- name: run_definition
- name: run_name
- name: runtime
- name: runtime_version
- name: train_code
results:
- name: run-uid
description: /tmp/outputs/run_uid/data
- name: training-uid
description: /tmp/outputs/training_uid/data
volumes:
- name: kfp-creds
secret:
secretName: kfp-creds
metadata:
labels:
pipelines.kubeflow.org/pipelinename: ''
pipelines.kubeflow.org/generation: ''
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
platform: IBM Watson Machine Learning
pipelines.kubeflow.org/component_spec_digest: '{"name": "Train Model -
Watson Machine Learning", "outputs": [{"description": "UID for the Watson
Machine Learning training-runs", "name": "run_uid"}, {"description":
"Training Location UID for the Watson Machine Learning training-runs",
"name": "training_uid"}], "version": "Train Model - Watson Machine Learning@sha256=b4c691df9f8a58439e3b232f23da34c30695dd93d8f3d79954142f185d377c7a"}'
tekton.dev/template: ''
timeout: 525600m
- name: store-model-watson-machine-learning
params:
- name: framework
value: $(params.framework)
- name: framework_version
value: $(params.framework_version)
- name: model_name
value: $(params.model_name)
- name: runtime_version
value: $(params.runtime_version)
- name: train-model-watson-machine-learning-run_uid
value: $(tasks.train-model-watson-machine-learning.results.run-uid)
taskSpec:
steps:
- name: main
args:
- -u
- /app/wml-store.py
- --run-uid
- $(inputs.params.train-model-watson-machine-learning-run_uid)
- --model-name
- $(inputs.params.model_name)
- --framework
- $(inputs.params.framework)
- --framework-version
- $(inputs.params.framework_version)
- --runtime-version
- $(inputs.params.runtime_version)
- --output-model-uid-path
- $(results.model-uid.path)
command:
- python3
image: docker.io/aipipeline/wml-store:latest
imagePullPolicy: Always
volumeMounts:
- mountPath: /app/secrets
name: kfp-creds
params:
- name: framework
- name: framework_version
- name: model_name
- name: runtime_version
- name: train-model-watson-machine-learning-run_uid
results:
- name: model-uid
description: /tmp/outputs/model_uid/data
volumes:
- name: kfp-creds
secret:
secretName: kfp-creds
metadata:
labels:
pipelines.kubeflow.org/pipelinename: ''
pipelines.kubeflow.org/generation: ''
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
platform: IBM Watson Machine Learning
pipelines.kubeflow.org/component_spec_digest: '{"name": "Store model -
Watson Machine Learning", "outputs": [{"description": "UID for the stored
model on Watson Machine Learning", "name": "model_uid"}], "version":
"Store model - Watson Machine Learning@sha256=feee7b0338b0e788c49b6b5f2b9c10f1f129ce1483aa99d349297236d830353c"}'
tekton.dev/template: ''
timeout: 525600m
- name: deploy-model-watson-machine-learning
params:
- name: model_name
value: $(params.model_name)
- name: scoring_payload
value: $(params.scoring_payload)
- name: store-model-watson-machine-learning-model_uid
value: $(tasks.store-model-watson-machine-learning.results.model-uid)
taskSpec:
steps:
- name: main
args:
- -u
- /app/wml-deploy.py
- --model-uid
- $(inputs.params.store-model-watson-machine-learning-model_uid)
- --model-name
- $(inputs.params.model_name)
- --scoring-payload
- $(inputs.params.scoring_payload)
- --deployment-name
- ''
- --output-scoring-endpoint-path
- $(results.scoring-endpoint.path)
- --output-model-uid-path
- $(results.model-uid.path)
command:
- python
image: docker.io/aipipeline/wml-deploy:latest
imagePullPolicy: Always
volumeMounts:
- mountPath: /app/secrets
name: kfp-creds
params:
- name: model_name
- name: scoring_payload
- name: store-model-watson-machine-learning-model_uid
results:
- name: scoring-endpoint
description: /tmp/outputs/scoring_endpoint/data
- name: model-uid
description: /tmp/outputs/model_uid/data
volumes:
- name: kfp-creds
secret:
secretName: kfp-creds
metadata:
labels:
pipelines.kubeflow.org/pipelinename: ''
pipelines.kubeflow.org/generation: ''
pipelines.kubeflow.org/cache_enabled: "true"
annotations:
platform: IBM Watson Machine Learning
pipelines.kubeflow.org/component_spec_digest: '{"name": "Deploy Model
- Watson Machine Learning", "outputs": [{"description": "Link to the
deployed model web service", "name": "scoring_endpoint"}, {"description":
"UID for the stored model on Watson Machine Learning", "name": "model_uid"}],
"version": "Deploy Model - Watson Machine Learning@sha256=11bfa9e2fe70d7acd77dfe31505d1aa230570f326c6b55ef7fa691216b8f0bcd"}'
tekton.dev/template: ''
timeout: 525600m
timeout: 525600m