-
Notifications
You must be signed in to change notification settings - Fork 81
418 lines (370 loc) · 16 KB
/
benchmark-build.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
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: Benchmark Build
on:
push:
branches:
- bench*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUST_LOG: info,libp2p=off,node=error
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install just command runner
run: |
sudo snap install --edge --classic just
just --version
- name: Checkout Repository
uses: actions/checkout@v4
- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-bench
- name: Build
# Build in release without `testing` feature, this should work without `hotshot_example` config.
run: |
cargo build --locked --release --features benchmarking --workspace
- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
cargo build --locked --release --features benchmarking,testing,embedded-db --bin espresso-dev-node
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: x86_64-unknown-linux-gnu-services-bench
path: |
target/release/orchestrator
target/release/cdn-broker
target/release/cdn-marshal
target/release/cdn-whitelist
target/release/state-relay-server
target/release/state-prover
target/release/sequencer
target/release/cli
target/release/submit-transactions
target/release/utils
target/release/reset-storage
target/release/deploy
target/release/keygen
target/release/permissionless-builder
target/release/nasty-client
target/release/espresso-dev-node
target/release/pub-key
target/release/espresso-bridge
build-arm:
runs-on: buildjet-16vcpu-ubuntu-2204-arm
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
- name: Build
run: |
cargo build --locked --release --features benchmarking --workspace
- name: Build Espresso Dev Node
# Espresso Dev Node currently requires testing feature, so it is built separately.
run: |
cargo build --locked --release --features benchmarking,testing,embedded-db --bin espresso-dev-node
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: aarch64-unknown-linux-gnu-services-bench
path: |
target/release/orchestrator
target/release/cdn-broker
target/release/cdn-marshal
target/release/cdn-whitelist
target/release/state-relay-server
target/release/state-prover
target/release/sequencer
target/release/cli
target/release/submit-transactions
target/release/reset-storage
target/release/utils
target/release/deploy
target/release/keygen
target/release/permissionless-builder
target/release/nasty-client
target/release/espresso-dev-node
target/release/pub-key
target/release/espresso-bridge
build-dockers:
runs-on: ubuntu-latest
needs: [build, build-arm]
outputs:
sequencer-tag: ${{ steps.sequencer.outputs.tags }}
cdn-broker-tag: ${{ steps.cdn-broker.outputs.tags }}
cdn-marshal-tag: ${{ steps.cdn-marshal.outputs.tags }}
cdn-whitelist-tag: ${{ steps.cdn-whitelist.outputs.tags }}
state-relay-server-tag: ${{ steps.state-relay-server.outputs.tags }}
prover-service-tag: ${{ steps.prover-service.outputs.tags }}
orchestrator-tag: ${{ steps.orchestrator.outputs.tags }}
submit-transactions-tag: ${{ steps.submit-transactions.outputs.tags }}
deploy-tag: ${{ steps.deploy.outputs.tags }}
builder-tag: ${{ steps.builder.outputs.tags }}
nasty-client-tag: ${{ steps.nasty-client.outputs.tags }}
espresso-dev-node-tag: ${{ steps.espresso-dev-node.outputs.tags }}
bridge-tag: ${{ steps.bridge.outputs.tags }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download executables AMD
uses: actions/download-artifact@v4
with:
name: x86_64-unknown-linux-gnu-services-bench
path: target/amd64/release
- name: Download executables ARM
uses: actions/download-artifact@v4
with:
name: aarch64-unknown-linux-gnu-services-bench
path: target/arm64/release
- name: Setup Docker BuildKit (buildx)
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Repo
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate sequencer docker metadata
uses: docker/metadata-action@v5
id: sequencer
with:
images: ghcr.io/espressosystems/espresso-sequencer/sequencer
flavor: suffix=bench
- name: Generate cdn-broker docker metadata
uses: docker/metadata-action@v5
id: cdn-broker
with:
images: ghcr.io/espressosystems/espresso-sequencer/cdn-broker
flavor: suffix=bench
- name: Generate cdn-marshal docker metadata
uses: docker/metadata-action@v5
id: cdn-marshal
with:
images: ghcr.io/espressosystems/espresso-sequencer/cdn-marshal
flavor: suffix=bench
- name: Generate cdn-whitelist docker metadata
uses: docker/metadata-action@v5
id: cdn-whitelist
with:
images: ghcr.io/espressosystems/espresso-sequencer/cdn-whitelist
flavor: suffix=bench
- name: Generate state-relay-server docker metadata
uses: docker/metadata-action@v5
id: state-relay-server
with:
images: ghcr.io/espressosystems/espresso-sequencer/state-relay-server
flavor: suffix=bench
- name: Generate prover-service docker metadata
uses: docker/metadata-action@v5
id: prover-service
with:
images: ghcr.io/espressosystems/espresso-sequencer/prover-service
flavor: suffix=bench
- name: Generate orchestrator docker metadata
uses: docker/metadata-action@v5
id: orchestrator
with:
images: ghcr.io/espressosystems/espresso-sequencer/orchestrator
flavor: suffix=bench
- name: Generate submit-transactions docker metadata
uses: docker/metadata-action@v5
id: submit-transactions
with:
images: ghcr.io/espressosystems/espresso-sequencer/submit-transactions
flavor: suffix=bench
- name: Generate deploy metadata
uses: docker/metadata-action@v5
id: deploy
with:
images: ghcr.io/espressosystems/espresso-sequencer/deploy
flavor: suffix=bench
- name: Generate builder metadata
uses: docker/metadata-action@v5
id: builder
with:
images: ghcr.io/espressosystems/espresso-sequencer/builder
flavor: suffix=bench
- name: Generate nasty-client metadata
uses: docker/metadata-action@v5
id: nasty-client
with:
images: ghcr.io/espressosystems/espresso-sequencer/nasty-client
flavor: suffix=bench
- name: Generate espresso-dev-node metadata
uses: docker/metadata-action@v5
id: espresso-dev-node
with:
images: ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node
flavor: suffix=bench
- name: Generate bridge metadata
uses: docker/metadata-action@v5
id: bridge
with:
images: ghcr.io/espressosystems/espresso-sequencer/bridge
flavor: suffix=bench
- name: Build and push sequencer docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/sequencer.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.sequencer.outputs.tags }}
labels: ${{ steps.sequencer.outputs.labels }}
- name: Build and push cdn-broker docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/cdn-broker.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.cdn-broker.outputs.tags }}
labels: ${{ steps.cdn-broker.outputs.labels }}
- name: Build and push cdn-marshal docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/cdn-marshal.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.cdn-marshal.outputs.tags }}
labels: ${{ steps.cdn-marshal.outputs.labels }}
- name: Build and push cdn-whitelist docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/cdn-whitelist.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.cdn-whitelist.outputs.tags }}
labels: ${{ steps.cdn-whitelist.outputs.labels }}
- name: Build and push state-relay-server docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/state-relay-server.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.state-relay-server.outputs.tags }}
labels: ${{ steps.state-relay-server.outputs.labels }}
- name: Build and push prover-service docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/prover-service.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prover-service.outputs.tags }}
labels: ${{ steps.prover-service.outputs.labels }}
- name: Build and push orchestrator docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/orchestrator.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.orchestrator.outputs.tags }}
labels: ${{ steps.orchestrator.outputs.labels }}
- name: Build and push submit-transactions docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/submit-transactions.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.submit-transactions.outputs.tags }}
labels: ${{ steps.submit-transactions.outputs.labels }}
- name: Build and push deploy docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/deploy.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.deploy.outputs.tags }}
labels: ${{ steps.deploy.outputs.labels }}
- name: Build and push builder docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/permissionless-builder.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.builder.outputs.tags }}
labels: ${{ steps.builder.outputs.labels }}
- name: Build and push nasty-client docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/nasty-client.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.nasty-client.outputs.tags }}
labels: ${{ steps.nasty-client.outputs.labels }}
- name: Build and push espresso-dev-node docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/espresso-dev-node.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.espresso-dev-node.outputs.tags }}
labels: ${{ steps.espresso-dev-node.outputs.labels }}
- name: Build and push bridge docker
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/espresso-bridge.Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.bridge.outputs.tags }}
labels: ${{ steps.bridge.outputs.labels }}
test-demo:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
needs: [build-dockers]
steps:
- name: Install just command runner
run: |
sudo snap install --edge --classic just
just --version
- name: Checkout Repository
uses: actions/checkout@v4
- name: Pull docker images
run: |
docker pull ${{ needs.build-dockers.outputs.sequencer-tag }}
docker pull ${{ needs.build-dockers.outputs.cdn-broker-tag }}
docker pull ${{ needs.build-dockers.outputs.cdn-marshal-tag }}
docker pull ${{ needs.build-dockers.outputs.cdn-whitelist-tag }}
docker pull ${{ needs.build-dockers.outputs.state-relay-server-tag }}
docker pull ${{ needs.build-dockers.outputs.prover-service-tag }}
docker pull ${{ needs.build-dockers.outputs.orchestrator-tag }}
docker pull ${{ needs.build-dockers.outputs.submit-transactions-tag }}
docker pull ${{ needs.build-dockers.outputs.deploy-tag }}
docker pull ${{ needs.build-dockers.outputs.builder-tag }}
docker pull ${{ needs.build-dockers.outputs.nasty-client-tag }}
docker pull ${{ needs.build-dockers.outputs.bridge-tag }}
- name: Tag new docker images
run: |
docker tag ${{ needs.build-dockers.outputs.sequencer-tag }} ghcr.io/espressosystems/espresso-sequencer/sequencer:main
docker tag ${{ needs.build-dockers.outputs.cdn-broker-tag }} ghcr.io/espressosystems/espresso-sequencer/cdn-broker:main
docker tag ${{ needs.build-dockers.outputs.cdn-marshal-tag }} ghcr.io/espressosystems/espresso-sequencer/cdn-marshal:main
docker tag ${{ needs.build-dockers.outputs.cdn-whitelist-tag }} ghcr.io/espressosystems/espresso-sequencer/cdn-whitelist:main
docker tag ${{ needs.build-dockers.outputs.state-relay-server-tag }} ghcr.io/espressosystems/espresso-sequencer/state-relay-server:main
docker tag ${{ needs.build-dockers.outputs.prover-service-tag }} ghcr.io/espressosystems/espresso-sequencer/prover-service:main
docker tag ${{ needs.build-dockers.outputs.orchestrator-tag }} ghcr.io/espressosystems/espresso-sequencer/orchestrator:main
docker tag ${{ needs.build-dockers.outputs.submit-transactions-tag }} ghcr.io/espressosystems/espresso-sequencer/submit-transactions:main
docker tag ${{ needs.build-dockers.outputs.deploy-tag }} ghcr.io/espressosystems/espresso-sequencer/deploy:main
docker tag ${{ needs.build-dockers.outputs.builder-tag }} ghcr.io/espressosystems/espresso-sequencer/builder:main
docker tag ${{ needs.build-dockers.outputs.nasty-client-tag }} ghcr.io/espressosystems/espresso-sequencer/nasty-client:main
docker tag ${{ needs.build-dockers.outputs.bridge-tag }} ghcr.io/espressosystems/espresso-sequencer/bridge:main
- name: Test docker demo
run: |
just demo &
timeout -v 600 scripts/smoke-test-demo | sed -e 's/^/smoke-test: /;'