Skip to content

Commit 588bb85

Browse files
authored
Add 'serving + webapp only' pipeline; + only training step requires GPUs now (amygdala#28)
1 parent 22869c3 commit 588bb85

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed

ml/kubeflow-pipelines/components/t2t/webapp-launcher/t2tapp-template.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
name: webapp-MODEL_NAME
1010
prefix: /webapp/
1111
rewrite: /
12-
timeout_ms: 300000
12+
timeout_ms: 1200000
1313
service: MODEL_NAME-webappsvc.KUBEFLOW_NAMESPACE:80
1414
name: MODEL_NAME-webappsvc
1515
labels:
@@ -41,9 +41,9 @@ spec:
4141
containers:
4242
- name: MODEL_NAME-webapp
4343
image: gcr.io/google-samples/ml-pipeline-t2tapp
44-
resources:
45-
limits:
46-
nvidia.com/gpu: 1
44+
# resources:
45+
# limits:
46+
# nvidia.com/gpu: 1
4747
imagePullPolicy: Always
4848
env:
4949
- name: TFSERVING_HOST
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
import kfp.dsl as dsl
17+
18+
@dsl.pipeline(
19+
name='Github issue summarization',
20+
description='Demonstrate Tensor2Tensor-based training and TF-Serving'
21+
)
22+
def gh_summ(
23+
project: dsl.PipelineParam=dsl.PipelineParam(name='project', value='YOUR_PROJECT_HERE'),
24+
github_token: dsl.PipelineParam=dsl.PipelineParam(name='github-token', value='YOUR_GITHUB_TOKEN_HERE'),
25+
working_dir: dsl.PipelineParam=dsl.PipelineParam(name='working-dir', value='YOUR_GCS_DIR_HERE'),
26+
):
27+
28+
29+
serve = dsl.ContainerOp(
30+
name = 'serve',
31+
image = 'gcr.io/google-samples/ml-pipeline-kubeflow-tfserve',
32+
arguments = ["--model_name", 'ghsumm-%s' % ('{{workflow.name}}',),
33+
"--model_path", 'gs://aju-dev-demos-codelabs/kubecon/example_t2t_model/model_output/export'
34+
]
35+
)
36+
37+
webapp = dsl.ContainerOp(
38+
name = 'webapp',
39+
image = 'gcr.io/google-samples/ml-pipeline-webapp-launcher',
40+
arguments = ["--model_name", 'ghsumm-%s' % ('{{workflow.name}}',),
41+
"--github_token", github_token]
42+
43+
)
44+
webapp.after(serve)
45+
46+
47+
if __name__ == '__main__':
48+
import kfp.compiler as compiler
49+
compiler.Compiler().compile(gh_summ, __file__ + '.tar.gz')
778 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)