-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
167 lines (143 loc) · 4.53 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
# export DUID="$(id -u)"; export DGID="$(id -g)"
# docker compose run --service-ports --rm base
version: "3.9"
name: ezdev
x-data: &data
# Modify the paths before the ':' in next 4 lines to match your system
volumes:
- ${HOME}/exp:/exp
- /work:/work # only needed if your exp, unity-envs or navsim folders are symlinked from here
x-code: &code
volumes:
- ${PWD}:/workspace
x-exportx: &exportx
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XAUTHORITY}:${XAUTHORITY}
- $XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR
- /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- XAUTHORITY
- XDG_RUNTIME_DIR
x-deploy-nvidia: &deploy-nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
#device_ids: ['0', '3']
capabilities: [gpu]
x-debian-image: &debian-image
debian:11.6-slim
x-img: &img
${IMAGE:-debian:11.6-slim}
services:
# DUID=`id -u` DGID=`id -g` docker compose build fixid
fixid:
image: *img
build:
context: .
dockerfile: dockerfiles/Dockerfile-fixid
args:
image: *img
duid: ${DUID:-1000}
dgid: ${DGID:-1000}
runtime-base:
<<: [*data]
image: *debian-image
working_dir: /workspace
runtime-base-nvidia:
extends:
service: runtime-base
<<: [*deploy-nvidia]
command: bash -c "nvidia-smi"
runtime-base-nvidia-x:
extends:
service: runtime-base-nvidia
<<: [*exportx]
command: bash -c "nvidia-smi"
dev-base:
extends:
service: runtime-base
<<: [*code]
dev-base-nvidia:
extends:
service: runtime-base-nvidia
<<: [*code]
dev-base-nvidia-x:
extends:
service: runtime-base-nvidia-x
<<: [*code]
# Three base
# base - nvidia-smi and glx works, vulkan doesnt work in this
# conda : base with conda-mamba
# ai-conda : ai with conda-mamba
base-ubuntu2004:
image: ghcr.io/armando-fandango/ez/ez:0.4-base-ubuntu2004
command: bash -c "nvidia-smi; vulkaninfo; glxinfo"
build:
context: .
dockerfile: dockerfiles/Dockerfile-base-ubuntu2004
args:
- from=ubuntu:20.04
base:
extends:
service: dev-base
image: ghcr.io/armando-fandango/ezdev/ezdev:0.5-base-bullseye-slim
command: bash -c "lsb_release -a 2> /dev/null ; cmake --version | head -1; echo Node `node --version`; echo yarn `yarn --version`"
build:
context: .
dockerfile: dockerfiles/Dockerfile-base-ubuntu2004
args:
from: *debian-image
base-x:
extends:
service: dev-base-nvidia-x
image: ghcr.io/armando-fandango/ezdev/ezdev:0.5-base-bullseye-slim
command: bash -c "echo =========================; \
echo 'NVIDIA Info:';nvidia-smi -L; nvidia-smi -B; echo =========================; \
echo 'Vulkan Info:';vulkaninfo 1>/dev/null; vulkaninfo 2>/dev/null | tail +5 | head -5 ; \
echo 'OpenGL Info:';glxinfo | head -5; echo ==============================; \
echo 'Run vkcube, vkcubecc, glxgears, glxheads to check out cool graphics test'"
conda:
extends:
service: dev-base
image: ghcr.io/armando-fandango/ezdev/ezdev:0.5-conda-bullseye-slim
command: bash -c "which python; python -V;
which conda; conda -V; which mamba; mamba -V"
build:
context: .
dockerfile: dockerfiles/Dockerfile-conda-ubuntu2004
args:
from: ghcr.io/armando-fandango/ezdev/ezdev:0.5-base-bullseye-slim
ports:
- "8888"
iot:
extends:
service: runtime-base
image: ghcr.io/armando-fandango/ezdev/ezdev:0.6-iot-bullseye-slim
command: bash -c "ls"
build:
context: .
dockerfile: dockerfiles/Dockerfile-iot-ubuntu2004
args:
from: ghcr.io/armando-fandango/ezdev/ezdev:0.5-base-bullseye-slim
ai:
extends:
service: dev-base-nvidia
image: ghcr.io/armando-fandango/ezdev/ezdev:0.6-ai-conda-bullseye-slim
command: bash -c "nvidia-smi; which python; python -V;
which conda; conda -V; which mamba; mamba -V; echo 'torch.cuda:';
python -c 'import torch; print(torch.cuda.is_available()); print(torch.version.cuda)';
while sleep 1000; do :; done"
build:
context: .
dockerfile: dockerfiles/Dockerfile-ai-ubuntu2004
args:
from: ghcr.io/armando-fandango/ezdev/ezdev:0.5-conda-bullseye-slim
ports:
- "8888"