-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
133 lines (127 loc) · 3.52 KB
/
docker-compose.yaml
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
# Reference: https://docs.docker.com/compose/compose-file/compose-file-v3
#
# Note: requires docker-compose v1.28.0+
---
version: "3.4"
services:
# Utilities (graphical tools and debugging)
utilities:
build:
context: .
dockerfile: Dockerfile.Webots
network: host
command: bash -c ". /entrypoint.sh create2_utilities rviz.launch.py"
container_name: utilities
deploy:
resources:
reservations:
devices:
- capabilities:
- gpu
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
privileged: true
stdin_open: true
tty: true
user: create2
volumes:
- /home/$USER/colcon_ws/src/create2_utilities:/colcon_ws/src/create2_utilities:rw
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./entrypoint.sh:/entrypoint.sh
working_dir: /colcon_ws
# Simulation
webots_simulation:
build:
context: .
dockerfile: Dockerfile.Webots
network: host
command: bash -c ". /entrypoint.sh create2_description spawn_robot.launch.py"
container_name: webots_simulation
deploy:
resources:
reservations:
devices:
- capabilities:
- gpu
devices:
- /dev/snd
- /dev/dri
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
privileged: true
stdin_open: true # docker run -i
tty: true # docker run -t
user: create2
volumes:
- /home/$USER/colcon_ws/src/create2_description:/colcon_ws/src/create2_description:rw
# TODO: We have our own copy of webots_ros2 with changes
- /home/$USER/colcon_ws/src/webots_ros2:/colcon_ws/src/webots_ros2:rw
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./entrypoint.sh:/entrypoint.sh
working_dir: /colcon_ws
# Robot hardware
hardware:
image: osrf/ros:foxy-desktop
command: bash -c ". /entrypoint.sh create2_bringup standalone.launch.py"
container_name: hardware
devices:
- /dev/usb
network_mode: host
privileged: true
stdin_open: true
tty: true
volumes:
- /home/$USER/colcon_ws/src/create2_hardware:/colcon_ws/src/create2_hardware:rw
- /home/$USER/colcon_ws/src/libcreate:/colcon_ws/src/libcreate:rw
- ./entrypoint.sh:/entrypoint.sh
working_dir: /colcon_ws
# Software stack
autonomy:
image: osrf/ros:foxy-desktop
command: bash -c ". /entrypoint.sh create2_navigation slam.launch.py"
container_name: autonomy
network_mode: host
privileged: true
stdin_open: true
tty: true
volumes:
- /home/$USER/colcon_ws/src/create2_autonomy:/colcon_ws/src/create2_autonomy:rw
- ./entrypoint.sh:/entrypoint.sh
working_dir: /colcon_ws
# Development
# docker-compose run --rm dev
dev:
build:
context: .
dockerfile: Dockerfile.Webots
network: host
command: /bin/bash
container_name: dev
depends_on:
- utilities
deploy:
resources:
reservations:
devices:
- capabilities:
- gpu
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
privileged: true
stdin_open: true
tty: true
user: create2
volumes:
- /home/$USER/colcon_ws:/colcon_ws:rw
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./entrypoint.sh:/entrypoint.sh
working_dir: /colcon_ws