forked from akoptelov/tezedge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.longrunning.yml
207 lines (191 loc) · 9.56 KB
/
.drone.longrunning.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
kind: pipeline
name: build-tezedge-binaries
workspace:
path: /drone/src
steps:
- name: build-artifacts
image: tezedge/tezedge-ci-builder:nightly-2021-08-04-v9.5-tezos
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
# 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 ./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/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_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/
# copy test binaries
- cp `find ./target/release/deps/ | grep integration_test | grep -v "\.d" | head -1` drone-cache/tests/rpc_integration_test
- cp `find ./target/release/deps/ | grep chain_test | grep -v "\.d" | head -1` drone-cache/tests/shell_chain_test
- cp `find ./target/release/deps/ | grep protocol_runner_test | grep -v "\.d" | head -1` drone-cache/tests/protocol_runner_test
- cp `find ./target/release/deps/ | grep p2p_test | grep -v "\.d" | head -1` drone-cache/tests/p2p_test
# copy test resources
- cp ./shell/tests/resources/apply_block_request_until_1326.zip drone-cache/test_data/tests/resources
- cp ./shell/tests/resources/sandbox_branch_1_level3.zip drone-cache/test_data/tests/resources
- cp ./shell/tests/resources/sandbox_branch_2_level4.zip drone-cache/test_data/tests/resources
- cp ./shell/tests/resources/sandbox-patch-context.json drone-cache/test_data/tests/resources
# 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
- cp -r ./tezos/python-tests/daemons/node.py drone-cache/python-tests/daemons/node.py
- cp -r ./tezos/python-tests/launchers/sandbox.py drone-cache/python-tests/launchers/sandbox.py
- cp -r ./tezos/python-tests/tools/constants.py drone-cache/python-tests/tools/constants.py
- 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.165.82
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
trigger:
branch: develop
event: push
---
###################################################################################################################
# This pipeline runs a long running RPC call comparison test that compares tezedge results with octez, ensuring the
# data the RPC returns is correct
###################################################################################################################
kind: pipeline
name: corr/baking-endorsing-rights-rpc-test
environment:
TO_BLOCK_HEADER_FOR_RPC: 1672200
TEZEDGE_NODE_RPC_CONTEXT_ROOT: http://tezedge-updated-node-mainnet-run:18732
OCTEZ_NODE_RPC_CONTEXT_ROOT: http://octez-node-mainnet-run-1:8732
steps:
- name: prepare-cache-dir
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.165.82
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-mainnet-run-1
user: root
image: tezos/tezos:v10.2
detach: true
volumes:
- name: octez-node-mainnet-snapshot-data
path: /home/tezos/data
- name: cache
path: /data/cache
commands:
- rm -f /home/tezos/data/lock
- cp drone-cache/build_files/identities/identity_1.json /home/tezos/data/identity.json
- tezos-node config reset --data-dir /home/tezos/data --network mainnet --no-bootstrap-peers --history-mode archive
- tezos-node run --history-mode archive --data-dir /home/tezos/data --rpc-addr 0.0.0.0:8732 --allow-all-rpc 0.0.0.0:8732 --net-addr 0.0.0.0:9734 --network mainnet --no-bootstrap-peers
- name: tezedge-updated-node-mainnet-run
image: tezedge/tezedge-ci-builder:nightly-2021-08-04-v9.5-tezos
pull: if-not-exists
user: root
detach: true
volumes:
- name: tezedge-node-mainnet-snapshot-data
path: /data/tezedge-data
environment:
SODIUM_USE_PKG_CONFIG: 1
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"
- 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 --peer-thresh-low=0 --peer-thresh-high=0 --identity-file "drone-cache/build_files/identities/identity_4.json" --network "mainnet" --protocol-runner "drone-cache/build_files/protocol-runner" --p2p-port 19732 --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 --tezos-data-dir /data/tezedge-data --bootstrap-db-path bootstrap_db --tezos-context-storage irmin
- name: wait-for-snapshoted-nodes
image: tezedge/tezos-node-bootstrap:latest
commands:
- export TO_BLOCK_HEADER=$${TO_BLOCK_HEADER_FOR_RPC}
- tezos-node-bootstrap bootstrap --level=$${TO_BLOCK_HEADER} --nodes $${OCTEZ_NODE_RPC_CONTEXT_ROOT} $${TEZEDGE_NODE_RPC_CONTEXT_ROOT}
- name: rpc-test
image: tezedge/tezedge-ci-builder:nightly-2021-08-04-v9.5-tezos
pull: if-not-exists
user: root
environment:
RUST_BACKTRACE: 1
commands:
- export NODE_RPC_CONTEXT_ROOT_1=$${TEZEDGE_NODE_RPC_CONTEXT_ROOT}
- export NODE_RPC_CONTEXT_ROOT_2=$${OCTEZ_NODE_RPC_CONTEXT_ROOT}
- export IGNORE_PATH_PATTERNS=votes/listings,/minimal_valid_time,/operations_metadata_hash,/metadata_hash,/operation_metadata_hashes,/context/raw/bytes
- export TO_BLOCK_HEADER=$${TO_BLOCK_HEADER_FOR_RPC}
- export LD_LIBRARY_PATH="drone-cache/build_files/ffi:$rust_libs"
- drone-cache/tests/rpc_integration_test --nocapture --ignored test_rpc_compare_rights_mainnet
volumes:
- name: octez-node-mainnet-snapshot-data
host:
path: /home/dev/octez-data/archive-1672200
- name: tezedge-node-mainnet-snapshot-data
host:
path: /home/dev/tezedge-data/tezedge-1678542
trigger:
branch: develop
event: push