-
Notifications
You must be signed in to change notification settings - Fork 1k
/
workflow.yaml
233 lines (231 loc) · 6.51 KB
/
workflow.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
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: feast-integration-test-
spec:
entrypoint: run
onExit: exit-handler
arguments:
parameters:
- name: revision
value: integration-test
- name: prId
value: "none"
- name: gitRef
value: "none"
templates:
- name: run
steps:
- - name: get-feast
template: get-feast
- - name: build-jars
template: build-jars
arguments:
artifacts:
- name: feast
from: "{{steps.get-feast.outputs.artifacts.feast-repo}}"
- name: build-cli
template: build-cli
arguments:
artifacts:
- name: feast
from: "{{steps.get-feast.outputs.artifacts.feast-repo}}"
- - name: build-push-docker
template: build-docker
arguments:
artifacts:
- name: feast
from: "{{steps.build-jars.outputs.artifacts.feast-build}}"
- - name: terraform-provision
template: terraform
arguments:
parameters:
- name: arg
value: "apply -var docker_tag=integration-test -auto-approve ."
artifacts:
- name: feast
from: "{{steps.get-feast.outputs.artifacts.feast-repo}}"
- name: feast-cli
from: "{{steps.build-cli.outputs.artifacts.feast-cli}}"
- - name: test
template: run-test
arguments:
artifacts:
- name: feast
from: "{{steps.get-feast.outputs.artifacts.feast-repo}}"
- name: feast-cli
from: "{{steps.build-cli.outputs.artifacts.feast-cli}}"
- name: exit-handler
steps:
- - name: terraform-destroy
template: terraform-destroy
arguments:
parameters:
- name: arg
value: "destroy -var docker_tag=integration-test -auto-approve ."
artifacts:
- name: feast
from: "{{workflow.outputs.artifacts.feast-repo}}"
- name: get-feast
steps:
- - name: get-feast-by-pullrequest
template: get-feast-by-pullrequest
when: "{{workflow.parameters.prId}} != none"
- name: get-feast-by-gitref
template: get-feast-by-gitref
when: "{{workflow.parameters.gitRef}} != none"
outputs:
artifacts:
- name: feast-repo
from: "{{workflow.outputs.artifacts.feast-repo}}"
globalName: feast-repo
- name: get-feast-by-pullrequest
container:
image: alpine/git
command:
- /bin/sh
- -c
- |
git clone https://github.com/gojek/feast;
cd feast;
git fetch origin pull/{{workflow.parameters.prId}}/head;
git checkout FETCH_HEAD
outputs:
artifacts:
- name: feast
path: /git/feast
globalName: feast-repo
- name: get-feast-by-gitref
container:
image: alpine/git
command:
- /bin/sh
- -c
- |
git clone https://github.com/gojek/feast;
cd feast;
git checkout {{workflow.parameters.gitRef}}
outputs:
artifacts:
- name: feast
path: /git/feast
globalName: feast-repo
- name: build-jars
inputs:
artifacts:
- name: feast
path: /feast
container:
image: maven:3.6.0-jdk-8-slim
command: ["/bin/bash", "-c"]
args:
- mvn package -DskipTests -Drevision=integration-test -T 6 -DdependencyLocationsEnabled=false
workingDir: /feast
outputs:
artifacts:
- name: feast-build
path: /feast
globalName: feast-build
- name: build-docker
inputs:
artifacts:
- name: feast
path: /feast
container:
image: gcr.io/kf-feast/docker:18.09-gcloud
command: [sh, -c]
args: ['
until docker ps; do sleep 3; done;
docker build -t gcr.io/kf-feast/feast-core:integration-test -f docker/core/Dockerfile --build-arg RELEASE=integration-test .;
docker build -t gcr.io/kf-feast/feast-serving:integration-test -f docker/serving/Dockerfile --build-arg RELEASE=integration-test .;
docker push gcr.io/kf-feast/feast-core:integration-test;
docker push gcr.io/kf-feast/feast-serving:integration-test
']
env:
- name: DOCKER_HOST
value: 127.0.0.1
workingDir: /feast
sidecars:
- name: dind
image: docker:stable-dind
securityContext:
privileged: true
mirrorVolumeMounts: true
- name: build-cli
inputs:
artifacts:
- name: feast
path: /build/feast
container:
image: golang:1.12
command: ["/bin/bash", "-c"]
args:
- |
GOOS=linux go build -o feast-cli-v0.0.0-linux-amd64 ./cli/feast
GOOS=linux go build -o feast-cli-v0.0.0-darwin-amd64 ./cli/feast
# Fix the feast cli binary name for use by subsequent steps
cp feast-cli-v0.0.0-linux-amd64 /usr/local/bin/feast
workingDir: /build/feast
outputs:
artifacts:
- name: feast-cli
path: /usr/local/bin/feast
- name: terraform
inputs:
parameters:
- name: arg
artifacts:
- name: feast
path: /feast
- name: feast-cli
path: /bin/feast
container:
image: gcr.io/kf-feast/it-terraform:0.1.0
workingDir: /feast/testing/integration/tests/redis-bq-dataflow/tf
command: ["sh", "-c"]
args:
- |
terraform init
terraform {{inputs.parameters.arg}}
- name: run-test
inputs:
artifacts:
- name: feast-cli
path: /bin/feast
- name: feast
path: /feast
container:
image: python:3.7.2
command: ["/bin/bash", "-c"]
args: ['
feast config set coreURI 10.128.0.99:6565;
pip install pytest;
pip install -r /feast/sdk/python/test-requirements.txt;
pip install -e /feast/sdk/python;
pytest --capture=no
']
workingDir: /feast/testing/integration/tests/redis-bq-dataflow
env:
- name: FEAST_CORE_URL
value: "10.128.0.99:6565"
- name: FEAST_SERVING_URL
value: "10.128.0.100:6566"
- name: PROJECT_ID
value: kf-feast
- name: BUCKET_NAME
value: it-feast-storage
- name: terraform-destroy
inputs:
parameters:
- name: arg
artifacts:
- name: feast
path: /feast
container:
image: gcr.io/kf-feast/it-terraform:0.1.0
workingDir: /feast/testing/integration/tests/redis-bq-dataflow/tf
command: ["sh", "-c"]
args: ['
terraform init;
terraform {{inputs.parameters.arg}}
']