forked from tezedge/tezedge
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.drone.yml
7704 lines (6928 loc) · 256 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
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##############################################################################################################
# The pipelines are divided into two categories:
# corr - implying that the pipeline is testing the correctness of the node
# perf - implying that the pipeline is testing the performance of the node
##############################################################################################################
##############################################################################################################
# Snapshoted data are prepared (on other server than drone, you need to have there actual tezos-node binary):
#
# - create/get snapshot:
# 1. download it from xtz-shots.io, e.g.: `wget https://<testnet>.xtz-shots.io/tezos-<testnet>-<some-level>.full`
# 2. or run node and create snapshot manually to desired level (recomended, you can set set level high):
# ./tezos-node config init --network granadanet --data-dir /tmp/chain-data
# ./tezos-node run --network granadanet --data-dir /tmp/chain-data --net-addr 0.0.0.0:9734 --rpc-addr 0.0.0.0:18888 --history-mode archive
# ./tezos-node snapshot export --block BKyjtcb7VhJfTcqXWjf3p1beRmLVvMQsy5NvRJkPaVUkc6kx4e1 granadanet.20000.full --data-dir /tmp/chain-data/
#
# - import snapshot:
# ./tezos-node config init --network granadanet --data-dir /tmp/granadanet
# ./tezos-node snapshot import granadanet.20000.full --data-dir /tmp/granadanet --reconstruct --network granadanet --history-mode full
# cd /tmp/granadanet
# tar -czvf granadanet.20000.snapshoted.tar.gz context store config.json version.json
# # copy to drone server (see synchronize_ci.sh -> CI_HOSTS)
# scp granadanet.20000.snapshoted.tar.gz [email protected]:/usr/local/etc/tezedge-ci/snapshots
# scp granadanet.20000.snapshoted.tar.gz [email protected]:/usr/local/etc/tezedge-ci/snapshots
# scp granadanet.20000.snapshoted.tar.gz [email protected]:/usr/local/etc/tezedge-ci/snapshots
# scp granadanet.20000.snapshoted.tar.gz [email protected]:/usr/local/etc/tezedge-ci/snapshots
# scp granadanet.20000.snapshoted.tar.gz [email protected]:/usr/local/etc/tezedge-ci/snapshots
#
# - Drone server - extract and prepare dirs:
# cd /usr/local/etc/tezedge-ci/snapshots
# mkdir /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1 /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-2 /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-3
# tar -xzvf granadanet.20000.snapshoted.tar.gz -C /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/
# # check directory `/usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/`, should looks like this:
# /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/config.json
# /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/version.json
# /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/context
# /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/store
# cp -R /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/* /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-2
# cp -R /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-1/* /usr/local/etc/tezedge-ci/data/ocaml-node-granadanet-snapshot-data-3
##############################################################################################################
##############################################################################################################
# This pipeline builds a docker image and pushes it to docker HUB - (versioned/tagged) from master/release
##############################################################################################################
kind: pipeline
name: deployment/publish-docker-image-latest-release
steps:
- name: build-light-node-image
image: plugins/docker
settings:
repo: tezedge/tezedge
target: light-node
tags:
- ${DRONE_TAG}
- latest-release
dockerfile: docker/distroless/Dockerfile
build_args:
- SOURCE_BRANCH=${DRONE_TAG}
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
- name: build-light-node-debug-image
image: plugins/docker
settings:
repo: tezedge/tezedge
target: light-node
tags:
- ${DRONE_TAG}-frame-pointers-enabled
- latest-frame-pointers-enabled-release
dockerfile: docker/distroless/Dockerfile
build_args:
- SOURCE_BRANCH=${DRONE_TAG}
- BASE_IMAGE=tezedge/tezedge-libs:latest-profile
- RUSTFLAGS=-Cforce-frame-pointers=yes
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
- name: build-sandbox-image
image: plugins/docker
settings:
repo: tezedge/tezedge
target: sandbox
tags:
- sandbox-${DRONE_TAG}
- sandbox-latest-release
dockerfile: docker/distroless/Dockerfile
build_args:
- SOURCE_BRANCH=${DRONE_TAG}
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
- name: build-monitoring-image
image: plugins/docker
settings:
repo: tezedge/node-monitoring
tags:
- ${DRONE_TAG}
- latest-release
dockerfile: apps/node_monitoring/Dockerfile
build_args:
- SOURCE_BRANCH=${DRONE_TAG}
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
image_pull_secrets:
- docker_pull_secret
trigger:
ref: refs/tags/**
event: tag
##############################################################################################################
# This pipeline:
# - only one which checkouts git
# - runs just run tests, and build artifacts to 'build' volume,
# - aslo copies files needed from git for other pipelines
##############################################################################################################
---
kind: pipeline
name: build-tezedge-binaries
trigger:
branch:
- master
- develop
workspace:
path: /drone/src
steps:
- name: build-artifacts
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
environment:
RUST_BACKTRACE: 1
SODIUM_USE_PKG_CONFIG: 1
OCAML_BUILD_CHAIN: remote
LOG_LEVEL: info
OCAML_LOG_ENABLED: false
commands:
# prepare rust toolchain dir
- echo "`rustup show home`/toolchains/`rustup show active-toolchain | tr " " "\n" | head -1`/lib"
# build and unit-test
- cargo clean
- cargo build --release --workspace
- cargo test --release --workspace --no-run
# collect binary artefacts
# directory in the workspace to cache all the binary artefacts
# TODO: use snake-case for directories
- mkdir -p drone-cache/build_files/ffi
- mkdir -p drone-cache/build_files/tezedge
- mkdir -p drone-cache/build_files/identities
- mkdir -p drone-cache/test_data/tests/resources
- mkdir -p drone-cache/tests
- mkdir -p drone-cache/sandbox_files
- mkdir -p drone-cache/nginx
# - mkdir -p $${SANDBOX_ARTIFACTS_PATH}
# copy binaries
- cp ./target/release/light-node drone-cache/build_files
- cp ./target/release/sandbox drone-cache/build_files
- cp ./target/release/protocol-runner drone-cache/build_files
- cp ./target/release/tezedge-baker drone-cache/build_files
- cp ./tezos/sys/lib_tezos/artifacts/libtezos.so drone-cache/build_files/ffi
- cp ./sandbox/artifacts/tezos-client drone-cache/build_files
# copy sapling init files
- cp ./tezos/sys/lib_tezos/artifacts/sapling-spend.params drone-cache/build_files/ffi
- cp ./tezos/sys/lib_tezos/artifacts/sapling-output.params drone-cache/build_files/ffi
# copy sandbox resources
- cp ./light_node/etc/tezedge_sandbox/sandbox-patch-context.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/006-carthage-protocol-parameters.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/008-edo-protocol-parameters.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/009-florence-protocol-parameters.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/010-granada-protocol-parameters.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/011-hangzhou-protocol-parameters.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/012-ithaca-protocol-parameters.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/tezedge_drone_sandbox.config drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_start_light_node_args.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_init_client_request.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_activate_protocol_request.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_activate_protocol_009_request.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_activate_protocol_010_request.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_activate_protocol_011_request.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_activate_protocol_012_request.json drone-cache/sandbox_files
- cp ./light_node/etc/tezedge_sandbox/sandbox_bake_empty_block.json drone-cache/sandbox_files
# copy other resources
- cp ./light_node/etc/drone/assert_equals.sh drone-cache/build_files/ && chmod 755 drone-cache/build_files/assert_equals.sh
- cp ./light_node/etc/drone/assert_contains.sh drone-cache/build_files/ && chmod 755 drone-cache/build_files/assert_contains.sh
- cp ./light_node/etc/drone/wait_file.sh drone-cache/build_files/ && chmod 755 drone-cache/build_files/wait_file.sh
- cp ./light_node/etc/drone/assert_cyclic_test_result.sh drone-cache/build_files/ && chmod 755 drone-cache/build_files/assert_cyclic_test_result.sh
- cp ./light_node/etc/drone/identities/* drone-cache/build_files/identities/
- cp ./light_node/etc/tezedge/tezedge_drone.config drone-cache/build_files/tezedge/
- cp ./light_node/etc/drone/nginx/default drone-cache/nginx/default
# copy test binaries
- cp target/release/deps/baker-???????????????? drone-cache/tests
- cp target/release/deps/baker_integration-???????????????? drone-cache/tests
- cp `find ./target/release/deps/ | grep integration_test | grep -v "\.d" | head -1` drone-cache/tests/rpc_integration_test
# collect modified python tests stuff
- mkdir -p drone-cache/python-tests/daemons
- mkdir -p drone-cache/python-tests/launchers
- mkdir -p drone-cache/python-tests/tools
- mkdir -p drone-cache/python-tests/tests_012
- mkdir -p drone-cache/python-tests/tests_013
- cp ./tezos/python-tests/daemons/*.py drone-cache/python-tests/daemons/
- cp ./tezos/python-tests/launchers/sandbox.py drone-cache/python-tests/launchers/
- cp ./tezos/python-tests/tools/constants.py drone-cache/python-tests/tools/
- cp ./tezos/python-tests/tests_012/*.py drone-cache/python-tests/tests_012/
- cp ./tezos/python-tests/tests_013/*.py drone-cache/python-tests/tests_013/
# collect files related to Mitten
- mkdir -p drone-cache/mitten
- cp ./tezos/mitten/* drone-cache/mitten/
- name: rebuild-artifacts-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
rebuild: true
backend: "sftp"
cache_key: 'build-{{ .Build.Number }}'
mount:
- 'drone-cache' # <- builds a cache from this directory
---
##############################################################################################################
# This pipeline:
# - only one which checkouts git
# - runs just run tests, and build artifacts to 'build' volume,
# - aslo copies files needed from git for other pipelines
##############################################################################################################
kind: pipeline
name: build-old-tezedge-binaries
trigger:
branch:
- master
- develop
ref:
- refs/pull/*/head
workspace:
path: /drone/src
steps:
- name: build-artifacts
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
environment:
RUST_BACKTRACE: 1
SODIUM_USE_PKG_CONFIG: 1
OCAML_BUILD_CHAIN: remote
LOG_LEVEL: info
OCAML_LOG_ENABLED: false
commands:
# Build target (old) branch version
- git reset --hard origin/${DRONE_TARGET_BRANCH}
- cargo clean && cargo build --release -p light-node -p sandbox -p protocol-runner
# copy old binaries
- mkdir -p drone-cache-old
- cp ./target/release/light-node drone-cache-old/
- cp ./target/release/sandbox drone-cache-old/
- cp ./target/release/protocol-runner drone-cache-old/
- cp ./tezos/sys/lib_tezos/artifacts/libtezos.so drone-cache-old/
- cp ./light_node/etc/tezedge/tezedge_drone.config drone-cache-old/
# - chown -R 1000:1000 drone-cache
- name: rebuild-artifacts-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
rebuild: true
backend: "sftp"
cache_key: 'build-old-{{ .Build.Number }}'
mount:
- 'drone-cache-old' # <- builds a cache from this directory
---
##############################################################################################################
# This pipeline:
# Builds and sychronizes the monitoring binary
##############################################################################################################
kind: pipeline
name: build-monitoring-artifacts
trigger:
branch:
- master
- develop
workspace:
path: /drone/src
steps:
- name: build-artifacts
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
commands:
- cd apps/node_monitoring && cargo build --release
- mkdir -p drone-cache-monitoring
- cp ./target/release/node-monitoring drone-cache-monitoring/
- name: rebuild-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
rebuild: true
debug: true
backend: "sftp"
cache_key: 'build-monitoring-{{ .Build.Number }}'
mount:
- 'apps/node_monitoring/drone-cache-monitoring' # <- builds a cache from this directory
#############################################################################################################
# This pipeline runs cyclictest routed to the real time node to verify that the environment is indeed
# real time. It also generated artificial load to make the test more accurate.
# GIVEN we are inside a real time environment WHEN we run cyclictest then the latencies should be in the
# defined threshold
#############################################################################################################
---
kind: pipeline
name: corr/real-time-environment-cyclictest-latencies
trigger:
branch:
- master
- develop
clone:
disable: true
steps:
- name: prepare-data
image: alpine/git
user: root
volumes:
- name: cache
path: /data/cache
commands:
- mkdir -p drone-cache
- name: restore-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
restore: true
debug: true
backend: "sftp"
cache_key: 'build-{{ .Build.Number }}'
mount:
- 'drone-cache' # <- builds a cache from this directory
- name: generate-artificial-load
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
privileged: true
detach: true
user: root
commands:
- taskset -c 0 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 1 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 2 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 3 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 4 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 5 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 6 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 7 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 8 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 9 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 10 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 11 /bin/ping -l 100000 -q -s 10 -f localhost &
- taskset -c 12 /bin/ping -l 100000 -q -s 10 -f localhost &
- sleep 65
- name: run-cyclic-test
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
privileged: true
user: root
commands:
- /rt-tests/cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 --duration=1m --quiet > cyclictest.out
- drone-cache/build_files/assert_cyclic_test_result.sh 100 ./cyclictest.out
depends_on:
- build-tezedge-binaries
node:
tag: real-time-linux-runner
#############################################################################################################
# This pipeline runs tezedge node with mainnet configuration against octez node with different network cfg
# to verify that the tezedge node accidentally won't kill the octez node
# GIVEN we are running one octez node and one tezedge node on different networks WHEN we connect them together
# THEN the octez node does not crash
#############################################################################################################
---
kind: pipeline
name: corr/octez-tezedge-connection-with-different-networks-each
trigger:
branch:
- master
- develop
environment:
FROM_BLOCK_HEADER: 0
TO_BLOCK_HEADER: 0
SODIUM_USE_PKG_CONFIG: 1
OCTEZ_NETWORK: edonet
TEZEDGE_NETWORK: mainnet
OCTEZ_NODE_RPC_CONTEXT_ROOT: http://octez-node-run:8732
TEZEDGE_NODE_RUN_MAINNET_RPC_CONTEXT_ROOT: http://tezedge-updated-node-run-mainnet:18732
steps:
- name: prepare-data
image: alpine/git
user: root
volumes:
- name: cache
path: /data/cache
commands:
- mkdir -p /data/cache
- mkdir -p drone-cache
- name: restore-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
restore: true
debug: true
backend: "sftp"
cache_key: 'build-{{ .Build.Number }}'
mount:
- 'drone-cache' # <- builds a cache from this directory
- name: tezedge-updated-node-run-mainnet
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
detach: true
volumes:
- name: cache
path: /data/cache
environment:
SODIUM_USE_PKG_CONFIG: 1
commands:
- ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}' > /data/cache/tezedge_ip.txt
- cp drone-cache/build_files/protocol-runner /data/cache
- rust_libs=$(echo "`rustup show home`/toolchains/`rustup show active-toolchain | tr " " "\n" | head -1`/lib")
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$rust_libs"--tezos-data-
- echo "LD_LIBRARY_PATH - $LD_LIBRARY_PATH"
- drone-cache/build_files/light-node --config-file "./drone-cache/build_files/tezedge/tezedge_drone.config" --disable-bootstrap-lookup --network $${TEZEDGE_NETWORK} --identity-file "./drone-cache/build_files/identities/identity_6.json" --protocol-runner /data/cache/protocol-runner --tezos-data-dir /data/cache/tezos-node-data --bootstrap-db-path /data/cache/light-node-data --init-sapling-spend-params-file ./drone-cache/build_files/ffi/sapling-spend.params --init-sapling-output-params-file ./drone-cache/build_files/ffi/sapling-output.params
- name: bootstrapping-tezedge
image: tezedge/tezos-node-bootstrap:latest
pull: if-not-exists
commands:
- tezos-node-bootstrap bootstrap --level=0 --nodes $${TEZEDGE_NODE_RUN_MAINNET_RPC_CONTEXT_ROOT}
# just run octez snapshoted node
- name: octez-node-run
user: root
image: tezos/tezos:v8.2
detach: true
volumes:
- name: cache
path: /data/cache
commands:
- ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}' > /data/cache/octez_ip.txt
- mkdir /home/tezos/data/
- cp drone-cache/build_files/identities/identity_7.json /home/tezos/data/identity.json
- rm -f /home/tezos/data/config.json
- tezos-node config init --data-dir /home/tezos/data --network $${OCTEZ_NETWORK}
- tezos-node run --data-dir /home/tezos/data --history-mode archive --rpc-addr 0.0.0.0:8732 --net-addr 0.0.0.0:9734 --network $${OCTEZ_NETWORK} --no-bootstrap-peers
- name: wait-octez-node-to-start
image: tezedge/tezos-node-bootstrap:latest
pull: if-not-exists
commands:
- tezos-node-bootstrap bootstrap --level=0 --nodes $${OCTEZ_NODE_RPC_CONTEXT_ROOT}
- name: octez-node-connect-to-tezedge
user: root
image: tezos/tezos:v8.2
volumes:
- name: cache
path: /data/cache
commands:
# catch error from tezos-admin-client
- tezos-admin-client -A `cat /data/cache/octez_ip.txt` -P 8732 connect address `cat /data/cache/tezedge_ip.txt`:9732 &> /data/cache/tezos-admin-client-error.log &
- sleep 1
- cat /data/cache/tezos-admin-client-error.log
- name: check-octez-error
user: root
image: cfmanteiga/alpine-bash-curl-jq
volumes:
- name: cache
path: /data/cache
commands:
- error=$(cat /data/cache/tezos-admin-client-error.log)
- drone-cache/build_files/assert_contains.sh "$error" "Rejected peer connection"
- drone-cache/build_files/assert_contains.sh "$error" "no common network protocol"
- name: check-octez-still-running
image: tezedge/tezos-node-bootstrap:latest
pull: if-not-exists
commands:
- tezos-node-bootstrap bootstrap --level=0 --nodes $${OCTEZ_NODE_RPC_CONTEXT_ROOT}
volumes:
- name: cache
temp: {}
depends_on:
- build-tezedge-binaries
---
##############################################################################################################
# This pipeline runs all the unit test included in the tezedge project using cargo test
##############################################################################################################
kind: pipeline
name: corr/tezedge-unit-tests
trigger:
branch:
- master
- develop
workspace:
path: /drone/src
steps:
- name: run-unit-tests
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
environment:
SODIUM_USE_PKG_CONFIG: 1
RUST_BACKTRACE: 1
commands:
- cargo test --release --workspace
# NOTE: right now rocksdb is the default, so the default unit tests run
# above already includes these tests.
# - name: run-unit-tests-multibackend-rockdb
# image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
# pull: if-not-exists
# user: root
# environment:
# SODIUM_USE_PKG_CONFIG: 1
# RUST_BACKTRACE: 1
# commands:
# - cd storage
# - cargo test --release --features maindb-backend-rocksdb
- name: run-unit-tests-multibackend-sled
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
environment:
SODIUM_USE_PKG_CONFIG: 1
RUST_BACKTRACE: 1
commands:
- cd storage
- cargo test --release --features maindb-backend-sled
# NOTE: not used right now, and it is flakey, disabled for now
# - name: run-unit-tests-multibackend-edgekv
# image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
# pull: if-not-exists
# user: root
# environment:
# SODIUM_USE_PKG_CONFIG: 1
# RUST_BACKTRACE: 1
# commands:
# - cd storage
# - cargo test --release --features maindb-backend-edgekv
- name: run-unit-tests-monitoring
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
environment:
SODIUM_USE_PKG_CONFIG: 1
RUST_BACKTRACE: 1
commands:
- cd apps/node_monitoring
- cargo test --release --workspace
---
##############################################################################################################
# This pipeline runs all the other ignored test in the tezedge project marked as integration tests
##############################################################################################################
kind: pipeline
name: corr/tezedge-integration-tests
trigger:
branch:
- master
- develop
workspace:
path: /drone/src
steps:
- name: prepare-data
image: alpine/git
user: root
volumes:
- name: cache
path: /data/cache
commands:
- mkdir -p drone-cache
- name: restore-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
restore: true
debug: true
backend: "sftp"
cache_key: 'build-{{ .Build.Number }}'
mount:
- 'drone-cache' # <- builds a cache from this directory
- name: run-tests-baker
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
environment:
SODIUM_USE_PKG_CONFIG: 1
RUST_BACKTRACE: 1
LD_LIBRARY_PATH: drone-cache/build_files/ffi
PROTOCOL_RUNNER: drone-cache/build_files/protocol-runner
SAPLING_PARAMS_DIR: drone-cache/build_files/ffi
commands:
- ./drone-cache/tests/baker-???????????????? --nocapture
- export PATH=$${PATH}:drone-cache/build_files
- ./drone-cache/tests/baker_integration-???????????????? progress_10 progress_10_missing_baker --nocapture
depends_on:
- build-tezedge-binaries
image_pull_secrets:
- docker_pull_secret
---
##############################################################################################################
# This pipeline runs a nginx file web server with file sharing and tests the import-snapshot subcommand with
# both types of context snapshots
##############################################################################################################
kind: pipeline
name: corr/import-snapshot
trigger:
branch:
- master
- develop
environment:
NETWORK: hangzhounet
depends_on:
- build-tezedge-binaries
image_pull_secrets:
- docker_pull_secret
volumes:
- name: cache
temp: {}
- name: snapshots
host:
path: /usr/local/etc/tezedge-ci/snapshots
steps:
- name: prepare-data
image: alpine/git
user: root
commands:
- mkdir -p drone-cache
- name: restore-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
restore: true
debug: true
backend: "sftp"
cache_key: 'build-{{ .Build.Number }}'
mount:
- 'drone-cache' # <- builds a cache from this directory
- name: nginx-file-server
image: nginx
detach: true
volumes:
- name: snapshots
path: /snapshots
commands:
- cp ./drone-cache/nginx/default /etc/nginx/conf.d/default.conf
- nginx
- sleep infinity
- name: import-snapshot-with-irmin-context
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
pull: if-not-exists
environment:
SODIUM_USE_PKG_CONFIG: 1
THROTTLING_QUOTA_DISABLE: true
volumes:
- name: cache
path: /cache
commands:
- sleep 10
- rust_libs=$(echo "`rustup show home`/toolchains/`rustup show active-toolchain | tr " " "\n" | head -1`/lib")
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$rust_libs"
- ./drone-cache/build_files/light-node import-snapshot --from http://nginx-file-server/tezedge_hangzhou_20220322-113544_BMCnDzyT2UASaz7BpM5JT5K7xwzHsv2q1A5LpZm6u4PNJuMmLpC_irmin.full --tezos-data-dir /cache
- name: run-tezedge-from-imported-snapshot-with-irmin-context
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- rust_libs=$(echo "`rustup show home`/toolchains/`rustup show active-toolchain | tr " " "\n" | head -1`/lib")
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$rust_libs"
- >
./drone-cache/build_files/light-node
--config-file=./drone-cache/build_files/tezedge/tezedge_drone.config
--identity-file=./drone-cache/build_files/identities/identity_2.json
--protocol-runner=./drone-cache/build_files/protocol-runner
--init-sapling-spend-params-file=./drone-cache/build_files/ffi/sapling-spend.params
--init-sapling-output-params-file=./drone-cache/build_files/ffi/sapling-output.params
--peer-thresh-low=1 --peer-thresh-high=1 --network "$${NETWORK}"
--tezos-data-dir=/cache --bootstrap-db-path=bootstrap_db
--tezos-context-storage=irmin --disable-bootstrap-lookup
--log-level debug --context-integrity-check true &
echo $! > /var/run/tezedge.pid
# this command waits the node to be on level 710058
- |
sh -c '
block=0
attempts=0
while [ $block -lt 710058 ]; do
sleep 5
b=$(curl -s localhost:18732/chains/main/blocks/head | jq .header.level)
block=$${b:-$block}
echo "===> Block level $block"
if [ $attempts -gt 12 ]; then
echo "Failed to bootstrap after a minute."
exit 1
fi
attempts=$(($attempts + 1))
done
'
- echo "Bootstrapped. Killing the node and waiting for 10 seconds."
# terminate the node gracefully and wait to allow `valgrind` dump data
- kill -INT $(cat /var/run/tezedge.pid) && sleep 10
- name: cleanup-cached-tezedge-data
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- rm -rf /cache/*
- name: import-snapshot-with-tezedge-context
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
pull: if-not-exists
environment:
SODIUM_USE_PKG_CONFIG: 1
THROTTLING_QUOTA_DISABLE: true
volumes:
- name: cache
path: /cache
commands:
- sleep 10
- rust_libs=$(echo "`rustup show home`/toolchains/`rustup show active-toolchain | tr " " "\n" | head -1`/lib")
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$rust_libs"
- ./drone-cache/build_files/light-node import-snapshot --from http://nginx-file-server/tezedge_hangzhou_20220324-115238_BL93oyUZ2fvibSgp11kJbf1Vqz3UHQb9yyrRattSM8Tmh99X8os_tezedge.full --tezos-data-dir /cache
- name: run-tezedge-from-imported-snapshot-with-tezedge-context
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
user: root
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- rust_libs=$(echo "`rustup show home`/toolchains/`rustup show active-toolchain | tr " " "\n" | head -1`/lib")
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$rust_libs"
- >
./drone-cache/build_files/light-node
--config-file=./drone-cache/build_files/tezedge/tezedge_drone.config
--identity-file=./drone-cache/build_files/identities/identity_2.json
--protocol-runner=./drone-cache/build_files/protocol-runner
--init-sapling-spend-params-file=./drone-cache/build_files/ffi/sapling-spend.params
--init-sapling-output-params-file=./drone-cache/build_files/ffi/sapling-output.params
--peer-thresh-low=1 --peer-thresh-high=1 --network "$${NETWORK}"
--tezos-data-dir=/cache --bootstrap-db-path=bootstrap_db
--tezos-context-storage=tezedge --disable-bootstrap-lookup
--log-level debug --context-integrity-check true &
echo $! > /var/run/tezedge.pid
# this command waits the node to be on level 717507
- |
sh -c '
block=0
attempts=0
while [ $block -lt 717507 ]; do
sleep 5
b=$(curl -s localhost:18732/chains/main/blocks/head | jq .header.level)
block=$${b:-$block}
echo "===> Block level $block"
if [ $attempts -gt 12 ]; then
echo "Failed to bootstrap after a minute."
exit 1
fi
attempts=$(($attempts + 1))
done
'
- echo "Bootstrapped. Killing the node and waiting for 10 seconds."
# terminate the node gracefully and wait to allow `valgrind` dump data
- kill -INT $(cat /var/run/tezedge.pid) && sleep 10
---
##############################################################################################################
# This pipeline replays the application of the first 20k blocks from florencenet using the in-memory context
# It also tests the snapshot functionality
##############################################################################################################
kind: pipeline
name: corr/replay-and-snapshot-012-ithacanet
trigger:
branch:
- master
- develop
environment:
NETWORK: ithacanet
BLOCK_LEVEL: 20000
steps:
- name: prepare-data
image: alpine/git
user: root
commands:
- mkdir -p drone-cache
- name: restore-cache
image: meltwater/drone-cache
pull: true
environment:
SFTP_USERNAME:
from_secret: sftp_username
SFTP_PASSWORD:
from_secret: sftp_password
SFTP_AUTH_METHOD: PASSWORD
SFTP_HOST: 65.21.119.66
SFTP_PORT: 22
SFTP_CACHE_ROOT: "/upload"
settings:
restore: true
debug: true
backend: "sftp"
cache_key: 'build-{{ .Build.Number }}'
mount:
- 'drone-cache' # <- builds a cache from this directory
- name: octez-node
user: root
image: tezos/tezos:v13-release
detach: true
volumes:
- name: data
path: /data
commands:
- tezos-node config init --network $${NETWORK}
# TODO: use already generated identity instead of regenerating here.
- tezos-node snapshot import /data/octez-012-ithacanet-$${BLOCK_LEVEL}.snapshot --block BLR5WXgdQ4vLXxj3rcSG66afrcVQUvwPGxWz2CDu5HAZ7Jo9rNp
- tezos-node run --no-bootstrap-peers --rpc-addr 0.0.0.0:8732
- name: wait-for-octez-to-start
image: tezedge/tezos-node-bootstrap:latest
pull: if-not-exists
commands:
- tezos-node-bootstrap bootstrap --level=0 --nodes http://octez-node:8732
- name: tezedge-node-bootstrap
image: tezedge/tezedge-ci-builder:rust-1.58.1-v13.0-octez
pull: if-not-exists
user: root
volumes:
- name: cache
path: /cache
- name: tezos-data
path: /data
environment:
SODIUM_USE_PKG_CONFIG: 1
THROTTLING_QUOTA_DISABLE: true
commands:
- OCTEZ_IP=$(perl -e 'use Socket; my $a = gethostbyname("octez-node"); print inet_ntoa($a)')
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$$(rustc --print sysroot)"
- >
./drone-cache/build_files/light-node
--config-file=./drone-cache/build_files/tezedge/tezedge_drone.config
--identity-file=./drone-cache/build_files/identities/identity_2.json
--protocol-runner=./drone-cache/build_files/protocol-runner
--init-sapling-spend-params-file=./drone-cache/build_files/ffi/sapling-spend.params
--init-sapling-output-params-file=./drone-cache/build_files/ffi/sapling-output.params
--peer-thresh-low=1 --peer-thresh-high=1 --network "$${NETWORK}"
--tezos-data-dir=/cache/tezedge-data --bootstrap-db-path=bootstrap_db
--tezos-context-storage=irmin --disable-bootstrap-lookup --peers="$${OCTEZ_IP}:9732" &