-
Notifications
You must be signed in to change notification settings - Fork 20
/
docker-compose.yml
394 lines (378 loc) · 11.2 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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# version: "3"
services:
#---------------------------------
# Project Manager
#---------------------------------
project_manager:
build:
context: ./project_manager
# command: >
# sh -c "chmod 777 ./wait_for_postgres.sh &&
# ./wait_for_postgres.sh &&
# python manage.py makemigrations tango &&
# python manage.py makemigrations datasets &&
# python manage.py makemigrations targets &&
# python manage.py migrate &&
# python manage.py runserver 0.0.0.0:8085"
command: >
sh -c "chmod 777 ./wait_for_postgres.sh &&
./wait_for_postgres.sh &&
python manage.py migrate &&
python manage.py loaddata base_model_data.json &&
python manage.py runserver 0.0.0.0:8085"
volumes:
# - ./project_manager:/code
- shared:/shared
- ${COCODIR:-./autonn/autonn/autonn_core/datasets/coco}:/shared/datasets/coco
- ${COCO128DIR:-./autonn/autonn/autonn_core/datasets/coco128}:/shared/datasets/coco128
- /var/run/docker.sock:/var/run/docker.sock
hostname: projectmanager
ports:
- "8085:8085"
environment:
- POSTGRES_NAME=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
depends_on:
- postgresql
#---------------------------------
# DB for Project Manager
#---------------------------------
postgresql:
image: postgres:15.4
restart: always
volumes:
- postgreSQL:/var/lib/postgresql/data
environment:
- POSTGRES_NAME=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
#---------------------------------
# DB for labelling tool
#---------------------------------
# mariadb:
# container_name: "mariadb"
# image: mariadb:10
# ports:
# - 3306:3306
# volumes:
# - "./labelling/Deployment/db/my.cnf:/etc/mysql/my.cnf"
# - "./labelling/data:/var/lib/mysql"
# - "./labelling/Deployment/test/:/docker-entrypoint-initdb.d/"
# environment:
# MARIADB_DATABASE: labelling
# MARIADB_USER: username
# MARIADB_PASSWORD: password
# MARIADB_ROOT_PASSWORD: password
# restart: always
#---------------------------------
# Labelling tool
#---------------------------------
labelling:
build:
context: ./labelling
volumes:
- ./labelling/dataset:/var/appdata
- ./labelling/datadb:/var/lib/mysql
- shared:/shared
ports:
- "8086:80" # for Web UI
- "8095:10236" # for Rest API
#---------------------------------
# AutoNN: AutoNN
#---------------------------------
autonn:
build:
context: ./autonn/autonn
shm_size: "256M"
ipc: host
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8100"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
- utility
- compute
- video
environment:
- NVIDIA_VISIBLE_DEVICES=${GPU_NUM:-all}
volumes:
- ./autonn/autonn:/source
- shared:/shared
- ${COCODIR:-./autonn/autonn/autonn_core/datasets/coco}:/shared/datasets/coco
- ${COCO128DIR:-./autonn/autonn/autonn_core/datasets/coco128}:/shared/datasets/coco128
hostname: autonn
ports:
- "8100:8100" # visualizer (vision model)
- "8101:8101" # streamlit (llm)
#---------------------------------
# Base Model Selector
#---------------------------------
# bms:
# build:
# context: ./base_model_select
# shm_size: "256M"
# command: >
# sh -c "python manage.py makemigrations &&
# python manage.py migrate --run-syncdb &&
# python manage.py runserver 0.0.0.0:8081"
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# capabilities:
# - gpu
# - utility
# - compute
# - video
# environment:
# - NVIDIA_VISIBLE_DEVICES=${GPU_NUM:-all}
# hostname: bms
# volumes:
# - ./base_model_select:/source
# - shared:/shared
# ports:
# - "8081:8081"
# #---------------------------------
# # AutoNN: Bakcbone-NAS
# #---------------------------------
# autonn_bb:
# build:
# context: ./autonn/backbone_nas
# shm_size: '256M'
# ipc: host
# command: >
# sh -c "python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py runserver 0.0.0.0:8087"
# # use the below lines commented out if you want to use gpu
# # deploy:
# # resources:
# # reservations:
# # devices:
# # - driver: nvidia
# # capabilities:
# # - gpu
# # - utility
# # - compute
# # - video
# # environment:
# # - NVIDIA_VISIBLE_DEVICES=all
# volumes:
# - ./autonn/backbone_nas:/source
# - shared:/shared
# ports:
# - "8087:8087"
# #---------------------------------
# # AutoNN: Neck-NAS
# #---------------------------------
# autonn_nk:
# build:
# context: ./autonn/neck_nas
# shm_size: '256M'
# ipc: host
# command: >
# sh -c "python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py runserver 0.0.0.0:8089"
# # use the below lines commented out if you want to use gpu
# # deploy:
# # resources:
# # reservations:
# # devices:
# # - driver: nvidia
# # capabilities:
# # - gpu
# # - utility
# # - compute
# # - video
# # environment:
# # - NVIDIA_VISIBLE_DEVICES=all
# volumes:
# - ./autonn/neck_nas:/source
# - shared:/shared
# # - /Data:/shared/datasets # for local tests
# ports:
# - "8089:8089"
#---------------------------------
# AutoNN: YoloE
#---------------------------------
# autonn_yoloe:
# build:
# context: ./autonn/YoloE
# shm_size: "256M"
# ipc: host
# command: >
# sh -c "python manage.py pretrained_supernet &&
# python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py runserver 0.0.0.0:8090"
# # use the below lines commented out if you want to use gpu
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# capabilities:
# - gpu
# - utility
# - compute
# - video
# environment:
# - NVIDIA_VISIBLE_DEVICES=${GPU_NUM:-all}
# volumes:
# - ./autonn/YoloE:/source
# - shared:/shared
# - ./autonn/YoloE/sample_yaml/dataset.yaml:/shared/datasets/coco/dataset.yaml # TEMP FILE UNTIL LABELLING MODULE WORKING
# - ${COCODIR:-./autonn/YoloE/sample_data/coco128}:/shared/datasets/coco # TEMP FILE UNTIL LABELLING MODULE WORKING
# hostname: yoloe
# ports:
# - "8090:8090"
#---------------------------------
# AutoNN: ResNet
#---------------------------------
# autonn_resnet:
# build:
# context: ./autonn/ResNet
# shm_size: "256M"
# ipc: host
# command: >
# sh -c "python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py runserver 0.0.0.0:8092"
# # use the below lines commented out if you want to use gpu
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# capabilities:
# - gpu
# - utility
# - compute
# - video
# environment:
# - NVIDIA_VISIBLE_DEVICES=all
# volumes:
# - ./autonn/ResNet:/source
# - shared:/shared
# hostname: autonn-resnet
# ports:
# - "8092:8092"
#---------------------------------
# code_gen Build
#---------------------------------
code_gen:
build:
context: ./deploy_codegen/optimize_codegen
hostname: codeGen
volumes:
- ./deploy_codegen/optimize_codegen:/source
- shared:/tango
command: >
sh -c "cd /app && python3 code_gen.py"
ports:
- 8888:8888
#---------------------------------
# Cloud deploy (with target image build)
#---------------------------------
cloud_deploy:
hostname: cloud-deploy
build:
context: ./deploy_targets/cloud
# -- command is not requred in favor of s6-overlay supervisor
# command: >
# sh -c "python main.py"
environment:
- CLOUD_MANAGER_PORT=8088
# GCP auth settings
- GOOGLE_APPLICATION_CREDENTIALS=/source/cloud_manager/service-account-file.json
- GCP_REGION=asia-northeast3
- GCP_PROJECT_ID=tango-project
volumes:
- ./deploy_targets/cloud:/source
- /var/run/docker.sock:/var/run/docker.sock
- shared:/shared
ports:
- "7007:7007" # image builder (API)
- "8080:8080" # image builder (GUI)
- "8890:8890" # cloud manager
#---------------------------------
# K8S deploy
#---------------------------------
# kube_deploy:
# hostname: kube-deploy
# build:
# context: ./deploy_targets/k8s
# container_name: "tango_k8s"
# privileged: true
# command: bash -c "cd /app && python3 k8s_deploy.py"
# volumes:
# - $HOME/.kube:/home/root/.kube
# - shared:/app/tango
# - ./deploy_targets/k8s:/app
# - /var/run/docker.sock:/var/run/docker.sock
# environment:
# - "HOME=/home/root"
# ports:
# - "8901:8901"
#---------------------------------
# K8S docker registry(image manager)
#---------------------------------
# registry:
# image: registry
# container_name: registry
# volumes:
# - registry_data:/var/lib/registry/docker/registry/v2
# ports:
# - "8903:5000"
#---------------------------------
# ondevice_deploy Build
#---------------------------------
ondevice_deploy:
hostname: ondevice
build:
context: ./deploy_targets/ondevice
volumes:
- ./deploy_targets/ondevice:/source
- shared:/tango
command: >
sh -c "cd /app && python3 ondevice_deploy.py"
ports:
- 8891:8891
#---------------------------------
# Visualizer
#---------------------------------
# viz2code:
# hostname: viz2code
# build:
# context: ./visualization
# command: >
# sh -c "cd ./visualization/frontend &&
# npm run build &&
# cd ..
# python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py runserver react 0.0.0.0:8091"
# volumes:
# - ./visualization:/source
# - shared:/shared
# ports:
# - "8091:8091"
# # depends_on:
# # - postgresql
#---------------------------------
# Volumes
#---------------------------------
volumes:
registry_data: {}
postgreSQL: # for Proejct Manager
shared: # shared Directory