-
Notifications
You must be signed in to change notification settings - Fork 23
153 lines (129 loc) · 4.99 KB
/
e2e-corral.yml
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
# 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: Corral (word count) Benchmark
# > 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: word_count
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 1'
push:
branches: [ main ]
paths:
- 'benchmarks/corral/*'
- 'utils/*'
pull_request:
branches: [ main ]
paths:
- 'benchmarks/corral/*'
- 'utils/*'
env:
GOOS: linux
GO111MODULE: on
KUBECONFIG: /etc/kubernetes/admin.conf
jobs:
push:
name: Push Docker Image
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
file: benchmarks/corral/Dockerfile
push: true
tags: vhiveease/word_count:volatile
test:
name: Test
needs: push
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@v4
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Configure AWS credentials using EASE lab account
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-region: us-west-1
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
- name: Install AWS CLI
shell: bash
run: |
set -x
if ! command -v aws &> /dev/null
then
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -qq awscliv2.zip
sudo ./aws/install
fi
- name: Apply
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
working-directory: benchmarks/corral/knative_yamls
run: |
set -x
kn service apply --wait-timeout 60 --filename worker.yml --env AWS_REGION=us-west-1 --env AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" --env AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" || { kubectl describe ksvc/word-count-worker; exit 1; }
kn service apply --wait-timeout 60 --filename driver.yml --env AWS_REGION=us-west-1 --env AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" --env AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" || { kubectl describe ksvc/word-count-driver; exit 1; }
- name: Test
run: ./tools/bin/grpcurl -max-time 180 -plaintext word-count-driver.default.127.0.0.1.nip.io:31080 helloworld.Greeter.SayHello
- name: Print logs
if: ${{ always() }}
run: |
set -x
kubectl logs -c user-container -l serving.knative.dev/service=word-count-worker
kubectl logs -c user-container -l serving.knative.dev/service=word-count-driver
- name: Verify
working-directory: benchmarks/corral
run: |
aws s3 cp s3://vhive-corral-bench/word_count/vhive-ubench/out/output-part-0 - | LC_ALL=C sort - | cmp expected-sorted-output.txt -
- name: Cleaning
if: ${{ always() }}
run: |
kn service delete --all --namespace default --wait
- name: Clean up S3
if: ${{ always() }}
run: |
aws s3 rm s3://vhive-corral-bench/word_count/vhive-ubench/out --recursive