forked from vhive-serverless/vHive
-
Notifications
You must be signed in to change notification settings - Fork 1
363 lines (309 loc) · 11.4 KB
/
Copy pathfunction-composition.yml
File metadata and controls
363 lines (309 loc) · 11.4 KB
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
# MIT License
#
# Copyright (c) 2021 Mert Bora Alper and EASE lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: Function Composition Benchmarks
# > Concurrency ensures that only a single job or workflow using the
# > same concurrency group will run at a time.
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
#
# Since we are using Docker Hub for our images, this helps us prevent
# concurrency bugs related to using the same image:tag across different
# CI pipelines.
concurrency: function-composition
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
GOOS: linux
GO111MODULE: on
KUBECONFIG: /etc/kubernetes/admin.conf
jobs:
push-base-images:
name: Push Base Images
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
image:
- golang-builder
- runner
- python-slim
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./configs/docker-images/${{ matrix.image }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.image }}:latest
push-chained-functions-serving:
name: Push chained-functions-serving
needs: push-base-images
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
working-directory: ./function-images/tests/chained-function-serving
env:
GOPRIVATE_KEY: ${{ secrets.EASE_LAB_ACCESS_KEY }}
run: |
make all-image
make all-image-push
push-chained-functions-eventing:
name: Push chained-functions-eventing
needs: push-base-images
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
working-directory: ./function-images/tests/chained-function-eventing
run: make push-all
push-video-analytics:
name: Push video-analytics
needs: push-base-images
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
working-directory: ./function-images/tests/video-analytics
env:
GOPRIVATE_KEY: ${{ secrets.EASE_LAB_ACCESS_KEY }}
run: make all-image-push
bench-docker-compose-serving:
name: Serving uBenchmark (docker-compose)
needs: push-chained-functions-serving
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: start multi-container program with docker-compose
working-directory: function-images/tests/chained-function-serving
run: |
docker-compose up &> log_file &
sleep 15s
- name: invoke the chain
run: |
./bin/grpcurl -max-time 10 -plaintext localhost:3031 helloworld.Greeter.SayHello
- name: show docker-compose log
if: ${{ always() }}
run: cat function-images/tests/chained-function-serving/log_file
bench-serving:
name: Serving uBenchmark (Knative)
needs: push-chained-functions-serving
env:
GOCACHE: /root/tmp/gocache
GOPATH: /root/tmp/gopath
TMPDIR: /root/tmp
runs-on: [stock-knative]
strategy:
fail-fast: false
matrix:
transfer-type: [ s3, inline ]
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Start consumer and producer
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: |
./function-images/tests/kn_deploy.sh ./function-images/tests/chained-function-serving/knative_yamls/${{ matrix.transfer-type }}/service*
- name: Call producer
run: |
set -x
NODEPORT=$(kubectl get svc kourier-ingress -n kourier-system -o=jsonpath='{.spec.ports[0].nodePort}')
HOSTNAME=$(kubectl get ksvc producer -n default -o jsonpath='{.status.url}' | cut -c8-)
./bin/grpcurl -max-time 10 -d '{"name": "Michal"}' -plaintext $HOSTNAME:$NODEPORT helloworld.Greeter.SayHello
- name: Print logs
if: ${{ always() }}
run: |
set -x
kubectl logs -n default -c user-container -l serving.knative.dev/service=producer
kubectl logs -n default -c user-container -l serving.knative.dev/service=consumer
- name: Cleaning
if: ${{ always() }}
run: |
kn service delete --all --namespace default --wait
bench-eventing:
name: Eventing uBenchmark (Knative)
needs: push-chained-functions-eventing
env:
GOCACHE: /root/tmp/gocache
GOPATH: /root/tmp/gopath
TMPDIR: /root/tmp
runs-on: [stock-knative]
strategy:
fail-fast: false
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Apply
run: ./function-images/tests/chained-function-eventing/manifests/apply.sh && sleep 30
- name: Describe
run: |
set -x
kubectl get -n chained-functions-eventing broker
kubectl get -n chained-functions-eventing sinkbinding
kubectl get -n chained-functions-eventing ksvc
kubectl get -n chained-functions-eventing trigger
- name: grpcurl
run: |
set -x
NODEPORT=$(kubectl get svc kourier-ingress -n kourier-system -o=jsonpath='{.spec.ports[0].nodePort}')
HOSTNAME=$(kubectl get ksvc producer -n chained-functions-eventing -o jsonpath='{.status.url}' | cut -c8-)
./bin/grpcurl -max-time 10 -d '{"name": "Bora", "vHiveMetadata": "eyAiV29ya2Zsb3dJZCI6ICJXRklEIiwgIkludm9jYXRpb25JZCI6ICJJVklEIiwgIkludm9rZWRPbiI6ICIyMDIxLTA3LTEzVDA5OjM4OjE3Ljc5OTI3NzE0Mi0wNDowMCIgfQ=="}' -plaintext $HOSTNAME:$NODEPORT helloworld.Greeter.SayHello
- name: Print logs
if: ${{ always() }}
run: |
set -x
kubectl logs -n chained-functions-eventing -c user-container -l serving.knative.dev/service=producer
kubectl logs -n chained-functions-eventing -c user-container -l serving.knative.dev/service=consumer
kubectl logs -n chained-functions-eventing svc/timeseriesdb
- name: Cleaning
if: ${{ always() }}
run: ./function-images/tests/chained-function-eventing/manifests/delete.sh
bench-video-compose:
name: Video Analytics (docker-compose)
needs: push-video-analytics
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
transfer-type: [ s3, inline ]
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: start multi-container program with docker-compose
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: |
cd ./function-images/tests/video-analytics/
docker-compose -f docker-compose-${{ matrix.transfer-type }}.yml up &> log_file &
sleep 1m
- name: invoke the chain
run: |
./bin/grpcurl -plaintext localhost:50051 helloworld.Greeter.SayHello
- name: show docker-compose log
if: ${{ always() }}
run: cat ./function-images/tests/video-analytics/log_file
bench-video-knative:
name: Video analytics benchmark (Knative)
needs: push-video-analytics
env:
GOCACHE: /root/tmp/gocache
GOPATH: /root/tmp/gopath
TMPDIR: /root/tmp
runs-on: [ stock-knative ]
strategy:
fail-fast: false
matrix:
transfer-type: [ s3, inline ]
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR
- uses: actions/checkout@v2
with:
lfs: 'true'
- name: Deploy functions
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: |
./function-images/tests/kn_deploy.sh ./function-images/tests/video-analytics/knative_yamls/${{ matrix.transfer-type }}/service*
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build invoker
working-directory: examples/invoker
run: make invoker
- name: Invoke functions
working-directory: examples/invoker
run: |
set -x
NODEPORT=$(kubectl get svc kourier-ingress -n kourier-system -o=jsonpath='{.spec.ports[0].nodePort}')
HOSTNAME=$(kubectl get ksvc streaming -n default -o jsonpath='{.status.url}' | cut -c8-)
echo '[ { "hostname": "$HOSTNAME" } ]' > endpoints.json
./invoker -port $NODEPORT -dbg
cat rps*lat.csv
- name: Print logs
if: ${{ always() }}
run: |
set -x
kubectl logs -n default -c user-container -l serving.knative.dev/service=streaming
kubectl logs -n default -c user-container -l serving.knative.dev/service=decoder
kubectl logs -n default -c user-container -l serving.knative.dev/service=recog
- name: Cleaning
if: ${{ always() }}
run: |
kn service delete --all --namespace default --wait