-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
277 lines (259 loc) · 7.12 KB
/
docker-compose.yml
File metadata and controls
277 lines (259 loc) · 7.12 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
name: datastore
services:
db:
# image: timescale/timescaledb-ha:pg15-latest
image: kartoza/postgis:15 # Use this instead of the official image as it has an arm64 image
ports:
- "5433:5432"
volumes:
# - ts-data:/home/postgres/pgdata/data # for timescale image
- ts-data:/var/lib/postgresql # for postgres image
- ./datastore/database/extra.conf:/etc/conf_settings/extra.conf:ro # Extra Postgres configuration
- ./datastore/database/healthcheck_postgis_uptime.sh:/healthcheck_postgis_uptime.sh:ro # for the healthcheck
environment:
- EXTRA_CONF_DIR=/etc/conf_settings
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mysecretpassword
- POSTGRES_DB=data
shm_size: 312m
restart: on-failure
healthcheck:
# HACK Due to the installation of Postgis extension the database is restarted, the healthcheck checks if the database is up for longer than specified time.
test:
[
"CMD-SHELL",
"/healthcheck_postgis_uptime.sh postgresql://postgres:mysecretpassword@localhost/data 10 second",
]
interval: 5s
timeout: 1s
retries: 3
start_period: 30s # Failures in 30 seconds do not mark container as unhealthy
migrate:
build:
context: datastore/migrate
environment:
- DB_USER=postgres
- DB_PASS=mysecretpassword
- DB_URL=db
- DB_NAME=data
depends_on:
db:
condition: service_healthy
store:
build:
context: datastore/datastore
ports:
- "50050:50050"
- "6060:6060" # for flame graphing
- "8081:8081"
environment:
- PGHOST=db
- PGPORT=5432
- PGDBNAME=data
- DYNAMICTIME=$DYNAMICTIME
- LOTIME=$LOTIME
- HITIME=$HITIME
- CLEANUPINTERVAL=$CLEANUPINTERVAL
- PUTOBSLIMIT=$PUTOBSLIMIT
- LOGREQSTATS=true
restart: on-failure
healthcheck:
test:
["CMD-SHELL", "exit $(/bin/grpc_health_probe -addr=localhost:50050)"]
interval: 5s
timeout: 1s
retries: 15
start_period: 60s
depends_on:
migrate:
condition: service_completed_successfully
api:
build:
context: api
ports:
- "8008:8000"
environment:
- DSHOST=store
- DSPORT=50050
- TRUSTED_PROXIES=${TRUSTED_PROXIES:-127.0.0.0/8,::1}
- GUNICORN_CMD_ARGS=--bind 0.0.0.0:8000 --workers=4 --access-logfile -
depends_on:
store:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:8000/health || exit 1"]
interval: 5s
timeout: 1s
retries: 3
start_period: 30s # Failures in 30 seconds do not mark container as unhealthy
api-unit:
profiles: ["test"]
build:
context: api
dockerfile: unit.Dockerfile
volumes:
- ./api/test/output:/app/output
ingest:
build:
context: ingest
ports:
- "8009:8001"
network_mode: ""
environment:
- DSHOST=${DSHOST:-store}
- DSPORT=${DSPORT:-50050}
- DYNAMICTIME=$DYNAMICTIME
- LOTIME=$LOTIME
- HITIME=$HITIME
- MQTT_HOST=${MQTT_HOST:-mqtt}
- MQTT_USERNAME=${MQTT_USERNAME}
- MQTT_PASSWORD=${MQTT_PASSWORD}
- MQTT_PORT=${MQTT_PORT:-1883}
- MQTT_TLS=${MQTT_TLS:-False}
- MQTT_PROTOCOL_VERSION=${MQTT_PROTOCOL_VERSION:-5}
- MQTT_TOPIC_PREPEND=${MQTT_TOPIC_PREPEND:-'TEMP_TOPIC'}
- WIS2_TOPIC=${WIS2_TOPIC:-'TEMP_TOPIC'}
- WIS2_METADATA_RECORD_ID=test_metadata_id
- WIS2_MQTT_HOST=${MQTT_HOST:-mqtt_wis2}
- WIS2_MQTT_USERNAME=${MQTT_USERNAME:-}
- WIS2_MQTT_PASSWORD=${MQTT_PASSWORD:-}
- WIS2_MQTT_TLS=${MQTT_TLS:-False}
- WIS2_MQTT_PORT=${MQTT_PORT:-1884}
- INGEST_LOGLEVEL=INFO
- GUNICORN_CMD_ARGS=--bind 0.0.0.0:8001 --workers=4 --access-logfile -
depends_on:
store:
condition: service_healthy
ingest-unit:
profiles: ["test"]
build:
context: ingest
dockerfile: unit.Dockerfile
volumes:
- ./ingest/test/output:/app/output
mqtt:
image: eclipse-mosquitto
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- ./mosquitto:/etc/mosquitto
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
mqtt_wis2:
image: eclipse-mosquitto
restart: unless-stopped
ports:
- "1884:1884"
volumes:
- ./mosquitto:/etc/mosquitto
- ./mosquitto/mosquitto_wis2.conf:/mosquitto/config/mosquitto.conf
client:
profiles: ["test"]
build:
context: datastore/examples/clients/python
environment:
- DSHOST=store
- DSPORT=50050
depends_on:
store:
condition: service_healthy
loader:
profiles: ["test"]
build:
context: datastore/data-loader
environment:
- DSHOST=store
- DSPORT=50050
- BASE_URL=http://api:8000
depends_on:
store:
condition: service_healthy
ingest-loader:
profiles: ["test"]
build:
context: datastore/data-loader
args:
THROUGH_INGEST: "true"
environment:
- INGEST_URL=http://ingest:8001/json
depends_on:
store:
condition: service_healthy
ingest:
condition: service_started
integration:
profiles: ["test"]
build:
context: datastore/integration-test
environment:
- DSHOST=store
- DSPORT=50050
- BASE_URL=http://api:8000
depends_on:
api:
condition: service_healthy
performance:
profiles: ["test"]
build:
context: datastore/load-test
environment:
- DSHOST=store
- DSPORT=50050
volumes:
- ./datastore/load-test/output:/load-test/output:rw
depends_on:
store:
condition: service_healthy
rodeo-profile-test:
profiles: ["test"]
image: ghcr.io/metno/sedr
depends_on:
api:
condition: service_healthy
command: --url http://api:8000
prometheus:
profiles: ["monitoring"]
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
prometheus-postgres-exporter:
profiles: ["monitoring"]
image: quay.io/prometheuscommunity/postgres-exporter
environment:
- DATA_SOURCE_URI=db:5432/data
- DATA_SOURCE_USER=postgres
- DATA_SOURCE_PASS=mysecretpassword
ports:
- "9187:9187"
volumes:
- ./prometheus/postgres_exporter.yml:/postgres_exporter.yml:ro
depends_on:
db:
condition: service_healthy
command:
[
"--collector.stat_statements",
"--collector.stat_user_tables",
"--collector.stat_activity_autovacuum",
]
grafana:
profiles: ["monitoring"]
image: grafana/grafana-oss:11.2.0
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=mysecretpassword
volumes:
- grafana-storage:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning:rw
- ./grafana/dashboards:/var/lib/grafana/dashboards:rw
depends_on:
- prometheus
volumes:
ts-data:
prometheus-data:
grafana-storage: