-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (62 loc) · 3.24 KB
/
docker-compose.yml
File metadata and controls
64 lines (62 loc) · 3.24 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
# FiGS full development environment (with coverage_view_selection)
# For the environment without coverage_view_selection, use docker-compose.base.yml instead.
# For SINGER development, use the docker-compose.yml in the SINGER repo instead.
services:
figs:
image: figs:latest
build:
context: .
dockerfile: Dockerfile.FiGS
args:
CUDA_ARCHITECTURES: ${CUDA_ARCHITECTURES:-}
volumes:
# Mount FiGS-Standalone for editable install (editable from host and container)
- .:/workspace/FiGS-Standalone
# Mount coverage_view_selection for editable install
- ../coverage_view_selection:/workspace/coverage_view_selection
# Mount data directory at same path as host so symlinks work
- ${DATA_PATH:-/media/admin/data/StanfordMSL/nerf_data}:${DATA_PATH:-/media/admin/data/StanfordMSL/nerf_data}
working_dir: /workspace/FiGS-Standalone
environment:
- DISPLAY=${DISPLAY:-}
- CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0}
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
network_mode: host
shm_size: '12gb'
stdin_open: true
tty: true
command: >
bash -c "
HOST_UID=$$(stat -c '%u' /workspace/FiGS-Standalone)
HOST_GID=$$(stat -c '%g' /workspace/FiGS-Standalone)
if ! getent passwd $$HOST_UID >/dev/null 2>&1; then
groupadd -g $$HOST_GID figs 2>/dev/null || true
useradd -u $$HOST_UID -g $$HOST_GID -m -s /bin/bash figs 2>/dev/null || true
fi
USERNAME=$$(getent passwd $$HOST_UID | cut -d: -f1)
# Fix any root-owned egg-info dirs from previous runs
find /workspace -maxdepth 3 -name '*.egg-info' -not -user $$HOST_UID -exec chown -R $$HOST_UID:$$HOST_GID {} + 2>/dev/null || true
# Install editable packages as host user so .egg-info is host-owned
runuser -u $$USERNAME -- python -m pip install -e /workspace/FiGS-Standalone --no-deps -q || { echo 'FATAL: failed to install figs'; exit 1; }
runuser -u $$USERNAME -- python -m pip install -e /workspace/FiGS-Standalone/gemsplat --no-deps -q || { echo 'FATAL: failed to install gemsplat'; exit 1; }
# Replace system nerfstudio with custom fork if available
if [ -d /workspace/coverage_view_selection/nerfstudio ]; then
python -m pip uninstall nerfstudio -y -q
rm -rf /usr/local/lib/python3.10/dist-packages/nerfstudio
python -m pip install -e /workspace/coverage_view_selection/nerfstudio --no-deps -q || { echo 'FATAL: failed to install custom nerfstudio'; exit 1; }
echo 'Installed custom nerfstudio fork from coverage_view_selection'
else
echo 'No custom nerfstudio fork found, using stock nerfstudio from image'
fi
runuser -u $$USERNAME -- python -m pip install -e /workspace/coverage_view_selection --no-deps -q || { echo 'FATAL: failed to install coverage_view_selection'; exit 1; }
# Verify all packages are importable
runuser -u $$USERNAME -- python -c 'import figs, gemsplat, nbv_gym' || { echo 'FATAL: package import check failed'; exit 1; }
runuser -u $$USERNAME -- figs-info
exec runuser -u $$USERNAME -- bash -l
"