forked from getsentry/snuba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.gcb.yml
177 lines (173 loc) · 5.79 KB
/
docker-compose.gcb.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
---
version: "3.4"
x-test-common: &test-common
depends_on:
- redis_cluster
- kafka
- clickhouse
- zookeeper
image: "$SNUBA_IMAGE"
profiles: ["run_test"]
volumes:
- ".artifacts:/.artifacts"
environment:
SNUBA_SETTINGS: "$SNUBA_SETTINGS"
CLICKHOUSE_HOST: clickhouse
USE_REDIS_CLUSTER: "1"
REDIS_HOST: "redis1"
REDIS_PORT: 6379
REDIS_DB: 0
DEFAULT_BROKERS: "kafka:9092"
# override the `snuba` user to write to the /.artifacts mount
user: root
services:
snuba-test-rust:
<<: *test-common
entrypoint: /bin/sh
command:
- "-c"
- >-
snuba migrations migrate --force
&& make test-rust
snuba-test:
<<: *test-common
entrypoint: python
command:
- "-m"
- "pytest"
- "-x"
- "-vv"
- "${TEST_LOCATION:-tests}"
- "--cov"
- "."
- "--cov-report"
- "xml:/.artifacts/${TEST_LOCATION:-tests}/${SNUBA_SETTINGS}/coverage.xml"
- "--junit-xml"
- "/.artifacts/${TEST_LOCATION:-tests}/${SNUBA_SETTINGS}/pytest.junit.xml"
zookeeper:
image: "confluentinc/cp-zookeeper:5.1.2"
environment:
ZOOKEEPER_CLIENT_PORT: "2181"
CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
ZOOKEEPER_LOG4J_ROOT_LOGLEVEL: "WARN"
ZOOKEEPER_TOOLS_LOG4J_LOGLEVEL: "WARN"
kafka:
depends_on:
- zookeeper
image: "confluentinc/cp-kafka:5.1.2"
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
KAFKA_LOG4J_LOGGERS: "kafka.cluster=WARN,kafka.controller=WARN,kafka.coordinator=WARN,kafka.log=WARN,kafka.server=WARN,kafka.zookeeper=WARN,state.change.logger=WARN"
KAFKA_LOG4J_ROOT_LOGLEVEL: "WARN"
KAFKA_TOOLS_LOG4J_LOGLEVEL: "WARN"
clickhouse:
image: '${CLICKHOUSE_IMAGE:-yandex/clickhouse-server:20.3.9.70}'
volumes:
- ./config/clickhouse/macros.xml:/etc/clickhouse-server/config.d/macros.xml
- ./config/clickhouse/zookeeper.xml:/etc/clickhouse-server/config.d/zookeeper.xml
- ./config/clickhouse/remote_servers.xml:/etc/clickhouse-server/config.d/remote_servers.xml
ulimits:
nofile:
soft: 262144
hard: 262144
# nodes for multi-node clickhouse cluster
clickhouse-query:
depends_on:
- zookeeper
image: '${CLICKHOUSE_IMAGE:-yandex/clickhouse-server:20.3.9.70}'
profiles: ["multi_node"]
volumes:
- ./test_distributed_migrations/config/clickhouse/zookeeper.xml:/etc/clickhouse-server/config.d/zookeeper.xml
- ./test_distributed_migrations/config/clickhouse/remote_servers.xml:/etc/clickhouse-server/config.d/remote_servers.xml
ulimits:
nofile:
soft: 262144
hard: 262144
clickhouse-01:
depends_on:
- zookeeper
image: '${CLICKHOUSE_IMAGE:-yandex/clickhouse-server:20.3.9.70}'
profiles: ["multi_node"]
volumes:
- ./test_distributed_migrations/config/clickhouse/macros-01.xml:/etc/clickhouse-server/config.d/macros.xml
- ./test_distributed_migrations/config/clickhouse/zookeeper.xml:/etc/clickhouse-server/config.d/zookeeper.xml
- ./test_distributed_migrations/config/clickhouse/remote_servers.xml:/etc/clickhouse-server/config.d/remote_servers.xml
ulimits:
nofile:
soft: 262144
hard: 262144
clickhouse-02:
depends_on:
- zookeeper
image: '${CLICKHOUSE_IMAGE:-yandex/clickhouse-server:20.3.9.70}'
profiles: ["multi_node"]
volumes:
- ./test_distributed_migrations/config/clickhouse/macros-02.xml:/etc/clickhouse-server/config.d/macros.xml
- ./test_distributed_migrations/config/clickhouse/zookeeper.xml:/etc/clickhouse-server/config.d/zookeeper.xml
- ./test_distributed_migrations/config/clickhouse/remote_servers.xml:/etc/clickhouse-server/config.d/remote_servers.xml
ulimits:
nofile:
soft: 262144
hard: 262144
clickhouse-03:
depends_on:
- zookeeper
image: '${CLICKHOUSE_IMAGE:-yandex/clickhouse-server:20.3.9.70}'
profiles: ["multi_node"]
volumes:
- ./test_distributed_migrations/config/clickhouse/macros-03.xml:/etc/clickhouse-server/config.d/macros.xml
- ./test_distributed_migrations/config/clickhouse/zookeeper.xml:/etc/clickhouse-server/config.d/zookeeper.xml
- ./test_distributed_migrations/config/clickhouse/remote_servers.xml:/etc/clickhouse-server/config.d/remote_servers.xml
ulimits:
nofile:
soft: 262144
hard: 262144
clickhouse-04:
depends_on:
- zookeeper
image: '${CLICKHOUSE_IMAGE:-yandex/clickhouse-server:20.3.9.70}'
profiles: ["multi_node"]
volumes:
- ./test_distributed_migrations/config/clickhouse/macros-04.xml:/etc/clickhouse-server/config.d/macros.xml
- ./test_distributed_migrations/config/clickhouse/zookeeper.xml:/etc/clickhouse-server/config.d/zookeeper.xml
- ./test_distributed_migrations/config/clickhouse/remote_servers.xml:/etc/clickhouse-server/config.d/remote_servers.xml
ulimits:
nofile:
soft: 262144
hard: 262144
redis1: &redis_config
image: redis:5.0-alpine
command:
- redis-server
- "--appendonly"
- "no"
- "--cluster-enabled"
- "yes"
- "--cluster-config-file"
- "/data/redis_cluster.conf"
redis2:
<<: *redis_config
redis3:
<<: *redis_config
redis_cluster:
<<: *redis_config
command:
- "/bin/sh"
- "-c"
- >-
echo yes |
redis-cli --cluster create
$$(getent hosts redis1 | awk '{ print $$1 }'):6379
$$(getent hosts redis2 | awk '{ print $$1 }'):6379
$$(getent hosts redis3 | awk '{ print $$1 }'):6379
depends_on:
- redis1
- redis2
- redis3
networks:
default:
external:
name: cloudbuild