-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.base.yml
More file actions
52 lines (51 loc) · 2.32 KB
/
docker-compose.base.yml
File metadata and controls
52 lines (51 loc) · 2.32 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
# FiGS base development environment (without coverage_view_selection)
# Usage: docker compose -f docker-compose.base.yml up
#
# For the full environment with coverage_view_selection, use docker-compose.yml 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 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; }
# Verify all packages are importable
runuser -u $$USERNAME -- python -c 'import figs, gemsplat' || { echo 'FATAL: package import check failed'; exit 1; }
runuser -u $$USERNAME -- figs-info
exec runuser -u $$USERNAME -- bash -l
"