-
Notifications
You must be signed in to change notification settings - Fork 0
315 lines (297 loc) · 14 KB
/
run_all.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
309
310
311
312
313
314
315
name: Run Benchmarks
on:
workflow_dispatch:
inputs:
root_dir:
description: "Enter the root directory for benchmarks"
required: true
default: "/root/benchmarks/"
date:
description: "Enter a date (optional, e.g. 20240101)"
required: false
default: ""
clients:
description: 'Enter clients to use (e.g., [nethermind,geth,reth,erigon,besu])'
required: true
default: '[nethermind,geth,reth,erigon,besu]'
sizes:
description: "Enter sizes (e.g., [500,1000])"
required: false
default: "[500,1000]"
repetitions:
description: "Enter the number of repetitions"
required: true
default: 8
schedule:
- cron: '0 0 * * 1,3,5'
jobs:
setup-environment:
runs-on: ubuntu-latest
env:
ROOT_DIR: ${{ github.event.inputs.root_dir || '/root/benchmarks/' }}
DATE: ${{ github.event.inputs.date || '' }}
CLIENTS: ${{ github.event.inputs.clients || '["nethermind","geth","reth","erigon","besu"]' }}
SIZES: ${{ github.event.inputs.sizes || '[500,1000]' }}
REPETITIONS: ${{ github.event.inputs.repetitions || 8 }}
outputs:
date: ${{ steps.set-date.outputs.date }}
root_dir: ${{ steps.set-date.outputs.root_dir }}
clients: ${{ steps.set-date.outputs.clients }}
sizes: ${{ steps.set-date.outputs.sizes }}
repetitions: ${{ steps.set-date.outputs.repetitions }}
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVKEY }}
- name: Set DATE variable
id: set-date
run: |
if [ -z "${{ env.DATE }}" ]; then
DATE=$(date +%Y%m%d)
else
DATE=${{ env.DATE }}
fi
echo "date=${DATE}" >> $GITHUB_OUTPUT
echo "root_dir=${{ env.ROOT_DIR }}" >> $GITHUB_OUTPUT
echo "clients=${{ env.CLIENTS }}" >> $GITHUB_OUTPUT
echo "sizes=${{ env.SIZES }}" >> $GITHUB_OUTPUT
echo "repetitions=${{ env.REPETITIONS }}" >> $GITHUB_OUTPUT
- name: Clone benchmarks repos
run: |
BRANCH_BENCHMARKS_DATA_RESULT=main
BRANCH_GAS_BENCHMARKS=rc-1
BRANCH_BURNTPIX_BENCHMARKS=burnt-rc-1
BRANCH_GENESIS_INIT_BENCHMARKS=main
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
mkdir -p "${{ env.ROOT_DIR }}"
cd "${{ env.ROOT_DIR }}"
git clone -b $BRANCH_BENCHMARKS_DATA_RESULT https://${{ secrets.GIT_TOEKN_PREFIX }}@github.com/OpenFusionist/benchmarks-data-results.git benchmarks-data-result
git clone -b $BRANCH_GAS_BENCHMARKS https://github.com/OpenFusionist/gas-benchmarks.git gas-benchmarks
git clone -b $BRANCH_BURNTPIX_BENCHMARKS https://github.com/OpenFusionist/gas-benchmarks.git burntpix-benchmarks
git clone -b $BRANCH_GENESIS_INIT_BENCHMARKS https://github.com/OpenFusionist/genesis-init-benchmarks.git genesis-init-benchmarks
cd "${{ env.ROOT_DIR }}/benchmarks-data-result"
git switch $BRANCH_BENCHMARKS_DATA_RESULT
cd "${{ env.ROOT_DIR }}/gas-benchmarks"
git switch $BRANCH_GAS_BENCHMARKS
cd "${{ env.ROOT_DIR }}/burntpix-benchmarks"
git switch $BRANCH_BURNTPIX_BENCHMARKS
cd "${{ env.ROOT_DIR }}/genesis-init-benchmarks"
git switch $BRANCH_GENESIS_INIT_BENCHMARKS
set -e
EOF
- name: Stop existing benchmarks and prepare environment
run: |
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
cd "${{ env.ROOT_DIR }}/benchmarks-data-result"
git pull
./stop.sh
python3 ./update_time.py "${{ env.DATE }}"
cat ./date.json
set -e
EOF
generate-matrix:
runs-on: ubuntu-latest
needs: setup-environment
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
date: ${{ needs.setup-environment.outputs.date }}
root_dir: ${{ needs.setup-environment.outputs.root_dir }}
clients: ${{ needs.setup-environment.outputs.clients }}
sizes: ${{ needs.setup-environment.outputs.sizes }}
repetitions: ${{ needs.setup-environment.outputs.repetitions }}
steps:
- name: Check Date
id: check-date
run: |
if [ -z "${{ needs.setup-environment.outputs.date }}" ]; then
echo "Date is empty, exiting the job."
exit 1
fi
- name: Generate Matrix
id: generate-matrix
run: |
CLIENTS='${{ needs.setup-environment.outputs.clients }}'
SIZES='${{ needs.setup-environment.outputs.sizes }}'
echo "CLIENTS=${CLIENTS}"
echo "SIZES=${SIZES}"
CLIENTS_JSON=$(echo "$CLIENTS" | sed 's/[][]//g' | jq -R 'split(",")')
SIZES_JSON=$(echo "$SIZES" | sed 's/[][]//g' | jq -R 'split(",") | map(tonumber)')
MATRIX_CLIENTS=$(echo '{}' | jq -c --argjson clients "$CLIENTS_JSON" '.Client = $clients')
MATRIX=$(echo $MATRIX_CLIENTS | jq -c --argjson sizes "$SIZES_JSON" '.Size = $sizes')
echo "Updated MATRIX=${MATRIX}"
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
run-gas-benchmarks:
runs-on: ubuntu-latest
needs: generate-matrix
outputs:
matrix: ${{ needs.generate-matrix.outputs.matrix }}
date: ${{ needs.generate-matrix.outputs.date }}
root_dir: ${{ needs.generate-matrix.outputs.root_dir }}
clients: ${{ needs.generate-matrix.outputs.clients }}
sizes: ${{ needs.generate-matrix.outputs.sizes }}
repetitions: ${{ needs.generate-matrix.outputs.repetitions }}
strategy:
max-parallel: 1
matrix:
client: ${{ fromJson(needs.generate-matrix.outputs.matrix).client }}
fail-fast: false
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVKEY }}
- name: Run benchmarks
run: |
CLIENT=${{ matrix.client }}
REPETITIONS=${{ needs.generate-matrix.outputs.repetitions }}
ROOT_DIR=${{ needs.generate-matrix.outputs.root_dir }}
DATE=${{ needs.generate-matrix.outputs.date }}
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
echo "=== Run gas benchmarks for client: $CLIENT and date: $DATE ==="
cd "$ROOT_DIR/gas-benchmarks"
git pull
cp ../benchmarks-data-result/images.yaml .
./run.sh -t "tests/" -w "warmup/warmup-1000bl-16wi-24tx.txt" -c "$CLIENT" -r "$REPETITIONS" -o "results-$DATE"
python3 report_metadata.py "$DATE"
cp "results-$DATE/reports/index.html" "../benchmarks-data-result/gas/$DATE.html"
cp "results-$DATE/reports/result.json" "../benchmarks-data-result/gas/$DATE.json"
cp "results-$DATE/reports/metadata.json" "../benchmarks-data-result/gas/$DATE.metadata.json"
set -e
EOF
run-genesis-init-speed-benchmarks:
runs-on: ubuntu-latest
needs: run-gas-benchmarks
outputs:
matrix: ${{ needs.run-gas-benchmarks.outputs.matrix }}
date: ${{ needs.run-gas-benchmarks.outputs.date }}
root_dir: ${{ needs.run-gas-benchmarks.outputs.root_dir }}
clients: ${{ needs.run-gas-benchmarks.outputs.clients }}
sizes: ${{ needs.run-gas-benchmarks.outputs.sizes }}
repetitions: ${{ needs.run-gas-benchmarks.outputs.repetitions }}
strategy:
max-parallel: 1
matrix: ${{ fromJson(needs.run-gas-benchmarks.outputs.matrix) }}
fail-fast: false
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVKEY }}
- name: Run genesis init speed benchmarks
run: |
CLIENT=${{ matrix.client }}
SIZE=${{ matrix.size }}
REPETITIONS=${{ needs.run-gas-benchmarks.outputs.repetitions }}
ROOT_DIR=${{ needs.run-gas-benchmarks.outputs.root_dir }}
DATE=${{ needs.run-gas-benchmarks.outputs.date }}
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
echo "=== Run genesis init speed benchmarks for client: $CLIENT with size: $SIZE and date: $DATE ==="
cd "$ROOT_DIR/genesis-init-benchmarks"
git pull
cp ../benchmarks-data-result/images.yaml .
./runSpeed.sh -t "tests/" -c "$CLIENT" -r "$REPETITIONS" -o "results-$DATE/speed" -s "$SIZE"
python3 report_metadata.py "$DATE" speed
cp "results-$DATE/speed/reports/speed.html" "../benchmarks-data-result/genesis-data/$DATE.speed.html"
cp "results-$DATE/speed/reports/speed.json" "../benchmarks-data-result/genesis-data/$DATE.speed.json"
cp "results-$DATE/speed/reports/metadata.json" "../benchmarks-data-result/genesis-data/$DATE.metadata.json"
set -e
EOF
run-genesis-init-memory-benchmarks:
runs-on: ubuntu-latest
needs: run-genesis-init-speed-benchmarks
outputs:
matrix: ${{ needs.run-genesis-init-speed-benchmarks.outputs.matrix }}
date: ${{ needs.run-genesis-init-speed-benchmarks.outputs.date }}
root_dir: ${{ needs.run-genesis-init-speed-benchmarks.outputs.root_dir }}
clients: ${{ needs.run-genesis-init-speed-benchmarks.outputs.clients }}
sizes: ${{ needs.run-genesis-init-speed-benchmarks.outputs.sizes }}
repetitions: ${{ needs.run-genesis-init-speed-benchmarks.outputs.repetitions }}
strategy:
max-parallel: 1
matrix: ${{ fromJson(needs.run-genesis-init-speed-benchmarks.outputs.matrix) }}
fail-fast: false
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVKEY }}
- name: Run genesis init memory benchmarks
run: |
CLIENT=${{ matrix.client }}
SIZE=${{ matrix.size }}
REPETITIONS=${{ needs.run-genesis-init-speed-benchmarks.outputs.repetitions }}
ROOT_DIR=${{ needs.run-genesis-init-speed-benchmarks.outputs.root_dir }}
DATE=${{ needs.run-genesis-init-speed-benchmarks.outputs.date }}
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
echo "=== Run genesis init memory benchmarks for client: $CLIENT with size: $SIZE and date: $DATE ==="
cd "$ROOT_DIR/genesis-init-benchmarks"
git pull
cp ../benchmarks-data-result/images.yaml .
./runMemory.sh -t "tests/" -c "$CLIENT" -r "$REPETITIONS" -o "results-$DATE/memory" -s "$SIZE"
python3 report_metadata.py "$DATE" memory
cp "results-$DATE/memory/reports/memory.html" "../benchmarks-data-result/genesis-data/$DATE.memory.html"
cp "results-$DATE/memory/reports/memory.json" "../benchmarks-data-result/genesis-data/$DATE.memory.json"
cp "results-$DATE/memory/reports/metadata.json" "../benchmarks-data-result/genesis-data/$DATE.metadata.json"
python3 merge_result.py "$DATE"
cp "results-$DATE/result.json" "../benchmarks-data-result/genesis-data/$DATE.json"
set -e
EOF
run-burntpix-benchmarks:
runs-on: ubuntu-latest
needs: run-genesis-init-memory-benchmarks
outputs:
matrix: ${{ needs.run-genesis-init-memory-benchmarks.outputs.matrix }}
date: ${{ needs.run-genesis-init-memory-benchmarks.outputs.date }}
root_dir: ${{ needs.run-genesis-init-memory-benchmarks.outputs.root_dir }}
clients: ${{ needs.run-genesis-init-memory-benchmarks.outputs.clients }}
sizes: ${{ needs.run-genesis-init-memory-benchmarks.outputs.sizes }}
repetitions: ${{ needs.run-genesis-init-memory-benchmarks.outputs.repetitions }}
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVKEY }}
- name: Run burntpix benchmarks
run: |
# Use const due to can't handle ${{ needs.run-genesis-init-memory-benchmarks.outputs.clients }}
CLIENT="nethermind,geth,reth,erigon,besu"
REPETITIONS=${{ needs.run-genesis-init-memory-benchmarks.outputs.repetitions }}
ROOT_DIR=${{ needs.run-genesis-init-memory-benchmarks.outputs.root_dir }}
DATE=${{ needs.run-genesis-init-memory-benchmarks.outputs.date }}
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
echo "=== Run burntpix benchmarks for client: $CLIENT with date: $DATE ==="
cd "$ROOT_DIR/burntpix-benchmarks"
git pull
cp ../benchmarks-data-result/images.yaml .
./run.sh -t "testburnt/" -w "./testburntwarm/warm.txt" -c "$CLIENT" -r "$REPETITIONS" -o "results-$DATE"
python3 report_metadata.py "$DATE"
cp "results-$DATE/reports/index.html" "../benchmarks-data-result/burntpix/$DATE.html"
cp "results-$DATE/reports/result.json" "../benchmarks-data-result/burntpix/$DATE.json"
cp "results-$DATE/reports/metadata.json" "../benchmarks-data-result/burntpix/$DATE.metadata.json"
set -e
EOF
push-results:
runs-on: ubuntu-latest
needs: run-burntpix-benchmarks
steps:
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.PRIVKEY }}
- name: Push results
run: |
ROOT_DIR=${{ needs.run-burntpix-benchmarks.outputs.root_dir }}
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=60 root@${{ secrets.REMOTE_IP }} << EOF
set +e
cd "$ROOT_DIR/benchmarks-data-result"
git status
./push.sh
set -e
EOF