forked from openmina/openmina
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
524 lines (461 loc) · 19.1 KB
/
.drone.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
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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
kind: pipeline
type: docker
name: tests
global-variables:
snark-worker-image: &snark-worker-image openmina/mina-snark-worker-prover:0.0.9
trigger:
branch:
- master
- develop
- feat/graphql
environment:
CHAIN_ID: 3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e
OPENMINA1_SK: 5KJKg7yAbYAQcNGWcKFf2C4ruJxwrHoQvsksU16yPzFzXHMsbMc
OPENMINA1_ID: 2axsdDAiiZee7hUsRPMtuyHt94UMrvJmMQDhDjKhdRhgqkMdy8e
OPENMINA1_LIBP2P_ID: 12D3KooWF9a6eg6ZVx9Z8PLyqdyVdtxrEzz2Ejc6LXZzG8pH52qL
OPENMINA1_SNARKER_KEY: B62qqYvLLtTMQtHxRfuzZK21AJrqFE8Zq9Cyk3wtjegiTRn5soNQA9A
OPENMINA2_SK: 5JgkZGzHPC2SmQqRGxwbFjZzFMLvab5tPwkiN29HX9Vjc9rtwV4
OPENMINA2_ID: 2bpACUcRh2u7WJ3zSBRWZZvQMTMofYr9SGQgcP2YKzwwDKanNAy
OPENMINA2_LIBP2P_ID: 12D3KooWNgRENFtK5TS6XB5tWrZPwAhm1ws8CHvxHRvojwSsn2mB
OPENMINA2_SNARKER_KEY: B62qrV28zSmLjxMZP1jKRSEFsajPGdFRukbvnXzRKyDmUBNVvCH7w9o
OPENMINA3_SK: 5KWkmiairnLJjtvqEatpb4grLEG8oZjFp7ye4ehphjXRGrgsuH8
OPENMINA3_ID: 2aQA3swTKVf16YgLXZS7TizU7ASgZ8LidEgyHhChpDinrvM9NMi
OPENMINA3_LIBP2P_ID: 12D3KooWA9aqMuPDbQj2ckjGGWLiouS5KmuEVSHJuNrUWMJTNudP
OPENMINA3_SNARKER_KEY: B62qkgVSEnzTabaFJzZcG1pgXorRLJREJFvchGya6UGoKTmFx5AWAK6
steps:
- name: submodules
image: alpine/git
environment:
GITHUB_AUTH_TOKEN:
from_secret: github_auth_token
commands:
- git config --global url."https://$${GITHUB_AUTH_TOKEN}:@github.com/".insteadOf "https://github.com/"
- git config --global --add safe.directory /drone/src
- git config --global --add safe.directory /drone/src/ledger
- git config --global --add safe.directory /drone/src/mina-p2p-messages-rs
- git config --global --add safe.directory /drone/src/deps/algebra
- git config --global --add safe.directory /drone/src/deps/proof-systems
- git config --global --add safe.directory /drone/src/deps/redux-rs
- git submodule update --init --recursive
- rm ~/.gitconfig
- name: prepare-snark-worker
image: *snark-worker-image
commands:
- cp /usr/local/bin/mina cli/bin/
- name: build
image: rust:1.77-bullseye
commands:
- apt-get update && apt-get install -y libssl-dev libjemalloc-dev jq protobuf-compiler
- rustup update 1.77 && rustup default 1.77
- rustup component add rustfmt
# just to be sure it builds without errors
- cargo build
- cargo build --release --bin openmina
# unit tests
- cargo test --release -p cli
# build tester binaries
- cargo build --release --features scenario-generators -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-mio
- cargo build --release --bin runner
# o sole mio :)
- name: solo-mio-bootstrap
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
failure: ignore
commands:
- cp target/release/openmina-node-testing-mio /usr/bin/openmina-node-testing-mio
- openmina-node-testing-mio scenarios-generate --name solo-node-bootstrap
- name: solo-webrtc-sync-root-snarked-ledger
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
privileged: true
pull: always
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-webrtc /usr/bin/openmina-node-testing-webrtc
- ./target/release/runner openmina-node-testing-webrtc scenarios-generate --name solo-node-sync-root-snarked-ledger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.0"
- name: solo-webrtc-initial-joining
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
privileged: true
pull: always
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-webrtc /usr/bin/openmina-node-testing-webrtc
- ./target/release/runner openmina-node-testing-webrtc scenarios-generate --name solo-node-basic-connectivity-initial-joining # --use-debugger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.1"
- name: multi-initial-joining
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
pull: always
privileged: true
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-libp2p /usr/bin/openmina-node-testing-libp2p
- ./target/release/runner openmina-node-testing-libp2p scenarios-generate --name multi-node-basic-connectivity-initial-joining # --use-debugger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.5"
- name: multi-webrtc-initial-joining
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
pull: always
privileged: true
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-webrtc /usr/bin/openmina-node-testing-webrtc
- ./target/release/runner openmina-node-testing-webrtc scenarios-generate --name multi-node-basic-connectivity-initial-joining
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.2"
- name: solo-sync-root-snarked-ledger
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
pull: always
privileged: true
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-libp2p /usr/bin/openmina-node-testing-libp2p
- ./target/release/runner openmina-node-testing-libp2p scenarios-generate --name solo-node-sync-root-snarked-ledger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.3"
- name: solo-initial-joining
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
pull: always
privileged: true
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-libp2p /usr/bin/openmina-node-testing-libp2p
- ./target/release/runner openmina-node-testing-libp2p scenarios-generate --name solo-node-basic-connectivity-initial-joining # --use-debugger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.4"
- name: solo-accept-incoming
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
pull: always
privileged: true
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-libp2p /usr/bin/openmina-node-testing-libp2p
- ./target/release/runner openmina-node-testing-libp2p scenarios-generate --name solo-node-basic-connectivity-accept-incoming # --use-debugger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.6"
- name: multi-peer-discovery
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
pull: always
privileged: true
volumes:
- name: debugfs
path: /sys/kernel/debug
failure: ignore
commands:
- cp target/release/openmina-node-testing-libp2p /usr/bin/openmina-node-testing-libp2p
- ./target/release/runner openmina-node-testing-libp2p scenarios-generate --name multi-node-basic-connectivity-peer-discovery # --use-debugger
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.7"
- name: openmina1
image: *snark-worker-image
detach: true
commands:
- mkdir test_ledgers
- curl https://raw.githubusercontent.com/openmina/openmina-poc/3a81bc7/test_ledgers/jx5k7xf3L2aof821PQWumABQ793rhEis5kRb8YUmJWTHKtEJ5nb -o test_ledgers/jx5k7xf3L2aof821PQWumABQ793rhEis5kRb8YUmJWTHKtEJ5nb
- target/release/openmina node -p 10000 -v Debug -s $OPENMINA1_SK
--peers /dns4/openmina2/tcp/8302/p2p/$OPENMINA2_LIBP2P_ID /dns4/openmina3/tcp/8302/p2p/$OPENMINA3_LIBP2P_ID
/dns4/ocaml1/tcp/8302/p2p/12D3KooWKLzGWSdFAQGEAtrHan1TTwu7idagcZ83X6MXWfUJNiTU
--run-snarker $OPENMINA1_SNARKER_KEY --snarker-strategy seq --snarker-exe-path cli/bin/snark-worker
- name: openmina2
image: *snark-worker-image
detach: true
commands:
- target/release/openmina node -p 10000 -v Debug -s $OPENMINA2_SK
--peers /dns4/openmina1/tcp/8302/p2p/$OPENMINA1_LIBP2P_ID /dns4/openmina3/tcp/8302/p2p/$OPENMINA3_LIBP2P_ID
--run-snarker $OPENMINA2_SNARKER_KEY --snarker-strategy rand --snarker-exe-path cli/bin/snark-worker
- name: openmina3
image: *snark-worker-image
detach: true
commands:
- target/release/openmina node -p 10000 -v Debug -s $OPENMINA3_SK
--peers /dns4/openmina1/tcp/8302/p2p/$OPENMINA1_LIBP2P_ID /dns4/openmina2/tcp/8302/p2p/$OPENMINA2_LIBP2P_ID
--run-snarker $OPENMINA3_SNARKER_KEY --snarker-strategy rand --snarker-exe-path cli/bin/snark-worker
- name: test-snark-work
image: alpine
commands:
- apk add curl jq
- |
c() {
n=$$1
path=$$2
shift 2
curl -s http://openmina$$n:10000/$$path "$$@"
}
- |
assert() {
eval $2 || {
echo "[failed] $1: '$2'"
exit 1
}
}
- |
TOTAL_WORK_TODO=$$(c 1 snark-pool/jobs | jq 'length')
echo "TOTAL_WORK_TODO=$TOTAL_WORK_TODO"
LOCAL_WORK=0
for t in $(seq 10); do
WORKERS=$$(c 1 snarker/workers | jq '[.[] | select(.status.kind != "None")] | length')
assert 'active workers > 0' '[ $$WORKERS -gt 0 ]'
COMMITMENTS_IN_PROGRESS=$$(c 1 snark-pool/jobs | jq "[.[] | select(.snark == null and .commitment.snarker == \"$OPENMINA1_SNARKER_KEY\")] | length")
assert 'local commitments in progress fewer than local workers' '[ $$COMMITMENTS_IN_PROGRESS -le $$WORKERS ]'
LW=$$(c 1 snark-pool/jobs | jq "[.[] | select(.snark.snarker == \"$OPENMINA1_SNARKER_KEY\")] | length")
assert 'local snarks number do not decrease' '[ $$LOCAL_WORK -le $$LW ]'
LOCAL_WORK=$$LW
sleep 30
done
c 1 snark-pool/jobs > jobs.json
assert 'local work exists' '[ $$LOCAL_WORK -gt 0 ]'
TOTAL_WORK=$$(jq '[.[] | select(.snark != null)] | length' jobs.json)
LOCAL_WORK=$$(jq "[.[] | select(.snark != null and .snark.snarker == \"$OPENMINA1_SNARKER_KEY\")] | length" jobs.json)
NON_LOCAL_WORK=$$(jq "[.[] | select(.snark != null and .snark.snarker != \"$OPENMINA1_SNARKER_KEY\")] | length" jobs.json)
echo "TOTAL_WORK=$$TOTAL_WORK"
echo "LOCAL_WORK=$$LOCAL_WORK"
echo "NON_LOCAL_WORK=$$NON_LOCAL_WORK"
assert 'non-local work exists' '[ $$NON_LOCAL_WORK -gt 0 ]'
# TOTAL_COMMITMENTS=$$(jq "[.[] | select(.commitment != null)] | length" jobs.json)
# NON_LOCAL_COMMITMENTS=$$(jq "[.[] | select(.commitment != null and .commitment.commitment.snarker != \"$OPENMINA1_SNARKER_KEY\")] | length" jobs.json)
# echo "TOTAL_COMMITMENTS=$$TOTAL_COMMITMENTS"
# echo "NON_LOCAL_COMMITMENTS=$$NON_LOCAL_COMMITMENTS"
# assert 'non-local commintment exists' '[ $$NON_LOCAL_COMMITMENTS -gt 0 ]'
volumes:
- name: debugfs
host:
path: /sys/kernel/debug
- name: procfs
host:
path: /proc
---
kind: pipeline
name: Build & Test Openmina Frontend
type: docker
trigger:
branch:
- develop
- frontend
steps:
- name: set-docker
image: alpine
environment:
DOCKER_BUILDKIT: "0"
commands:
- echo "export DOCKER_BUILDKIT=0" >> $HOME/.bashrc
- source $HOME/.bashrc
- name: build
image: docker:latest
environment:
DOCKER_BUILDKIT: "0"
commands:
- COMMIT_SHORT_SHA=$(echo $DRONE_COMMIT_SHA | cut -c 1-7)
- docker build --no-cache -t openmina/frontend:$COMMIT_SHORT_SHA -f Dockerfile_FE .
volumes:
- name: docker_sock
path: /var/run/docker.sock
depends_on:
- set-docker
- name: prepare
image: cypress/included:13.3.2
commands:
- cd frontend && npm install
depends_on:
- build
- name: frontend-server
image: openmina/frontend:${DRONE_COMMIT_SHA:0:7}
pull: if-not-exists
detach: true
privileged: true
depends_on:
- build
- name: dashboard-peers
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/dashboard/dashboard-peers.cy.ts"
depends_on:
- prepare
- name: block-production-overview-epoch-graphs
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/epoch-graphs.cy.ts"
depends_on:
- prepare
- name: block-production-overview-slots
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/slots.cy.ts"
depends_on:
- prepare
- name: block-production-overview-side-panel
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/side-panel.cy.ts"
depends_on:
- prepare
- name: block-production-overview-toolbar
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/toolbar.cy.ts"
depends_on:
- prepare
- name: block-production-overview-apis
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/apis.cy.ts"
depends_on:
- prepare
- name: nodes-overview-table
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/nodes/overview/nodes-overview-table.cy.ts"
depends_on:
- prepare
- name: nodes-overview-side-panel
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/nodes/overview/nodes-overview-side-panel.cy.ts"
depends_on:
- prepare
- name: nodes-live-blocks-map
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/nodes/live/nodes-live-blocks-map.cy.ts"
depends_on:
- prepare
- name: nodes-live-blocks-table
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/nodes/live/nodes-live-blocks-table.cy.ts"
depends_on:
- prepare
- name: network-messages-filters
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/messages/network-messages-filters.cy.ts"
depends_on:
- prepare
- name: network-messages-footer
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/messages/network-messages-footer.cy.ts"
depends_on:
- prepare
- name: network-messages-table
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/messages/network-messages-table.cy.ts"
depends_on:
- prepare
- name: network-connections-side-panel
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/connections/network-connections-side-panel.cy.ts"
depends_on:
- prepare
- name: network-connections-table
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/connections/network-connections-table.cy.ts"
depends_on:
- prepare
- name: network-blocks-side-panel
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/blocks/network-blocks-side-panel.cy.ts"
depends_on:
- prepare
- name: network-blocks-table
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/blocks/network-blocks-table.cy.ts"
depends_on:
- prepare
- name: network-blocks-toolbar
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/network/blocks/network-blocks-toolbar.cy.ts"
depends_on:
- prepare
- name: memory-resources-treemap
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/resources/memory/memory-resources-treemap.cy.ts"
depends_on:
- prepare
- name: memory-resources-table
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/resources/memory/memory-resources-table.cy.ts"
depends_on:
- prepare
- name: memory-resources-toolbar
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/resources/memory/memory-resources-toolbar.cy.ts"
depends_on:
- prepare
- name: memory-resources-breadcrumbs
image: cypress/included:13.3.2
commands:
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/resources/memory/memory-resources-breadcrumbs.cy.ts"
depends_on:
- prepare
- name: push
image: docker:latest
commands:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- docker push openmina/frontend:${DRONE_COMMIT_SHA:0:7}
volumes:
- name: docker_sock
path: /var/run/docker.sock
environment:
DOCKER_USERNAME:
from_secret: docker_hub_username
DOCKER_PASSWORD:
from_secret: docker_hub_password
depends_on:
- dashboard-peers
- block-production-overview-epoch-graphs
- block-production-overview-slots
- block-production-overview-side-panel
- block-production-overview-toolbar
- block-production-overview-apis
- nodes-overview-table
- nodes-overview-side-panel
- nodes-live-blocks-map
- nodes-live-blocks-table
- network-messages-filters
- network-messages-footer
- network-messages-table
- network-connections-side-panel
- network-connections-table
- network-blocks-side-panel
- network-blocks-table
- network-blocks-toolbar
- memory-resources-treemap
- memory-resources-table
- memory-resources-toolbar
- memory-resources-breadcrumbs
image_pull_secrets:
- docker_pull_secret
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock