forked from martin-sicho/genui-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-gpuworker.yml
49 lines (48 loc) · 2.43 KB
/
docker-compose-gpuworker.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
version: '3.7'
services:
celery-gpu:
restart: "always"
image: ${GENUI_DOCKER_IMAGE_PREFIX:-sichom}/genui-gpuworker:${GENUI_DOCKER_IMAGE_TAG:-latest}
container_name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}${GENUI_CELERY_NAME:-celery}-gpu_${NVIDIA_VISIBLE_DEVICES:-0}${GENUI_CELERY_CONTAINER_SUFFIX:-}
user: ${GENUI_USER_ID:-0}:${GENUI_USER_GROUP_ID:-0}
environment:
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-0}
- GENUI_BACKEND_PROTOCOL=${GENUI_PROTOCOL}
- GENUI_BACKEND_HOST=${GENUI_HOST}
- GENUI_BACKEND_PORT=${GENUI_PORT}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-genui.settings.prod}
- GENUI_BACKEND_SECRET
- POSTGRES_DB=${POSTGRES_DB:-genui}
- POSTGRES_USER=${POSTGRES_USER:-genui}
- POSTGRES_PASSWORD
- POSTGRES_HOST=${POSTGRES_HOST:-db}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PASSWORD
- GENUI_USER=${GENUI_USER:-root}
- GENUI_USER_GROUP=${GENUI_USER_GROUP:-root}
- GENUI_CELERY_NAME=${GENUI_CELERY_NAME:-celery}-gpu_${NVIDIA_VISIBLE_DEVICES:-0}
- GENUI_CELERY_QUEUES=gpu
- GENUI_CELERY_CONCURRENCY=${GENUI_CELERY_CONCURRENCY:-1}
- GENUI_CONTAINER_PREFIX=${GENUI_CONTAINER_PREFIX:-genui-docker-}
command: wait-for-it ${GENUI_CONTAINER_PREFIX:-genui-docker-}backend:${GENUI_PORT} -t 3600 -- celery -A genui worker --prefetch-multiplier 1 --concurrency ${GENUI_CELERY_CONCURRENCY:-1} -P solo -Q ${GENUI_CELERY_QUEUES:-gpu} --loglevel=info -O fair --hostname ${GENUI_CELERY_NAME:-celery}-gpu_${NVIDIA_VISIBLE_DEVICES:-0}@%h
volumes:
- ${GENUI_DATA_MOUNT:-./genuidata}/media:/genui/data/files/media/
- ${GENUI_DATA_MOUNT:-./genuidata}/home:/home/${GENUI_USER:-root}
- ${DOCKER_USER_CONFIG_MOUNT:-/etc}/group:/etc/group:ro
- ${DOCKER_USER_CONFIG_MOUNT:-/etc}/passwd:/etc/passwd:ro
- ${DOCKER_USER_CONFIG_MOUNT:-/etc}/shadow:/etc/shadow:ro
networks:
- genui_back
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ["${NVIDIA_VISIBLE_DEVICES:-0}"]
capabilities: [gpu]
networks:
genui_back:
name: ${GENUI_CONTAINER_PREFIX:-genui-docker-}backend
driver: bridge
driver_opts:
com.docker.network.driver.mtu: ${DOCKER_NET_MTU:-1500}