This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
308 lines (307 loc) · 12.8 KB
/
benchmark_group_2_multi.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
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
name: benchmark-group-2-multi
on: [pull_request, push]
jobs:
start-benchmark-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
benchmark-label: ${{ steps.start-benchmark-ec2-runner.outputs.label }}
benchmark-ec2-instance-id: ${{ steps.start-benchmark-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start Benchmark EC2 runner
id: start-benchmark-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0a1fee7d1926e55ce
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
start-server-1-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
server-label: ${{ steps.start-server-ec2-runner.outputs.label }}
server-ec2-instance-id: ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }}
private-ip: ${{ steps.get-private-ip.outputs.private-ip }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start Server EC2 runner
id: start-server-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0a1fee7d1926e55ce
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
- name: Get private IP address
id: get-private-ip
run: |
echo "private-ip=$(aws ec2 describe-instances \
--instance-id ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }} \
--query 'Reservations[0].Instances[0].PrivateIpAddress' | tr -d '"')" \
>> $GITHUB_OUTPUT
start-server-2-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
server-label: ${{ steps.start-server-ec2-runner.outputs.label }}
server-ec2-instance-id: ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }}
private-ip: ${{ steps.get-private-ip.outputs.private-ip }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start Server EC2 runner
id: start-server-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0a1fee7d1926e55ce
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
- name: Get private IP address
id: get-private-ip
run: |
echo "private-ip=$(aws ec2 describe-instances \
--instance-id ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }} \
--query 'Reservations[0].Instances[0].PrivateIpAddress' | tr -d '"')" \
>> $GITHUB_OUTPUT
start-server-3-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
server-label: ${{ steps.start-server-ec2-runner.outputs.label }}
server-ec2-instance-id: ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }}
private-ip: ${{ steps.get-private-ip.outputs.private-ip }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start Server EC2 runner
id: start-server-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0a1fee7d1926e55ce
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
- name: Get private IP address
id: get-private-ip
run: |
echo "private-ip=$(aws ec2 describe-instances \
--instance-id ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }} \
--query 'Reservations[0].Instances[0].PrivateIpAddress' | tr -d '"')" \
>> $GITHUB_OUTPUT
run-server-1:
name: Start the ISTZIIO server 1
needs:
- start-server-1-runner
- start-server-2-runner
- start-server-3-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-server-1-runner.outputs.server-label }} # run the job on the newly created runner
env:
SERVER_ROOT: ${{ github.workspace }}/server
AWS_ACCESS_KEY_ID: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
SERVER_IP: ${{ needs.start-server-1-runner.outputs.private-ip }}
NODE_1_IP: ${{ needs.start-server-1-runner.outputs.private-ip }}
NODE_2_IP: ${{ needs.start-server-2-runner.outputs.private-ip }}
NODE_3_IP: ${{ needs.start-server-3-runner.outputs.private-ip }}
steps:
- name: Clone Server
uses: actions/checkout@v4
with:
repository: cmu-db/15721-s24-cache2
ref: main
- name: Build Server
run: |
cargo build --bin istziio_server_node
- name: start server nodes
run: ${{ github.workspace }}/server/run_single_node.sh
- name: wait for server completing setups
run: |
sleep 5
cat ${{ github.workspace }}/logs/app_6379.log
- name: spin
run: sleep 60
- name: Server shut down and log
run: cat ${{ github.workspace }}/logs/app_6379.log
run-server-2:
name: Start the ISTZIIO server 2
needs:
- start-server-1-runner
- start-server-2-runner
- start-server-3-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-server-2-runner.outputs.server-label }} # run the job on the newly created runner
env:
SERVER_ROOT: ${{ github.workspace }}/server
AWS_ACCESS_KEY_ID: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
SERVER_IP: ${{ needs.start-server-2-runner.outputs.private-ip }}
NODE_1_IP: ${{ needs.start-server-1-runner.outputs.private-ip }}
NODE_2_IP: ${{ needs.start-server-2-runner.outputs.private-ip }}
NODE_3_IP: ${{ needs.start-server-3-runner.outputs.private-ip }}
steps:
- name: Clone Server
uses: actions/checkout@v4
with:
repository: cmu-db/15721-s24-cache2
ref: main
- name: Build Server
run: |
cargo build --bin istziio_server_node
- name: start server nodes
run: ${{ github.workspace }}/server/run_single_node.sh
- name: wait for server completing setups
run: |
sleep 5
cat ${{ github.workspace }}/logs/app_6379.log
- name: spin
run: sleep 60
- name: Server shut down and log
run: cat ${{ github.workspace }}/logs/app_6379.log
run-server-3:
name: Start the ISTZIIO server 3
needs:
- start-server-1-runner
- start-server-2-runner
- start-server-3-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-server-3-runner.outputs.server-label }} # run the job on the newly created runner
env:
SERVER_ROOT: ${{ github.workspace }}/server
AWS_ACCESS_KEY_ID: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
SERVER_IP: ${{ needs.start-server-3-runner.outputs.private-ip }}
NODE_1_IP: ${{ needs.start-server-1-runner.outputs.private-ip }}
NODE_2_IP: ${{ needs.start-server-2-runner.outputs.private-ip }}
NODE_3_IP: ${{ needs.start-server-3-runner.outputs.private-ip }}
steps:
- name: Clone Server
uses: actions/checkout@v4
with:
repository: cmu-db/15721-s24-cache2
ref: main
- name: Build Server
run: |
cargo build --bin istziio_server_node
- name: start server nodes
run: ${{ github.workspace }}/server/run_single_node.sh -c
- name: wait for server completing setups
run: |
sleep 5
cat ${{ github.workspace }}/logs/app_6379.log
- name: spin
run: sleep 60
- name: Server shut down and log
run: cat ${{ github.workspace }}/logs/app_6379.log
run-benchmark:
name: Run Benchmark
needs:
- start-server-1-runner
- start-server-2-runner
- start-server-3-runner
- start-benchmark-runner
runs-on: ${{ needs.start-benchmark-runner.outputs.benchmark-label }} # run the job on the newly created runner
env:
SERVER_URL: http://${{ needs.start-server-1-runner.outputs.private-ip }}:26379
SERVER_1_URL: http://${{ needs.start-server-1-runner.outputs.private-ip }}:26379
SERVER_2_URL: http://${{ needs.start-server-2-runner.outputs.private-ip }}:26379
SERVER_3_URL: http://${{ needs.start-server-3-runner.outputs.private-ip }}:26379
steps:
- name: Clone Server
uses: actions/checkout@v4
- name: Build Benchmark driver
run: cargo build
- name: Wait for server 1
run: |
until curl --output /dev/null --silent --head --fail $SERVER_1_URL/; do
printf '.'
sleep 5
done
- name: Wait for server 2
run: |
until curl --output /dev/null --silent --head --fail $SERVER_2_URL/; do
printf '.'
sleep 5
done
- name: Wait for server 3
run: |
until curl --output /dev/null --silent --head --fail $SERVER_3_URL/; do
printf '.'
sleep 5
done
- name: Run Benchmark
run: cargo run
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-benchmark-runner
- start-server-1-runner
- start-server-2-runner
- start-server-3-runner # required to get output from the start-runner job
- run-server-1
- run-server-2
- run-server-3
- run-benchmark
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Stop Server 1 EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-server-1-runner.outputs.server-label }}
ec2-instance-id: ${{ needs.start-server-1-runner.outputs.server-ec2-instance-id }}
- name: Stop Server 2 EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-server-2-runner.outputs.server-label }}
ec2-instance-id: ${{ needs.start-server-2-runner.outputs.server-ec2-instance-id }}
- name: Stop Server 3 EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-server-3-runner.outputs.server-label }}
ec2-instance-id: ${{ needs.start-server-3-runner.outputs.server-ec2-instance-id }}
- name: Stop Benchmark EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-benchmark-runner.outputs.benchmark-label }}
ec2-instance-id: ${{ needs.start-benchmark-runner.outputs.benchmark-ec2-instance-id }}