-
Notifications
You must be signed in to change notification settings - Fork 4
/
.drone.yml
185 lines (167 loc) · 5.47 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
kind: pipeline
type: docker
name: test-memprof
steps:
- name: test-memprof
image: tezedge/tezedge-bpf-builder:latest
privileged: true
volumes:
- name: kernel-debug
path: /sys/kernel/debug
- name: proc-dir
path: /proc
- name: docker_sock
path: /var/run/docker.sock
commands:
- apt-get install -y pkg-config
- rustup install nightly-2021-03-23
# docker client
- curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-20.10.0.tgz
- tar xzf docker-20.10.0.tgz --strip 1 -C /usr/local/bin docker/docker
- rm docker-20.10.0.tgz
# build memprof
- cargo +nightly-2021-03-23 install bpf-linker --git https://github.com/tezedge/bpf-linker.git --branch main
- cargo +nightly-2021-03-23 test --package tezedge-memprof --lib --release -- history::history history::tests
- cargo +nightly-2021-03-23 build -p bpf-memprof --release
- cargo +nightly-2021-03-23 build -p tezedge-memprof --tests --release
# run tezedge-node in docker
- docker stop tezedge_node || true
- TEZEDGE_NODE_NAME=tezedge_node ./target/none/release/bpf-memprof-user &
- docker run --rm -d --name tezedge_node tezedge/tezedge:latest-frame-pointers-enabled --network hangzhounet
# do tests
- URL=http://localhost:17832 cargo +nightly-2021-03-23 test -p tezedge-memprof --release -- positive compare --nocapture
# stop the node
- docker stop tezedge_node
volumes:
- name: kernel-debug
host:
path: /sys/kernel/debug
- name: proc-dir
host:
path: /proc
- name: docker_sock
host:
path: /var/run/docker.sock
---
kind: pipeline
type: docker
name: test-recorder
steps:
- name: test-recorder
image: tezedge/tezedge-bpf-builder:latest
privileged: true
volumes:
- name: tezedge-shared-data
path: /tmp/volume
- name: kernel-debug
path: /sys/kernel/debug
- name: docker_sock
path: /var/run/docker.sock
commands:
- apt-get install -y pkg-config clang libev-dev
- rustup install nightly-2021-03-23
- rustup install stable
# docker client
- curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-20.10.0.tgz
- tar xzf docker-20.10.0.tgz --strip 1 -C /usr/local/bin docker/docker
- rm docker-20.10.0.tgz
# build recorder
- cargo +stable install bpf-linker --git https://github.com/tezedge/bpf-linker.git --branch main
- cargo +stable install --path bpf-recorder
- cargo +nightly-2021-03-23 build -p tezedge-recorder --tests --release
# stop old node if any
- docker stop tezedge_node || true
# remove old debugger's db if any
- rm -Rf /tmp/volume/tezedge_debugger || true
# prepare
- cp /usr/local/cargo/git/checkouts/tezedge-*/*/tezos/sys/lib_tezos/artifacts/libtezos.so /usr/lib/x86_64-linux-gnu/libtezos.so
- mkdir target/debugger_db
# test
- LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu DEBUGGER_URL="http://localhost:17732" ./tezedge-recorder/test.sh
# test with real node
- LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu ./target/none/release/tezedge-recorder --run-bpf & sleep 2
# run tezedge-node in docker
- docker run --rm -d --name tezedge_node -v /tmp/volume/tezedge:/tmp/tezedge tezedge/tezedge:latest-frame-pointers-enabled --network mainnet --p2p-port 29734
# test p2p
- DEBUGGER_URL="http://localhost:17732" cargo +nightly-2021-03-23 test -p tezedge-recorder --release -- wait --nocapture
- DEBUGGER_URL="http://localhost:17732" cargo +nightly-2021-03-23 test -p tezedge-recorder --release -- p2p_limit p2p_cursor p2p_types_filter --nocapture
# stop the node
- docker stop tezedge_node
volumes:
- name: tezedge-shared-data
host:
path: /tmp/volume
- name: kernel-debug
host:
path: /sys/kernel/debug
- name: docker_sock
host:
path: /var/run/docker.sock
---
kind: pipeline
name: docker-deploy-develop
steps:
- name: build-tezedge-debugger-image
image: plugins/docker
settings:
repo: tezedge/tezedge-debugger
tag: latest
dockerfile: Dockerfile
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
- name: build-tezedge-memprof-image
image: plugins/docker
settings:
repo: tezedge/tezedge-memprof
tag: latest
dockerfile: Dockerfile.memprof
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
image_pull_secrets:
- docker_pull_secret
depends_on:
- test-memprof
- test-recorder
trigger:
branch: develop
event: push
---
kind: pipeline
name: docker-deploy-release
steps:
- name: build-tezedge-debugger-image
image: plugins/docker
settings:
repo: tezedge/tezedge-debugger
tags:
- ${DRONE_TAG}
- latest-release
dockerfile: Dockerfile
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
- name: build-tezedge-memprof-image
image: plugins/docker
settings:
repo: tezedge/tezedge-memprof
tags:
- ${DRONE_TAG}
- latest-release
dockerfile: Dockerfile.memprof
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
image_pull_secrets:
- docker_pull_secret
depends_on:
- test-memprof
- test-recorder
trigger:
ref: refs/tags/**
event: tag