forked from IndustryEssentials/ymir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·188 lines (180 loc) · 5.4 KB
/
docker-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
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
version: "3.3"
services:
gateway:
image: industryessentials/ymir-gateway:release-2.5.0
env_file:
- .env
ports:
- ${NGINX_PORT}:80
volumes:
- ${YMIR_PATH}/ymir-data/logs:/app_logs
networks:
- ymirnetwork
yapi:
image: industryessentials/ymir-backend:release-2.5.0
command: bash -c 'cd /yapi && supervisord -nc supervisor/supervisord.conf'
env_file:
- .env
volumes:
- ${YMIR_PATH}/ymir-data/logs:/app_logs
runtime: ${SERVER_RUNTIME}
networks:
- ymirnetwork
depends_on:
- backend
healthcheck:
test: curl --fail -s http://localhost:80/health || exit 1
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
backend:
image: industryessentials/ymir-backend:release-2.5.0
env_file:
- .env
runtime: ${SERVER_RUNTIME}
environment:
- BACKEND_REDIS_URL=redis://redis:6379/0
# controller
- NVIDIA_VISIBLE_DEVICES=all
- MODELS_PATH=${YMIR_PATH}/ymir-models
- ASSETS_PATH=${YMIR_PATH}/ymir-assets
- CONTROLLER_LOG_PATH=${YMIR_PATH}/ymir-data/logs
# app
- DATABASE_URI=mysql+pymysql://${MYSQL_INITIAL_USER}:${MYSQL_INITIAL_PASSWORD}@db/ymir
- GRPC_CHANNEL=127.0.0.1:50066
- SHARED_DATA_DIR=/ymir-sharing
- NGINX_DATA_PATH=/ymir-storage
# arq
- CHECK_INTERVAL_IN_SECONDS=30
# monitor
- MONITOR_URL=http://127.0.0.1:9098
- APP_API_HOST=127.0.0.1:80
# OpenPai
- OPENPAI_HOST=${OPENPAI_HOST}
- OPENPAI_TOKEN=${OPENPAI_TOKEN}
- OPENPAI_STORAGE=${OPENPAI_STORAGE}
- OPENPAI_USER=${OPENPAI_USER}
# viewer
- VIEWER_HOST_PORT=9527
- MONGODB_URI=mongodb://${MYSQL_INITIAL_USER}:${MYSQL_INITIAL_PASSWORD}@mongodb:${MONGODB_HOST_PORT}
volumes:
- "${BACKEND_SANDBOX_ROOT}:${BACKEND_SANDBOX_ROOT}"
- "${YMIR_PATH}/ymir-data/logs:/app_logs"
- "${YMIR_PATH}/ymir-models:${YMIR_PATH}/ymir-models"
- "${YMIR_PATH}/ymir-assets:${YMIR_PATH}/ymir-assets"
# special volumes for start container in container
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /usr/bin/nvidia-docker:/usr/bin/nvidia-docker
- /usr/bin/nvidia-smi:/usr/bin/nvidia-smi
- /lib64/libltdl.so.7:/lib64/libltdl.so.7
# app
- ${YMIR_PATH}/ymir-storage:/ymir-storage
- ${YMIR_PATH}/ymir-sharing:/ymir-sharing
# tensorboard
- "${TENSORBOARD_ROOT}:${TENSORBOARD_ROOT}"
depends_on:
- db
- redis
- tensorboard
- mongodb
command: bash -c 'cd /app && supervisord -nc supervisor/supervisord.conf'
restart: on-failure:10
healthcheck:
test: bash health_check.sh || exit 1
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
networks:
- ymirnetwork
redis:
image: industryessentials/ymir-backend-redis
command: redis-server /config/redis/redis.conf --loadmodule /usr/lib/redis/modules/redisgraph.so
volumes:
- ${YMIR_PATH}/redis:/var/log/redis
- ${YMIR_PATH}/redis:/data
restart: on-failure:10
healthcheck:
test: ["CMD", "redis-cli","ping"]
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
networks:
- ymirnetwork
web:
image: industryessentials/ymir-web:release-2.5.0
volumes:
- "${YMIR_PATH}/ymir-models:/data/ymir/ymir-models"
- "${YMIR_PATH}/ymir-assets:/data/ymir/ymir-assets"
- "${YMIR_PATH}/ymir-storage:/data/ymir/ymir-storage"
environment:
- LABEL_TOOL_HOST_PORT=${LABEL_TOOL_HOST_PORT}
- DEPLOY_MODULE_URL=${DEPLOY_MODULE_URL}
- PUBLIC_IMAGE_URL=${PUBLIC_IMAGE_URL}
restart: on-failure:10
depends_on:
- backend
healthcheck:
test: curl --fail -s http://localhost:80/health || exit 1
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
networks:
- ymirnetwork
db:
image: 'mysql/mysql-server:8.0.25'
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_INITIAL_USER}
- MYSQL_PASSWORD=${MYSQL_INITIAL_PASSWORD}
volumes:
- ${YMIR_PATH}/mysql:/var/lib/mysql
restart: on-failure:10
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
networks:
- ymirnetwork
tensorboard:
image: tensorflow/tensorflow:2.9.1
env_file:
- .env
volumes:
- "${TENSORBOARD_ROOT}:${TENSORBOARD_ROOT}"
command: tensorboard --logdir ${TENSORBOARD_ROOT} --port 6006 --bind_all
restart: on-failure:10
healthcheck:
test: curl --fail -s http://localhost:6006 || exit 1
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
networks:
- ymirnetwork
mongodb:
image: mongo:4.4
environment:
- MONGO_INITDB_ROOT_USERNAME=${MYSQL_INITIAL_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MYSQL_INITIAL_PASSWORD}
restart: on-failure:10
command: mongod --port ${MONGODB_HOST_PORT} --auth --nojournal
volumes:
- ${YMIR_PATH}/ymir-viewer/mongo_data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongodb:${MONGODB_HOST_PORT}/test --quiet
interval: 60s
timeout: 6s
retries: 3
start_period: 30s
networks:
- ymirnetwork
networks:
ymirnetwork: