forked from kubeflow/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_image.yaml
129 lines (127 loc) · 4.3 KB
/
build_image.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
# Copyright 2018 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: build-images-
spec:
entrypoint: build-images
arguments:
parameters:
- name: image-build-context-gcs-uri
- name: image-builder-image
value: gcr.io/ml-pipeline-test/image-builder:v20200208-0.1.25-771-g4c571961
- name: api-image
- name: frontend-image
- name: scheduledworkflow-image
- name: persistenceagent-image
templates:
- name: build-images
inputs:
parameters:
- name: api-image
- name: frontend-image
- name: scheduledworkflow-image
- name: persistenceagent-image
steps:
- - name: build-api-server-image
template: build-image
arguments:
parameters:
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: image-name
value: "{{inputs.parameters.api-image}}"
- name: docker-file
value: backend/Dockerfile
- name: build-script
value: backend/build_api_server.sh
- name: build-frontend-image
template: build-image
arguments:
parameters:
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: docker-file
value: frontend/Dockerfile
- name: image-name
value: "{{inputs.parameters.frontend-image}}"
- name: build-scheduledworkflow-image
template: build-image
arguments:
parameters:
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: image-name
value: "{{inputs.parameters.scheduledworkflow-image}}"
- name: docker-file
value: backend/Dockerfile.scheduledworkflow
- name: build-persistenceagent-image
template: build-image
arguments:
parameters:
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: image-name
value: "{{inputs.parameters.persistenceagent-image}}"
- name: docker-file
value: backend/Dockerfile.persistenceagent
# Build image and upload to GCR
- name: build-image
inputs:
parameters:
# GCS URI prefix pointing to a .tar.gz archive of Docker build context
- name: image-build-context-gcs-uri
# The relative code path to the Dockerfile
- name: docker-path
# Name of the Docker file to use. "Dockerfile" by default
- name: docker-file
value: Dockerfile
- name: image-name
- name: build-script
value: ""
outputs:
parameters:
- name: strict-image-name
valueFrom:
path: /outputs/strict-image-name/file
container:
image: "{{workflow.parameters.image-builder-image}}"
imagePullPolicy: 'Always'
args: [
"--image-build-context-gcs-uri", "{{inputs.parameters.image-build-context-gcs-uri}}",
"--docker_path", "{{inputs.parameters.docker-path}}",
"--docker_file", "{{inputs.parameters.docker-file}}",
"--image_name", "{{inputs.parameters.image-name}}",
"--build_script", "{{inputs.parameters.build-script}}",
]
env:
- name: DOCKER_HOST
value: 127.0.0.1
sidecars:
- name: dind
image: docker:17.10-dind
command:
- dockerd-entrypoint.sh
securityContext:
privileged: true
mirrorVolumeMounts: true