Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
349 lines (338 loc) · 11.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
349 lines (338 loc) · 11.3 KB
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
services:
# Register this node with the Autojoin API. A successful registration will
# assign a DNS name for this node based on the public IPs, their ASN,
# organiztion, and IATA code. As well, Register distributes other credentials
# needed to upload and archive measurement data. The register command contacts
# the Autojoin API every hour.
register-node:
# NOTE: register should not be restarted on failure.
image: measurementlab/autojoin-register:v0.5.1
profiles: [check-config, ndt]
pull_policy: always
network_mode: host
volumes:
- ./autonode:/autonode
restart: always
command:
- -endpoint=https://autojoin-dot-${PROJECT}.appspot.com/autojoin/v0/node/register/token
- -token-endpoint=https://${AUTH_URL}/v0/token/autojoin
- -key=${API_KEY}
- -service=ndt
- -iata=${IATA}
- -output=/autonode
- -healthcheck-addr=:8001
- -ports=9990,9991,9992,9993,9994,9995
- -probability=${PROBABILITY}
- -ipv4=${IPV4}
- -ipv6=${IPV6}
- -type=${TYPE}
- -uplink=${UPLINK}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/ready"]
interval: 3s
timeout: 5s
retries: 10
# ndt-server is the public facing measurement service. Only ndt7 is enabled.
ndt-server:
image: measurementlab/ndt-server:v0.25.3
profiles: [ndt]
network_mode: host
cap_add:
- NET_BIND_SERVICE
volumes:
- ./certs:/certs
- ./html:/html
- ./schemas:/schemas
- ./resultsdir:/resultsdir
- ./autonode:/autonode
- ./autocert:/autocert
depends_on:
generate-schemas-ndt7:
condition: service_completed_successfully
check-bbr:
condition: service_completed_successfully
register-node:
condition: service_healthy
restart: always
# NOTE: All containers will use the host network. All the following ports
# must not be in use.
ports:
# ndt-server TLS and non-TLS ports.
- target: 443
published: 443
protocol: tcp
- target: 80
published: 80
protocol: tcp
# ndt-server prometheus.
- target: 9990
published: 9990
protocol: tcp
# jostler prometheus.
- target: 9991
published: 9991
protocol: tcp
# annotator prometheus.
- target: 9992
published: 9992
protocol: tcp
# heartbeat prometheus.
- target: 9993
published: 9993
protocol: tcp
# traceroute-caller prometheus.
- target: 9994
published: 9994
protocol: tcp
# Generate the UUID prefix before starting ndt-server. This runs on every
# container start (including restart:always restarts after host reboot),
# ensuring a fresh prefix with the current boot time. The prefix uses btime
# from /proc/stat, which is a deterministic integer — no coordination file
# or separate container needed.
entrypoint:
- /bin/sh
- -c
- |
btime=$$(awk '/^btime / {print $$2}' /proc/stat) &&
printf '%s_%s' "$$(hostname)" "$$btime" > /schemas/uuid.prefix &&
exec /ndt-server "$$@"
- --
command:
- -uuid-prefix-file=/schemas/uuid.prefix
- -datadir=/resultsdir/ndt
- -ndt7_addr=:443
- -ndt7_addr_cleartext=:80
# Allow ndt7 data to be autoloaded.
- -compress-results=false
# TODO(host): confirm device name.
- -txcontroller.device=${INTERFACE_NAME}
- -txcontroller.max-rate=${INTERFACE_MAXRATE}
- -prometheusx.listen-address=:9990
# Add server metadata.
- -label=type=${TYPE}
- -label=deployment=byos
- -label=managed=none
- -label=loadbalanced=false
- -label=org=${ORGANIZATION}
- -label=external-ip=${IPV4}
- -label=external-ipv6=${IPV6}
# Effectively disable ndt5.
- -ndt5_addr=127.0.0.1:3002
- -ndt5_ws_addr=127.0.0.1:3001
- -tcpinfo.eventsocket=/schemas/events.sock
- -autocert.enabled=true
- -autocert.hostname=@/autonode/hostname
- -token.machine=@/autonode/hostname
- -token.verify-key=/locate/verify.pub
- -ndt7.token.required=true
configs:
- source: locate-verify-key
target: /locate/verify.pub
healthcheck:
test: ["CMD", "wget", "-O/dev/null", "-q", "http://localhost:80/"]
interval: 3s
timeout: 5s
retries: 10
# heartbeat reports health and liveness messages to M-Lab's Locate API every
# 10sec. The Locate API is responsible for directing clients to nearby healthy
# servers.
heartbeat:
image: measurementlab/heartbeat:v0.19.1
profiles: [ndt]
volumes:
- ./autonode:/autonode
depends_on:
ndt-server:
condition: service_started
register-node:
condition: service_healthy
restart: always
command:
- -prometheusx.listen-address=:9993
- -experiment=ndt
- -hostname=@/autonode/hostname
- -registration-url=file:///autonode/registration.json
- -heartbeat-url=wss://${LOCATE_URL}/v2/platform/heartbeat-jwt
- -api-key=${API_KEY}
- -token-exchange-url=https://${AUTH_URL}/v0/token/autojoin
- -services=ndt/ndt7=ws:///ndt/v7/download,ws:///ndt/v7/upload,wss:///ndt/v7/download,wss:///ndt/v7/upload
network_mode: host
# uuid-annotator records network and geographic annotations based on the
# client and server IP so each NDT measurement is annotated in BigQuery.
uuid-annotator:
image: measurementlab/uuid-annotator:v0.5.10
profiles: [ndt]
volumes:
- ./resultsdir:/resultsdir
- ./schemas:/schemas
- ./certs:/certs
- ./autonode:/autonode
depends_on:
ndt-server:
condition: service_started
register-node:
condition: service_healthy
network_mode: host
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/autonode/service-account-autojoin.json
restart: always
# NOTE: all database URLs are required.
command:
- -prometheusx.listen-address=:9992
- -datadir=/resultsdir/ndt/annotation2
- -tcpinfo.eventsocket=/schemas/events.sock
- -ipservice.sock=/schemas/uuid-annotator.sock
- -maxmind.url=gs://downloader-${PROJECT}/Maxmind/current/GeoLite2-City.tar.gz
- -routeview-v4.url=gs://downloader-${PROJECT}/RouteViewIPv4/current/routeview.pfx2as.gz
- -routeview-v6.url=gs://downloader-${PROJECT}/RouteViewIPv6/current/routeview.pfx2as.gz
- -siteinfo.url=file:///autonode/annotation.json
- -hostname=@/autonode/hostname
# jostler archives the raw data from ndt-server and the uuid-annotator into
# JSONL "bundles". These bundles are uploaded to GCS using credentials from
# register. Jostler depends on the local schemas being up to date or backward
# compatible with upstream schemas.
jostler:
image: measurementlab/jostler:v1.1.4
profiles: [ndt]
volumes:
- ./resultsdir:/resultsdir
- ./schemas:/schemas
- ./certs:/certs
- ./autonode:/autonode
network_mode: host
depends_on:
generate-schemas-ndt7:
condition: service_completed_successfully
generate-schemas-annotation2:
condition: service_completed_successfully
generate-schemas-traceroute:
condition: service_completed_successfully
register-node:
condition: service_healthy
restart: always
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/autonode/service-account-autojoin.json
# NOTE: jostler should not restart on exit.
command:
- -mlab-node-name=@/autonode/hostname
# NOTE: the ndt7 schema must already exist in the target bucket.
- -gcs-bucket=archive-${PROJECT}
- -gcs-data-dir=autoload/v2
- -local-data-dir=/resultsdir
- -organization=${ORGANIZATION}
- -experiment=ndt
- -datatype=ndt7
- -datatype-schema-file=ndt7:/schemas/ndt7.json
- -datatype=annotation2
- -datatype-schema-file=annotation2:/schemas/annotation2.json
- -datatype=scamper2
- -datatype-schema-file=scamper2:/schemas/scamper2.json
- -datatype=hopannotation2
- -datatype-schema-file=hopannotation2:/schemas/hopannotation2.json
- -bundle-size-max=20971520
- -bundle-age-max=1h
- -missed-age=2h
- -missed-interval=5m
- -extensions=.json
- -upload-schema=false
- -verbose
- -prometheusx.listen-address=:9991
traceroute-caller:
image: measurementlab/traceroute-caller:v0.12.0
profiles: [ndt]
network_mode: host
volumes:
- ./resultsdir:/resultsdir
- ./schemas:/schemas
- ./metadata:/metadata
depends_on:
generate-schemas-traceroute:
condition: service_completed_successfully
register-node:
condition: service_healthy
ndt-server:
condition: service_healthy
pull_policy: always
restart: always
configs:
- source: metadata-external-ipv6
target: /metadata/external-ipv6
- source: metadata-external-ip
target: /metadata/external-ip
command:
- -prometheusx.listen-address=:9994
- -traceroute-output=/resultsdir/ndt/scamper2
- -hopannotation-output=/resultsdir/ndt/hopannotation2
- -tcpinfo.eventsocket=/schemas/events.sock
- -IPCacheTimeout=10m
- -IPCacheUpdatePeriod=1m
- -scamper.timeout=30m
- -scamper.waitprobe=15
- -scamper.ptr=true
- -ipservice.sock=/schemas/uuid-annotator.sock
- -anonymize.ip=none
- -scamper.trace-type=regular
- -output.format=json
node-exporter:
image: quay.io/prometheus/node-exporter:v1.9.0
profiles: [ndt]
container_name: node-exporter
restart: always
network_mode: host
pid: host
volumes:
- /:/host:ro,rslave
command:
- --web.listen-address=:9995
- --path.rootfs=/host
- --collector.disable-defaults
- --collector.cpu
- --collector.diskstats
- --collector.filesystem
- --collector.loadavg
- --collector.meminfo
- --collector.netdev
- --collector.stat
- --collector.time
# Generate the schemas needed by jostler to assess that the data is backward
# compatible with upstream schemas and safe to upload.
generate-schemas-ndt7:
network_mode: host
image: measurementlab/ndt-server:v0.25.3
volumes:
- ./schemas:/schemas
entrypoint:
- /generate-schemas
- -ndt7=/schemas/ndt7.json
generate-schemas-annotation2:
network_mode: host
image: measurementlab/uuid-annotator:v0.5.8
volumes:
- ./schemas:/schemas
entrypoint:
- /generate-schemas
- -ann2=/schemas/annotation2.json
generate-schemas-traceroute:
network_mode: host
image: measurementlab/traceroute-caller:v0.12.0
volumes:
- ./schemas:/schemas
entrypoint:
- /generate-schemas
- -scamper2=/schemas/scamper2.json
- -hopannotation2=/schemas/hopannotation2.json
# Check that the tcp_bbr module is available on the host. This is required
# for ndt-server to use the BBR congestion control algorithm.
check-bbr:
image: bash:latest
command: ["sh", "-c", "lsmod | grep tcp_bbr"]
configs:
locate-verify-key:
content: |
{"use":"sig","kty":"OKP","kid":"locate_20200409","crv":"Ed25519","alg":"EdDSA","x":"1tS1d-dd2B-VRBTWzOaq7zUngKDyV409K-o42LN2nx8"}
metadata-external-ip:
content: |-
${IPV4}
metadata-external-ipv6:
content: |-
${IPV6}