-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
273 lines (264 loc) · 8.86 KB
/
docker-compose.yml
File metadata and controls
273 lines (264 loc) · 8.86 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
services:
dlstreamer-pipeline-server:
depends_on:
model_registry:
condition: service_healthy
image: ${DLSTREAMER_PIPELINE_SERVER_IMAGE}
container_name: dlstreamer-pipeline-server
hostname: dlstreamer-pipeline-server
networks:
- mraas
restart: unless-stopped
security_opt:
- no-new-privileges
environment:
AppName: "DLStreamerPipelineServer"
ENABLE_WEBRTC: true
WEBRTC_SIGNALING_SERVER: http://mediamtx-server:${WHIP_SERVER_PORT}
ENABLE_RTSP: false
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
no_proxy: ${no_proxy},${HOST_IP},${RTSP_CAMERA_IP},otel-collector,mediamtx-server,model_registry,${MR_MINIO_HOSTNAME}
NO_PROXY: ${no_proxy},${HOST_IP},${RTSP_CAMERA_IP},otel-collector,mediamtx-server,model_registry,${MR_MINIO_HOSTNAME}
GST_DEBUG: "1"
REST_SERVER_PORT: ${REST_SERVER_PORT}
S3_STORAGE_HOST: ${MR_MINIO_HOSTNAME}
S3_STORAGE_PORT: ${MR_MINIO_SERVER_PORT}
S3_STORAGE_USER: ${MR_MINIO_ACCESS_KEY}
S3_STORAGE_PASS: ${MR_MINIO_SECRET_KEY}
SERVICE_NAME: "dlstreamer-pipeline-server"
ENABLE_OPEN_TELEMETRY: true
OTEL_COLLECTOR_HOST: ${OTEL_COLLECTOR_HOST}
OTEL_COLLECTOR_PORT: ${OTEL_COLLECTOR_PORT}
OTEL_EXPORT_INTERVAL_MILLIS: ${OTEL_EXPORT_INTERVAL_MILLIS}
OPCUA_SERVER_IP: ${OPCUA_SERVER_IP}
OPCUA_SERVER_PORT: ${OPCUA_SERVER_PORT}
OPCUA_SERVER_USERNAME: ${OPCUA_SERVER_USERNAME}
OPCUA_SERVER_PASSWORD: ${OPCUA_SERVER_PASSWORD}
MQTT_HOST: nginx-reverse-proxy
MQTT_PORT: 1883
# Model Registry Microservice
MR_URL: ${MR_URL}
MR_SAVED_MODELS_DIR: ${MR_SAVED_MODELS_DIR}
MR_REQUEST_TIMEOUT: ${MR_REQUEST_TIMEOUT}
MR_VERIFY_CERT: ${MR_VERIFY_CERT}
volumes:
- vol_pipeline_root:/var/cache/pipeline_root:uid=1999,gid=1999
- /var/tmp:/var/tmp
- ./resources/${SAMPLE_APP}/:/home/pipeline-server/resources/
- ./apps/${SAMPLE_APP}/configs/pipeline-server-config.json:/home/pipeline-server/config.json
# Following devices under /dev filesystem will be needed based on usecase
# dri - GPU
# USB camera devices
# Selective mount can be done for deployment as mounting whole /dev is not recommended
- "/dev:/dev"
- "/tmp:/tmp"
# volume mount the udev database with read-only permission,so the USB3 Vision interfaces can be enumerated correctly in the container
- "/run/udev:/run/udev:ro"
# Volume mount the directory in host system where the images are stored onto the container directory system.
# - <absolute or relative path to the images directory>:/app/img_dir
#- ../DLStreamerPipelineServer/udfs:/home/pipeline-server/udfs/
group_add:
# render group ID for ubuntu 20.04 host OS
- "109"
# render group ID for ubuntu 22.04 host OS
- "110"
# render group ID for ubuntu 24.04 host OS
- "992"
device_cgroup_rules:
# Default run - device-cgroup-rule='c 189:* rmw'
# Selective rules can be applied for deployment
- 'c 189:* rmw'
- 'c 209:* rmw'
- 'a 189:* rwm'
devices:
# Following devices under /dev filesystem will be needed based on usecase
# dri - GPU
# USB camera devices
# Selective mount can be done for deployment as mounting whole /dev is not recommended
- "/dev:/dev"
mediamtx:
image: bluenviron/mediamtx:1.11.3
container_name: mediamtx-server
environment:
- MTX_LOGLEVEL=debug
- MTX_RTSP=no
- MTX_RTMP=no
- MTX_HLS=no
- MTX_SRT=no
- MTX_WEBRTCICESERVERS2_0_URL=turn:${HOST_IP}:${COTURN_UDP_PORT}
- MTX_WEBRTCICESERVERS2_0_USERNAME=${MTX_WEBRTCICESERVERS2_0_USERNAME}
- MTX_WEBRTCICESERVERS2_0_PASSWORD=${MTX_WEBRTCICESERVERS2_0_PASSWORD}
- MTX_WEBRTCTRACKGATHERTIMEOUT=10s
- MTX_WEBRTCLOCALTCPADDRESS=:8189
networks:
- mraas
coturn:
image: coturn/coturn:latest
container_name: coturn
ports:
- "${COTURN_UDP_PORT}:3478/udp"
networks:
- mraas
mqtt-broker:
image: eclipse-mosquitto
container_name: mqtt-broker
networks:
- mraas
ports:
- "1883:1883"
volumes:
- ./apps/${SAMPLE_APP}/configs/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
nginx:
image: nginx:1.27-alpine
container_name: nginx-reverse-proxy
ports:
- "80:80"
- "443:443"
volumes:
- "./apps/${SAMPLE_APP}/configs/nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
- "./apps/${SAMPLE_APP}/configs/nginx/ssl:/etc/nginx/ssl:ro"
networks:
- mraas
depends_on:
- dlstreamer-pipeline-server
- mediamtx
- prometheus
- mraas-minio
- mqtt-broker
environment:
- http_proxy=${http_proxy}
- https_proxy=${https_proxy}
- no_proxy=${no_proxy},${HOST_IP}
- NO_PROXY=${no_proxy},${HOST_IP}
restart: on-failure:5
model_registry:
image: ${DOCKER_REGISTRY}intel/model-registry:1.0.3
container_name: model_registry
hostname: model_registry
ipc: "none"
restart: unless-stopped
deploy:
resources:
limits:
memory: 4096mb
cpus: '0.30'
pids: 200
reservations:
memory: 2048mb
cpus: '0.15'
security_opt:
- no-new-privileges
healthcheck:
test: ["CMD-SHELL", "exit", "0"]
environment:
AppName: "ModelRegistry"
MIN_LOG_LEVEL: ${MR_MIN_LOG_LEVEL}
ENABLE_HTTPS_MODE: ${ENABLE_HTTPS_MODE}
MLFLOW_TRACKING_URI: postgresql+psycopg2://${POSTGRES_USER}:${MR_PSQL_PASSWORD}@mraas_postgres:${MR_PSQL_PORT}/${MR_PSQL_DATABASE}
MLFLOW_S3_ENDPOINT_URL: ${MR_MLFLOW_S3_ENDPOINT_URL}
MINIO_HOSTNAME: ${MR_MINIO_HOSTNAME}
MINIO_SERVER_PORT: ${MR_MINIO_SERVER_PORT}
MINIO_ACCESS_KEY: ${MR_MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MR_MINIO_SECRET_KEY}
MINIO_BUCKET_NAME: ${MR_MINIO_BUCKET_NAME}
SERVER_PORT: ${MR_SERVER_PORT}
LSHOST: host.docker.internal
SERVER_CERT: /run/secrets/ModelRegistry_Server/public.crt
CA_CERT: /run/secrets/ModelRegistry_Server/server-ca.crt
SERVER_PRIVATE_KEY: /run/secrets/ModelRegistry_Server/private.key
no_proxy: ${MR_MINIO_HOSTNAME}
NO_PROXY: ${MR_MINIO_HOSTNAME}
volumes:
- ./Certificates/ssl/:/run/secrets/ModelRegistry_Server:ro
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- mraas
mraas_postgres:
image: postgres:13
container_name: mraas_postgres
hostname: mraas_postgres
restart: unless-stopped
security_opt:
- no-new-privileges
environment:
AppName: "ModelRegistry"
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${MR_PSQL_PASSWORD}
POSTGRES_DB: ${MR_PSQL_DATABASE}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- mr_postgres_data:/var/lib/postgresql/data
expose:
- ${MR_PSQL_PORT}
networks:
- mraas
mraas-minio:
image: minio/minio:RELEASE.2020-12-12T08-39-07Z
container_name: ${MR_MINIO_HOSTNAME}
hostname: ${MR_MINIO_HOSTNAME}
ipc: "none"
expose:
- ${MR_MINIO_SERVER_PORT}
volumes:
- ./Certificates/ssl/:/certs/:rw
- "vol_minio_data:/data"
networks:
- mraas
restart: unless-stopped
security_opt:
- no-new-privileges
ports:
- '8000:8000'
environment:
AppName: "ModelRegistry"
MINIO_ACCESS_KEY: ${MR_MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MR_MINIO_SECRET_KEY}
ENABLE_HTTPS_MODE: ${ENABLE_HTTPS_MODE}
MINIO_BROWSER_REDIRECT_URL: https://${HOST_IP}/minio/
command: server --address ":8000" --certs-dir /certs /data
prometheus:
image: prom/prometheus:latest
container_name: prometheus
environment:
- HTTP_PROXY=${http_proxy}
- HTTPS_PROXY=${https_proxy}
- NO_PROXY=$no_proxy,otel-collector,localhost,127.0.0.1
volumes:
- ./apps/${SAMPLE_APP}/configs/open_telemetry/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command: >
--config.file=/etc/prometheus/prometheus.yml
--storage.tsdb.path=/prometheus
--web.route-prefix=/prometheus
--web.external-url=https://${HOST_IP}/prometheus
networks:
- mraas
otel-collector:
image: otel/opentelemetry-collector-contrib:0.94.0
container_name: otel-collector
environment:
HTTP_PROXY: ${http_proxy}
HTTPS_PROXY: ${https_proxy}
NO_PROXY: $no_proxy,prometheus,dlstreamer-pipeline-server,localhost,127.0.0.1
volumes:
- ./apps/${SAMPLE_APP}/configs/open_telemetry/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml # OpenTelemetry Collector config
restart: always
networks:
- mraas
networks:
mraas:
driver: bridge
volumes:
vol_pipeline_root:
driver: local
driver_opts:
type: tmpfs
device: tmpfs
vol_minio_data:
driver: local
mr_postgres_data:
driver: local
prometheus_data:
driver: local