-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
176 lines (172 loc) · 6.2 KB
/
Copy pathdocker-compose.yml
File metadata and controls
176 lines (172 loc) · 6.2 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
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
services:
# CPU-only deployment
depth-anything-3-cpu:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_TYPE: base
image: depth_anything_3_ros2:cpu
container_name: da3_ros2_cpu
stdin_open: true
tty: true
network_mode: host
environment:
- ROS_DOMAIN_ID=0
- DISPLAY=${DISPLAY}
# Model configuration (override detected defaults)
- DA3_MODEL=${DA3_MODEL:-}
- DA3_INFERENCE_HEIGHT=${DA3_INFERENCE_HEIGHT:-}
- DA3_INFERENCE_WIDTH=${DA3_INFERENCE_WIDTH:-}
- DA3_VRAM_LIMIT_MB=${DA3_VRAM_LIMIT_MB:-}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./models:/root/.cache/huggingface:rw
- ./examples:/examples:ro
- ./config:/app/config:ro
command: bash -c "source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash && exec bash"
# GPU-enabled deployment (requires nvidia-docker)
depth-anything-3-gpu:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_TYPE: cuda-base
CUDA_VERSION: 12.2.0
image: depth_anything_3_ros2:gpu
container_name: da3_ros2_gpu
stdin_open: true
tty: true
network_mode: host
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=0
- DISPLAY=${DISPLAY}
# Model configuration (override detected defaults)
- DA3_MODEL=${DA3_MODEL:-}
- DA3_INFERENCE_HEIGHT=${DA3_INFERENCE_HEIGHT:-}
- DA3_INFERENCE_WIDTH=${DA3_INFERENCE_WIDTH:-}
- DA3_VRAM_LIMIT_MB=${DA3_VRAM_LIMIT_MB:-}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./models:/root/.cache/huggingface:rw
- ./examples:/examples:ro
- ./config:/app/config:ro
- /dev:/dev:rw # For camera access
privileged: true # Required for camera access
command: bash -c "source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash && exec bash"
# Jetson ARM64 deployment (for NVIDIA Jetson devices)
# Requires JetPack 6.2+ (L4T R36.4.x) with TensorRT 10.3 on host
# Run: bash scripts/deploy_jetson.sh
depth-anything-3-jetson:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_TYPE: jetson-base
L4T_VERSION: r36.4.0 # Base image - matches host L4T R36.4.x
image: depth_anything_3_ros2:jetson
container_name: da3_ros2_jetson
stdin_open: true
tty: true
network_mode: host
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=0
- DISPLAY=${DISPLAY}
# Model configuration (override detected defaults)
- DA3_MODEL=${DA3_MODEL:-}
- DA3_INFERENCE_HEIGHT=${DA3_INFERENCE_HEIGHT:-}
- DA3_INFERENCE_WIDTH=${DA3_INFERENCE_WIDTH:-}
- DA3_VRAM_LIMIT_MB=${DA3_VRAM_LIMIT_MB:-}
# TensorRT configuration
- DA3_ENGINE_PATH=${DA3_ENGINE_PATH:-/app/models/tensorrt/da3-small-fp16.engine}
- DA3_TENSORRT_AUTO=${DA3_TENSORRT_AUTO:-false}
# Host-container split mode (runs TRT on host, ROS2 in container)
- DA3_HOST_TRT=${DA3_HOST_TRT:-false}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./models:/root/.cache/huggingface:rw
- ./models/tensorrt:/app/models/tensorrt:rw
- ./models/onnx:/app/models/onnx:ro
- ./examples:/examples:ro
- ./config:/app/config:ro
- /dev:/dev:rw
# Shared memory for host-container TRT communication
- /tmp/da3_shared:/tmp/da3_shared:rw
# Fast shared memory IPC via /dev/shm (RAM-backed)
- /dev/shm/da3:/dev/shm/da3:rw
# Mount host TensorRT 10.3 (JetPack 6.2+) for DA3 compatibility
- /usr/src/tensorrt:/usr/src/tensorrt:ro
- /usr/lib/aarch64-linux-gnu/libnvinfer.so.10.3.0:/usr/lib/aarch64-linux-gnu/libnvinfer.so.10:ro
- /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.10.3.0:/usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.10:ro
- /usr/lib/aarch64-linux-gnu/libnvonnxparser.so.10.3.0:/usr/lib/aarch64-linux-gnu/libnvonnxparser.so.10:ro
privileged: true
command: bash -c "source /opt/ros/humble/install/setup.bash 2>/dev/null || source /opt/ros/humble/setup.bash && source /ros2_ws/install/setup.bash && exec bash"
# Development environment with mounted source
depth-anything-3-dev:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_TYPE: cuda-base
image: depth_anything_3_ros2:dev
container_name: da3_ros2_dev
stdin_open: true
tty: true
network_mode: host
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=0
- DISPLAY=${DISPLAY}
# Model configuration (override detected defaults)
- DA3_MODEL=${DA3_MODEL:-}
- DA3_INFERENCE_HEIGHT=${DA3_INFERENCE_HEIGHT:-}
- DA3_INFERENCE_WIDTH=${DA3_INFERENCE_WIDTH:-}
- DA3_VRAM_LIMIT_MB=${DA3_VRAM_LIMIT_MB:-}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./models:/root/.cache/huggingface:rw
- ./examples:/examples:ro
- .:/ros2_ws/src/depth_anything_3_ros2:rw # Mount source for development
- /dev:/dev:rw
privileged: true
working_dir: /ros2_ws
command: bash -c "source /opt/ros/humble/setup.bash && colcon build --packages-select depth_anything_3_ros2 && bash"
# Standalone node with USB camera
depth-anything-3-usb-camera:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_TYPE: cuda-base
image: depth_anything_3_ros2:gpu
container_name: da3_usb_camera
network_mode: host
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=0
# Model configuration (override detected defaults)
- DA3_MODEL=${DA3_MODEL:-}
- DA3_INFERENCE_HEIGHT=${DA3_INFERENCE_HEIGHT:-}
- DA3_INFERENCE_WIDTH=${DA3_INFERENCE_WIDTH:-}
- DA3_VRAM_LIMIT_MB=${DA3_VRAM_LIMIT_MB:-}
volumes:
- ./models:/root/.cache/huggingface:rw
- ./config:/app/config:ro
- /dev:/dev:rw
privileged: true
command: >
bash -c "
source /opt/ros/humble/setup.bash &&
source /ros2_ws/install/setup.bash &&
ros2 launch depth_anything_3_ros2 usb_camera_example.launch.py
"