forked from ethpandaops/xatu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
502 lines (493 loc) · 15.6 KB
/
docker-compose.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
services:
xatu-clickhouse-01:
profiles:
- clickhouse
- ""
image: "clickhouse/clickhouse-server:${CHVER:-latest}"
container_name: xatu-clickhouse-01
hostname: xatu-clickhouse-01
user: 101:101
networks:
- xatu-net
volumes:
- clickhouse-01-data:/var/lib/clickhouse/
- ./deploy/local/docker-compose/clickhouse/clickhouse-01/etc/clickhouse-server/config.d/config.xml:/etc/clickhouse-server/config.d/config.xml
- ./deploy/local/docker-compose/clickhouse/clickhouse-01/etc/clickhouse-server/users.d/users.xml:/etc/clickhouse-server/users.d/users.xml
- ./deploy/local/docker-compose/clickhouse/clickhouse-01/etc/clickhouse-server/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- "127.0.0.1:8123:8123"
- "127.0.0.1:9000:9000"
depends_on:
xatu-clickhouse-zookeeper-01:
condition: service_healthy
xatu-clickhouse-zookeeper-02:
condition: service_healthy
xatu-clickhouse-zookeeper-03:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"set -x; wget --spider --quiet http://xatu-clickhouse-01:9000 || exit 1; wget --spider --quiet --header 'Host: localhost' --post-data 'query=SELECT 1' http://localhost:8123 || exit 1",
]
interval: 5s
timeout: 10s
retries: 15
start_period: 15s
xatu-clickhouse-02:
profiles:
- clickhouse
- ""
image: "clickhouse/clickhouse-server:${CHVER:-latest}"
container_name: xatu-clickhouse-02
hostname: xatu-clickhouse-02
user: 101:101
networks:
- xatu-net
volumes:
- clickhouse-02-data:/var/lib/clickhouse/
- ./deploy/local/docker-compose/clickhouse/clickhouse-02/etc/clickhouse-server/config.d/config.xml:/etc/clickhouse-server/config.d/config.xml
- ./deploy/local/docker-compose/clickhouse/clickhouse-02/etc/clickhouse-server/users.d/users.xml:/etc/clickhouse-server/users.d/users.xml
- ./deploy/local/docker-compose/clickhouse/clickhouse-02/etc/clickhouse-server/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- "127.0.0.1:8124:8123"
- "127.0.0.1:9001:9000"
depends_on:
xatu-clickhouse-zookeeper-01:
condition: service_healthy
xatu-clickhouse-zookeeper-02:
condition: service_healthy
xatu-clickhouse-zookeeper-03:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"set -x; wget --spider --quiet http://xatu-clickhouse-02:9000 || exit 1; wget --spider --quiet --header 'Host: localhost' --post-data 'query=SELECT 1' http://localhost:8123 || exit 1",
]
interval: 5s
timeout: 10s
retries: 15
start_period: 15s
xatu-clickhouse-zookeeper-01:
profiles:
- clickhouse
- ""
image: zookeeper:3.9
container_name: xatu-clickhouse-zookeeper-01
hostname: xatu-clickhouse-zookeeper-01
networks:
- xatu-net
volumes:
- clickhouse-zookeeper-01-data:/data
- clickhouse-zookeeper-01-datalog:/datalog
environment:
ZOO_MY_ID: 1
ZOO_4LW_COMMANDS_WHITELIST: "*"
ZOO_SERVERS: "server.1=xatu-clickhouse-zookeeper-01:2888:3888;2181 server.2=xatu-clickhouse-zookeeper-02:2888:3888;2181 server.3=xatu-clickhouse-zookeeper-03:2888:3888;2181"
healthcheck:
test: ["CMD-SHELL", "echo ruok | nc localhost 2181 | grep -q 'imok'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
xatu-clickhouse-zookeeper-02:
profiles:
- clickhouse
- ""
image: zookeeper:3.9
container_name: xatu-clickhouse-zookeeper-02
hostname: xatu-clickhouse-zookeeper-02
networks:
- xatu-net
volumes:
- clickhouse-zookeeper-02-data:/data
- clickhouse-zookeeper-02-datalog:/datalog
environment:
ZOO_MY_ID: 2
ZOO_4LW_COMMANDS_WHITELIST: "*"
ZOO_SERVERS: "server.1=xatu-clickhouse-zookeeper-01:2888:3888;2181 server.2=xatu-clickhouse-zookeeper-02:2888:3888;2181 server.3=xatu-clickhouse-zookeeper-03:2888:3888;2181"
healthcheck:
test: ["CMD-SHELL", "echo ruok | nc localhost 2181 | grep -q 'imok'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
xatu-clickhouse-zookeeper-03:
profiles:
- clickhouse
- ""
image: zookeeper:3.9
container_name: xatu-clickhouse-zookeeper-03
hostname: xatu-clickhouse-zookeeper-03
networks:
- xatu-net
volumes:
- clickhouse-zookeeper-03-data:/data
- clickhouse-zookeeper-03-datalog:/datalog
environment:
ZOO_MY_ID: 3
ZOO_4LW_COMMANDS_WHITELIST: "*"
ZOO_SERVERS: "server.1=xatu-clickhouse-zookeeper-01:2888:3888;2181 server.2=xatu-clickhouse-zookeeper-02:2888:3888;2181 server.3=xatu-clickhouse-zookeeper-03:2888:3888;2181"
healthcheck:
test: ["CMD-SHELL", "echo ruok | nc localhost 2181 | grep -q 'imok'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
xatu-server:
profiles:
- ""
command: server --config /etc/xatu-server/config.yaml
container_name: xatu-server
hostname: xatu-server
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
- "9096:9090"
volumes:
- ./deploy/local/docker-compose/xatu-server.yaml:/etc/xatu-server/config.yaml
networks:
- xatu-net
xatu-postgres:
profiles:
- ""
image: postgres:15
container_name: xatu-postgres
hostname: xatu-postgres
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: xatu
POSTGRES_USER: user
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d xatu"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- xatu-net
xatu-grafana:
profiles:
- ""
image: grafana/grafana:latest
container_name: xatu-grafana
ports:
- "3000:3000"
networks:
- xatu-net
environment:
GF_INSTALL_PLUGINS: grafana-clickhouse-datasource,vertamedia-clickhouse-datasource
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/xatu/basic_overview.json
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_ANONYMOUS_ORG_NAME: Main Org.
volumes:
- ./deploy/local/docker-compose/grafana/datasources:/etc/grafana/provisioning/datasources
- ./deploy/local/docker-compose/grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
- ./deploy/local/docker-compose/grafana/dashboards:/var/lib/grafana/dashboards
xatu-prometheus:
profiles:
- ""
image: prom/prometheus:latest
ports:
- "9090:9090"
networks:
- xatu-net
volumes:
- prometheus-data:/prometheus
- ./deploy/local/docker-compose/prometheus.yaml:/etc/prometheus/prometheus.yml
xatu-init-kafka:
profiles:
- ""
image: confluentinc/cp-kafka:latest
hostname: xatu-init-kafka
container_name: xatu-init-kafka
entrypoint:
- bash
- -c
command:
- |
topics=(
"beacon-api-eth-v1-beacon-blob-sidecar"
"beacon-api-eth-v1-beacon-committee"
"beacon-api-eth-v1-debug-fork-choice"
"beacon-api-eth-v1-debug-fork-choice-reorg"
"beacon-api-eth-v1-debug-fork-choice-reorg-v2"
"beacon-api-eth-v1-debug-fork-choice-v2"
"beacon-api-eth-v1-events-attestation"
"beacon-api-eth-v1-events-attestation-v2"
"beacon-api-eth-v1-events-blob-sidecar"
"beacon-api-eth-v1-events-block"
"beacon-api-eth-v1-events-block-v2"
"beacon-api-eth-v1-events-chain-reorg"
"beacon-api-eth-v1-events-chain-reorg-v2"
"beacon-api-eth-v1-events-contribution-and-proof"
"beacon-api-eth-v1-events-contribution-and-proof-v2"
"beacon-api-eth-v1-events-finalized-checkpoint"
"beacon-api-eth-v1-events-finalized-checkpoint-v2"
"beacon-api-eth-v1-events-head"
"beacon-api-eth-v1-events-head-v2"
"beacon-api-eth-v1-events-voluntary-exit"
"beacon-api-eth-v1-events-voluntary-exit-v2"
"beacon-api-eth-v1-proposer-duty"
"beacon-api-eth-v1-validator-attestation-data"
"beacon-api-eth-v2-beacon-block"
"beacon-api-eth-v2-beacon-block-attester-slashing"
"beacon-api-eth-v2-beacon-block-bls-to-execution-change"
"beacon-api-eth-v2-beacon-block-deposit"
"beacon-api-eth-v2-beacon-block-execution-transaction"
"beacon-api-eth-v2-beacon-block-proposer-slashing"
"beacon-api-eth-v2-beacon-block-v2"
"beacon-api-eth-v2-beacon-block-voluntary-exit"
"beacon-api-eth-v2-beacon-block-withdrawal"
"beacon-api-eth-v2-beacon-block-elaborated-attestation"
"beacon-p2p-attestation"
"blockprint-block-classification"
"mempool-transaction"
"mempool-transaction-v2"
"libp2p-trace-connected"
"libp2p-trace-disconnected"
"libp2p-trace-add-peer"
"libp2p-trace-remove-peer"
"libp2p-trace-recv-rpc"
"libp2p-trace-send-rpc"
"libp2p-trace-join"
"libp2p-trace-handle-metadata"
"libp2p-trace-handle-status"
"libp2p-trace-gossipsub-beacon-block"
"libp2p-trace-gossipsub-beacon-attestation"
"libp2p-trace-gossipsub-blob-sidecar"
"beacon-api-eth-v1-beacon-validators"
)
for topic in "$${topics[@]}"; do
echo "Creating topic: $$topic";
kafka-topics --create --if-not-exists --bootstrap-server xatu-kafka:29092 --partitions 1 --replication-factor 1 --config cleanup.policy=compact --config retention.ms=300000 --topic "$$topic"
done
sleep 3;
depends_on:
xatu-kafka:
condition: service_healthy
networks:
- xatu-net
xatu-kafka:
profiles:
- ""
image: confluentinc/cp-kafka:latest
hostname: xatu-kafka
container_name: xatu-kafka
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: xatu-kafka-zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://xatu-kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_LOG4J_LOGGERS: "kafka.controller=ERROR,kafka.producer.async.DefaultEventHandler=ERROR,state.change.logger=ERROR"
ports:
- "29092:29092"
- "9092:9092"
networks:
- xatu-net
volumes:
- kafka-data:/var/lib/kafka/data
healthcheck:
test:
[
"CMD",
"kafka-broker-api-versions",
"--bootstrap-server=localhost:9092",
]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
depends_on:
xatu-kafka-zookeeper:
condition: service_healthy
xatu-kafka-zookeeper:
profiles:
- ""
image: zookeeper
container_name: xatu-kafka-zookeeper
environment:
ZOO_LOG4J_PROP: "ERROR,CONSOLE"
ports:
- "2181:2181"
networks:
- xatu-net
volumes:
- kafka-zookeeper-data:/data
- kafka-zookeeper-datalog:/datalog
healthcheck:
test: ["CMD", "./bin/zkServer.sh", "status"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
xatu-vector-http-kafka:
profiles:
- ""
image: timberio/vector:0.34.1-alpine
container_name: xatu-vector-http-kafka
volumes:
- ./deploy/local/docker-compose/vector-http-kafka.yaml:/etc/vector/vector.yaml
environment:
KAFKA_BROKERS: "xatu-kafka:29092"
ports:
- "9005:9005"
networks:
- xatu-net
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8686/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
depends_on:
xatu-kafka:
condition: service_healthy
xatu-init-kafka:
condition: service_completed_successfully
xatu-vector-kafka-clickhouse:
profiles:
- ""
image: timberio/vector:0.37.1-alpine
container_name: xatu-vector-kafka-clickhouse
volumes:
- ./deploy/local/docker-compose/vector-kafka-clickhouse.yaml:/etc/vector/vector.yaml
networks:
- xatu-net
ports:
- "8686:8686"
environment:
CLICKHOUSE_ENDPOINT: "xatu-clickhouse-01:8123"
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: ""
KAFKA_BROKERS: "xatu-kafka:29092"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8686/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
depends_on:
xatu-kafka:
condition: service_healthy
xatu-clickhouse-01:
condition: service_healthy
xatu-clickhouse-02:
condition: service_healthy
xatu-clickhouse-migrator:
condition: service_completed_successfully
xatu-init-kafka:
condition: service_completed_successfully
xatu-vector-kafka-clickhouse-libp2p:
profiles:
- ""
image: timberio/vector:0.37.1-alpine
volumes:
- ./deploy/local/docker-compose/vector-kafka-clickhouse-libp2p.yaml:/etc/vector/vector.yaml
networks:
- xatu-net
environment:
CLICKHOUSE_ENDPOINT: "xatu-clickhouse-01:8123"
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: ""
KAFKA_BROKERS: "xatu-kafka:29092"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8686/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
depends_on:
xatu-kafka:
condition: service_healthy
xatu-clickhouse-01:
condition: service_healthy
xatu-clickhouse-02:
condition: service_healthy
xatu-clickhouse-migrator:
condition: service_completed_successfully
xatu-init-kafka:
condition: service_completed_successfully
xatu-postgres-migrator:
profiles:
- ""
image: migrate/migrate
container_name: xatu-postgres-migrator
volumes:
- ./migrations/postgres:/migrations
command:
[
"-path",
"/migrations",
"-database",
"postgres://user:password@xatu-postgres:5432/xatu?sslmode=disable",
"up",
]
depends_on:
xatu-postgres:
condition: service_healthy
networks:
- xatu-net
xatu-clickhouse-migrator:
profiles:
- clickhouse
- ""
image: migrate/migrate
container_name: xatu-clickhouse-migrator
volumes:
- ./deploy/migrations/clickhouse:/migrations
command:
[
"-path",
"/migrations",
"-database",
"clickhouse://xatu-clickhouse-01:9000?username=default&database=default&x-multi-statement=true",
"up",
]
depends_on:
xatu-clickhouse-01:
condition: service_healthy
xatu-clickhouse-02:
condition: service_healthy
networks:
- xatu-net
networks:
xatu-net:
driver: bridge
volumes:
postgres-data:
driver: local
clickhouse-01-data:
driver: local
clickhouse-02-data:
driver: local
clickhouse-zookeeper-01-data:
driver: local
clickhouse-zookeeper-02-data:
driver: local
clickhouse-zookeeper-03-data:
driver: local
clickhouse-zookeeper-01-datalog:
driver: local
clickhouse-zookeeper-02-datalog:
driver: local
clickhouse-zookeeper-03-datalog:
driver: local
kafka-data:
driver: local
kafka-zookeeper-data:
driver: local
kafka-zookeeper-datalog:
driver: local
prometheus-data:
driver: local