-
Notifications
You must be signed in to change notification settings - Fork 9
/
compose.yml
120 lines (112 loc) · 3.54 KB
/
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
# SPDX-FileCopyrightText: ASSUME Developers
#
# SPDX-License-Identifier: AGPL-3.0-or-later
version: "3.9"
services:
assume_db:
image: timescaledev/timescaledb-ha:pg15-oss
# smaller without postgis support:
# image: timescale/timescaledb:latest-pg15
container_name: assume_db
restart: always
environment:
- POSTGRES_USER=assume
- POSTGRES_PASSWORD=assume
- POSTGRES_DB=assume
- TS_TUNE_MAX_CONNS=500
volumes:
# needed for normal image
#- ./assume-db:/var/lib/postgresql/data
# /home/postgres/data is path for timescaledev image
- ./assume-db:/home/postgres/pgdata
ports:
- 5432:5432
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
grafana:
image: grafana/grafana-oss:latest
container_name: assume_grafana
user: "104"
depends_on:
- assume_db
ports:
- 3000:3000
environment:
GF_SECURITY_ALLOW_EMBEDDING: "true"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_INSTALL_PLUGINS: "marcusolsson-dynamictext-panel,orchestracities-map-panel"
GF_SECURITY_ADMIN_USER: assume
GF_SECURITY_ADMIN_PASSWORD: "assume"
GF_RENDERING_SERVER_URL: http://renderer:8081/render
GF_RENDERING_CALLBACK_URL: http://grafana:3000/
GF_LOG_FILTERS: rendering:debug
volumes:
- ./docker_configs/grafana.ini:/etc/grafana/grafana.ini
- ./docker_configs/datasources:/etc/grafana/provisioning/datasources
- ./docker_configs/dashboards:/etc/grafana/provisioning/dashboards
- ./docker_configs/dashboard-definitions:/etc/grafana/provisioning/dashboard-definitions
restart: always
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
# to enable rendering png screenshots directly from grafana
# for example to embed them in an iframe, you can use this
renderer:
image: grafana/grafana-image-renderer:latest
container_name: renderer
profiles: ["renderer"]
ports:
- 8081
# to run a single simulation in
simulation:
container_name: simulation
image: ghcr.io/assume-framework/assume:latest
profiles: ["simulation"]
build: .
depends_on:
- assume_db
command: -s example_01a -c tiny -db "postgresql://assume:assume@assume_db:5432/assume"
# to run the simulation distributed with MQTT
mqtt-broker:
container_name: mqtt-broker
image: eclipse-mosquitto:2
restart: always
profiles: ["mqtt"]
ports:
- "1883:1883/tcp"
volumes:
- ./docker_configs/mqtt.conf:/mosquitto/config/mosquitto.conf
healthcheck:
test: "mosquitto_sub -t '$$SYS/#' -C 1 | grep -v Error || exit 1"
interval: 45s
timeout: 5s
retries: 5
# to run a distributed simulation with docker compose
simulation_mgr:
container_name: simulation_mgr
image: ghcr.io/assume-framework/assume:latest
profiles: ["mqtt"]
depends_on:
- assume_db
- mqtt-broker
environment:
DB_URI: "postgresql://assume:assume@assume_db:5432/assume"
MQTT_BROKER: mqtt-broker
entrypoint: python3 ./examples/distributed_simulation/world_manager.py
simulation_client01:
container_name: simulation_client01
image: ghcr.io/assume-framework/assume:latest
profiles: ["mqtt"]
build: .
environment:
DB_URI: "postgresql://assume:assume@assume_db:5432/assume"
MQTT_BROKER: mqtt-broker
depends_on:
- assume_db
- mqtt-broker
entrypoint: python3 ./examples/distributed_simulation/world_agent.py