-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
234 lines (217 loc) · 6.28 KB
/
docker-compose.yml
File metadata and controls
234 lines (217 loc) · 6.28 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
---
#------------------------------------------------------------------------------
# UNIFIED DOCKER COMPOSE
#------------------------------------------------------------------------------
x-common-base: &common-base
privileged: true
network_mode: host
env_file:
- .env
stdin_open: true
tty: true
pull_policy: build
ipc: host
pid: "host"
x-build-template_system: &build-template_system
context: .
dockerfile: dockerfiles/template_system.dockerfile
args:
- ROS_DISTRO=${ROS_DISTRO}
- PIP_BREAK_SYSTEM_PACKAGES=${PIP_BREAK_SYSTEM_PACKAGES}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
- ROS_DOMAIN_ID=${ROS_DOMAIN_ID}
- RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION}
target: runtime
x-package-base: &package-base
<<: *common-base
build:
<<: *build-template_system
volumes:
- ./packages/src:/home/ubuntu/workspace/packages/src:cached
- ./config:/home/ubuntu/workspace/config:ro
- /var/run/lttng:/var/run/lttng:rw
x-physical-base: &physical-base
<<: *common-base
build:
<<: *build-template_system
volumes:
# Packages
- ./packages/src:/home/ubuntu/workspace/packages/src:cached
# Config
- ./config:/home/ubuntu/workspace/config:ro
# IO
- /dev:/dev
# Tracing
- /var/run/lttng:/var/run/lttng:rw
x-gui-base: &gui-base
<<: *common-base
build:
<<: *build-template_system
volumes:
# Packages
- ./packages/src:/home/ubuntu/workspace/packages/src:cached
# Config
- ./config:/home/ubuntu/workspace/config:ro
# GUI
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XDG_RUNTIME_DIR}:/tmp/runtime-ubuntu:rw
# Tracing
- /var/run/lttng:/var/run/lttng:rw
environment:
- DISPLAY=${DISPLAY}
- XDG_RUNTIME_DIR=/tmp/runtime-ubuntu
- QT_X11_NO_MITSHM=1
x-dev-base: &dev-base
<<: *common-base
build:
<<: *build-template_system
target: development
user: "ubuntu"
volumes:
# Workspace
- .:/home/ubuntu/workspace:cached
# IO
- /dev:/dev
# GUI
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ${XDG_RUNTIME_DIR}:/tmp/runtime-ubuntu:rw
# Tracing
- /var/run/lttng:/var/run/lttng:rw
environment:
- DISPLAY=${DISPLAY}
- XDG_RUNTIME_DIR=/tmp/runtime-ubuntu
- QT_X11_NO_MITSHM=1
services:
#==============================================================================
# DEVELOPMENT SERVICES
#==============================================================================
development:
<<: *dev-base
image: development:latest
container_name: development
command: ["/bin/bash"]
profiles: ["dev"]
#==============================================================================
# CORE NETWORK SERVICES
#==============================================================================
zenohd:
build:
<<: *build-template_system
privileged: true
network_mode: host
env_file:
- .env
stdin_open: true
tty: true
pull_policy: build
ipc: host
image: zenohd:latest
container_name: zenohd
command: ["ros2", "run", "rmw_zenoh_cpp", "rmw_zenohd"]
profiles: ["core", "dev", "demo", "app", "tools"]
#==============================================================================
# DEMO SERVICES
#==============================================================================
talker:
<<: *package-base
build:
<<: *build-template_system
args:
- INSTALL_PACKAGE_NAMES=${DEMO_PACKAGES}
image: talker:latest
container_name: talker
command: ["ros2", "run", "demo_nodes_cpp", "talker"]
profiles: ["demo"]
listener:
<<: *package-base
build:
<<: *build-template_system
args:
- INSTALL_PACKAGE_NAMES=${DEMO_PACKAGES}
image: listener:latest
container_name: listener
command: ["ros2", "run", "demo_nodes_cpp", "listener"]
profiles: ["demo"]
#==============================================================================
# TEMPLATE SYSTEM SERVICES
#==============================================================================
template_system:
<<: *package-base
build:
<<: *build-template_system
args:
- PACKAGE_NAMES=template_system
image: template_system:latest
container_name: template_system
command:
[
"ros2",
"launch",
"template_system",
"multi_node_system.launch.py",
"system_config_file:=${SYSTEM_CONFIG_FILE}",
"namespace:=${TEMPLATE_NAMESPACE}",
"config_dir:=/home/ubuntu/workspace/config",
]
profiles: ["app"]
#==============================================================================
# RQT SERVICES
#==============================================================================
rqt_base:
<<: *gui-base
build:
<<: *build-template_system
args:
- INSTALL_PACKAGE_NAMES=${RQT_PACKAGES}
image: rqt:latest
container_name: rqt
command: ["rqt"]
profiles: ["tools"]
rqt_reconfigure:
extends: rqt_base
container_name: rqt_reconfigure
profiles: ["tools"]
command: ["ros2", "run", "rqt_reconfigure", "rqt_reconfigure"]
rqt_graph:
extends: rqt_base
container_name: rqt_graph
command: ["ros2", "run", "rqt_graph", "rqt_graph"]
profiles: ["tools"]
#==============================================================================
# TRACING SERVICES
#==============================================================================
tracing:
<<: *package-base
image: tracing:latest
container_name: tracing
user: root
volumes:
- /var/run/lttng:/var/run/lttng:rw
- ./traces:/home/ubuntu/workspace/traces:rw
command:
[
"/bin/bash",
"-c",
"source /home/ubuntu/tracing/install/setup.bash && ROS_TRACE_DIR=${ROS_TRACE_DIR} ros2 trace && chown -R 1000:1000 /home/ubuntu/workspace/traces",
]
profiles: ["tools"]
analysis:
<<: *package-base
volumes:
- .:/home/ubuntu/workspace
image: tracing:latest
container_name: analysis
command: ["/bin/bash"]
profiles: ["tools"]
test_tracing:
<<: *package-base
image: test_tracing:latest
container_name: test_tracing
command:
[
"/bin/bash",
"-c",
"while true; do ros2 topic pub /test_topic std_msgs/String 'data: hello'; sleep 0.01; done",
]
profiles: ["tools"]