-
Notifications
You must be signed in to change notification settings - Fork 120
/
Copy pathdocker-compose.yaml
295 lines (273 loc) · 11.1 KB
/
docker-compose.yaml
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
services:
clickhouse-ontime:
image: ${CLICKHOUSE_IMAGE:-clickhouse/clickhouse-server}:${CLICKHOUSE_VERSION:-latest}
environment:
- CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS=true
volumes:
- /var/lib/clickhouse/
- /var/log/clickhouse-server/
- ./docker/clickhouse/init_schema_ontime.sql:/docker-entrypoint-initdb.d/init_schema.sql
- ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.d/users.xml
clickhouse:
image: ${CLICKHOUSE_IMAGE:-clickhouse/clickhouse-server}:${CLICKHOUSE_VERSION:-latest}
environment:
- CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS=true
# - TZ=Europe/Moscow
ports:
- "8123:8123"
- "9000:9000"
- "5432:5432"
- "3306:3306"
volumes:
- /var/log/clickhouse-server
- ./docker/clickhouse/init_schema.sql:/docker-entrypoint-initdb.d/init_schema.sql
- ./docker/clickhouse/low_memory.xml:/etc/clickhouse-server/config.d/low_memory.xml
- ./docker/clickhouse/macros.xml:/etc/clickhouse-server/config.d/macros.xml
- ./docker/clickhouse/allow_deprecated_error_prone_window_functions.xml:/etc/clickhouse-server/users.d/allow_deprecated_error_prone_window_functions.xml
- ./docker/clickhouse/postgres_dictionary.xml:/etc/clickhouse-server/postgres_dictionary.xml
- ./docker/clickhouse/listen_ports.xml:/etc/clickhouse-server/config.d/listen_ports.xml
- ./docker/clickhouse/ca-key.pem:/etc/clickhouse-server/ca-key.pem
- ./docker/clickhouse/ca-cert.pem:/etc/clickhouse-server/ca-cert.pem
- ./docker/clickhouse/server-cert.pem:/etc/clickhouse-server/server-cert.pem
- ./docker/clickhouse/server-key.pem:/etc/clickhouse-server/server-key.pem
- ./docker/clickhouse/client-cert.pem:/etc/clickhouse-server/client-cert.pem
- ./docker/clickhouse/client-key.pem:/etc/clickhouse-server/client-key.pem
- ./docker/clickhouse/dhparam.pem:/etc/clickhouse-server/dhparam.pem
- ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.d/users.xml
- ./docker/clickhouse/${OPTIONS_METHOD:-options_method}.xml:/etc/clickhouse-server/config.d/options_method.xml
- ./docker/clickhouse/profiling_config.xml:/etc/clickhouse-server/config.d/profiling_config.xml
- ./docker/clickhouse/profiling_users.xml:/etc/clickhouse-server/users.d/profiling_users.xml
mysql:
image: docker.io/mysql:${MYSQL_VERSION:-latest}
environment:
- MYSQL_ROOT_PASSWORD=grafana
postgres:
image: docker.io/postgres:${POSTGRES_VERSION:-latest}
environment:
- POSTGRES_PASSWORD=grafana
volumes:
- ./docker/postgres/init_schema.sql:/docker-entrypoint-initdb.d/init_schema.sql
grafana:
image: ${GRAFANA_IMAGE:-grafana/grafana}:${GRAFANA_VERSION:-latest}
user: root
build:
context: ./.config
args:
grafana_image: ${GRAFANA_IMAGE:-grafana}
grafana_version: ${GRAFANA_VERSION:-latest}
volumes:
- ./dist/:/var/lib/grafana/plugins/vertamedia-clickhouse-datasource/
- ./docker/grafana/provisioning/:/etc/grafana/provisioning/
- ./docker/grafana/dashboards/:/var/lib/grafana/dashboards/
- ./docker/grafana/alerting/:/etc/grafana/provisioning/alerting/
- ./go_coverage/raw/:/usr/share/grafana/go_coverage
environment:
GF_INSTALL_PLUGINS: grafana-piechart-panel,grafana-worldmap-panel,grafana-clickhouse-datasource
GF_LOG_LEVEL: debug
GOCOVERDIR: "/usr/share/grafana/go_coverage"
GF_DATABASE_WAL: "true"
GF_UNIFIED_ALERTING_ENABLED: ${GF_UNIFIED_ALERTING_ENABLED:-true}
GF_ALERTING_ENABLED: ${GF_ALERTING_ENABLED:-false}
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: vertamedia-clickhouse-datasource
depends_on:
- clickhouse
ports:
- "3000:3000"
grafana_legacy_alerts:
profiles: [ test ]
image: ${GRAFANA_IMAGE:-grafana/grafana}:${GRAFANA_VERSION:-10.4.3}
user: root
build:
context: ./.config
args:
grafana_image: ${GRAFANA_IMAGE:-grafana}
grafana_version: ${GRAFANA_VERSION:-latest}
volumes:
- ./dist/:/var/lib/grafana/plugins/vertamedia-clickhouse-datasource/
- ./docker/grafana/provisioning/:/etc/grafana/provisioning/
- ./docker/grafana/dashboards/:/var/lib/grafana/dashboards/
- ./docker/grafana/alerting/:/etc/grafana/provisioning/alerting/
- ./go_coverage/raw/:/usr/share/grafana/go_coverage
environment:
GF_INSTALL_PLUGINS: grafana-piechart-panel,grafana-worldmap-panel,grafana-clickhouse-datasource
GF_LOG_LEVEL: debug
GOCOVERDIR: "/usr/share/grafana/go_coverage"
GF_DATABASE_WAL: "true"
GF_UNIFIED_ALERTING_ENABLED: ${GF_UNIFIED_ALERTING_ENABLED:-false}
GF_ALERTING_ENABLED: ${GF_ALERTING_ENABLED:-true}
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: vertamedia-clickhouse-datasource
depends_on:
- clickhouse
ports:
- "3002:3000"
grafana_external_install:
image: ${GRAFANA_IMAGE:-grafana/grafana}:${GRAFANA_VERSION:-latest}
volumes:
- ./docker/grafana/provisioning/:/etc/grafana/provisioning/
- ./docker/grafana/dashboards/:/var/lib/grafana/dashboards/
environment:
GF_INSTALL_PLUGINS: "grafana-piechart-panel,grafana-worldmap-panel,grafana-clickhouse-datasource,https://github.com/Altinity/clickhouse-grafana/releases/download/v${CLICKHOUSE_PLUGIN_VERSION:-3.3.0}/vertamedia-clickhouse-datasource-${CLICKHOUSE_PLUGIN_VERSION:-3.3.0}.zip;vertamedia-clickhouse-datasource"
GF_LOG_LEVEL: debug
GF_DATABASE_WAL: "true"
GF_UNIFIED_ALERTING_ENABLED: ${GF_UNIFIED_ALERTING_ENABLED:-false}
GF_ALERTING_ENABLED: ${GF_ALERTING_ENABLED:-true}
ports:
- "3001:3000"
depends_on:
- clickhouse
trickster:
image: tricksterio/trickster:${TRICKSTER_VERSION:-latest}
volumes:
- ./docker/trickster/trickster.conf:/etc/trickster/trickster.conf
ports:
- "8480:8480"
depends_on:
- clickhouse
frontend_builder:
build:
dockerfile: ./docker/builder/Dockerfile
environment:
GOCACHE: "/go-cache"
RUN_TESTS: "${RUN_TESTS:-.+}"
CGO_ENABLED: "0"
working_dir: /grafana-clickhouse
volumes:
- ./.go-cache:/go/pkg/mod
- ./.go-cache:/root/go/pkg/mod
- ./.go-cache:/go-cache
- ./:/grafana-clickhouse
# for speedup npm install under WSL
# - "node_modules:/grafana-clickhouse/node_modules"
command: |
bash -xec '
if [[ "3" == `ls -la ./node_modules/ | wc -l` ]]; then npm install; fi && \
npm run build && \
npm run test:ci
'
backend_builder:
build:
dockerfile: ./docker/builder/Dockerfile
working_dir: /go/src/grafana-clickhouse
environment:
GOCACHE: "/go-cache"
RUN_TESTS: "${RUN_TESTS:-.+}"
CGO_ENABLED: "0"
volumes:
- ./:/go/src/grafana-clickhouse
- ./.go-cache:/go/pkg/mod
- ./.go-cache:/root/go/pkg/mod
- ./.go-cache:/go-cache
command: |
bash -xec "
git config --global --add safe.directory /go/src/grafana-clickhouse &&
(command -v mage || go install -v github.com/magefile/mage@latest) &&
go test -timeout 1m -failfast -tags=integration -run "${RUN_TESTS:-.+}" -v ./pkg/... &&
mage -v &&
chmod +x ./dist/altinity-clickhouse-plugin*
"
frontend_coverage_builder:
build:
dockerfile: ./docker/builder/Dockerfile
working_dir: /grafana-clickhouse
volumes:
- ./:/grafana-clickhouse
# for speedup npm install under WSL
- "node_modules:/grafana-clickhouse/node_modules"
command: |
bash -xec '
if [[ "3" == `ls -la ./node_modules/ | wc -l` ]]; then npm install; fi && \
npm run build:wasm &&
mkdir -p instrumented &&
npm run create_instrumented &&
cp -R -n src/* instrumented/ &&
npm run build:test:frontend &&
npm run test:coverage
'
frontend_coverage_generate:
build:
dockerfile: ./docker/builder/Dockerfile
working_dir: /grafana-clickhouse
volumes:
- ./:/grafana-clickhouse
# for speedup npm install under WSL
- "node_modules:/grafana-clickhouse/node_modules"
command: |
bash -xec '
if [[ "3" == `ls -la ./node_modules/ | wc -l` ]]; then npm install; fi && \
mkdir -p .nyc_output &&
cp tests/testflows/coverage/raw/* .nyc_output/ &&
npx nyc report --reporter=html --report-dir=./tests/testflows/frontend_coverage_testflows
cp coverage/coverage-final.json .nyc_output/ &&
npx nyc report --reporter html --reporter=lcov --report-dir=./tests/testflows/coverage
'
backend_coverage_builder:
build:
dockerfile: ./docker/builder/Dockerfile
working_dir: /go/src/grafana-clickhouse
environment:
GOCACHE: "/go-cache"
RUN_TESTS: "${RUN_TESTS:-.+}"
CGO_ENABLED: "0"
volumes:
- ./:/go/src/grafana-clickhouse
- ./.go-cache:/go/pkg/mod
- ./.go-cache:/root/go/pkg/mod
- ./.go-cache:/go-cache
command: |
bash -xec "
git config --global --add safe.directory /go/src/grafana-clickhouse &&
(command -v mage || go install -v github.com/magefile/mage@latest) &&
mkdir -p /go/src/grafana-clickhouse/go_coverage/raw &&
go env &&
go test -timeout 1m -cover -failfast -tags=integration -run "${RUN_TESTS:-.+}" -v ./pkg/... -test.gocoverdir="/go/src/grafana-clickhouse/go_coverage" &&
GOOS=linux GOARCH=amd64 go build -cover -buildvcs=false -o ./dist/altinity-clickhouse-plugin_linux_amd64 ./pkg/ &&
chmod +x dist/altinity-clickhouse-plugin*
"
backend_coverage_generate:
build:
dockerfile: ./docker/builder/Dockerfile
working_dir: /go/src/grafana-clickhouse
volumes:
- ./:/go/src/grafana-clickhouse
command: |
bash -xec "
go tool covdata textfmt -i=go_coverage/raw -o=go_coverage/coverage.txt &&
go tool cover -html=go_coverage/coverage.txt -o=go_coverage/coverage.html &&
mkdir -p ./tests/testflows/backend_coverage_testflows/
mv go_coverage/coverage.html ./tests/testflows/backend_coverage_testflows/ &&
mv go_coverage/covcounters* go_coverage/raw/ &&
mv go_coverage/covmeta* go_coverage/raw/ &&
go tool covdata textfmt -i=go_coverage/raw -o=go_coverage/coverage.txt &&
go tool cover -html=go_coverage/coverage.txt -o=go_coverage/coverage.html
"
plugin_signer:
image: node:lts
working_dir: /grafana-clickhouse
volumes:
- ./:/grafana-clickhouse
# for speedup npm install
- "node_modules:/grafana-clickhouse/node_modules"
command: |
npm run sign
selenium-standalone:
profiles: [ test ]
image: selenium/standalone-docker:4.18.1-20240224
container_name: selenium-docker
# user: root
links:
- grafana
- grafana_legacy_alerts
ports:
- "4444:4444"
volumes:
- /dev/shm:/dev/shm
- ./tests/testflows/infra/config.toml:/opt/bin/config.toml
- ./tests/testflows/tmp/target:/opt/selenium/assets
- /var/run/docker.sock:/var/run/docker.sock
# privileged: true
depends_on:
- grafana
- trickster
- grafana_legacy_alerts
volumes:
node_modules: