-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
95 lines (84 loc) · 3.33 KB
/
docker-compose.yml
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
x-scenario-mount: &scenario-mount ./${scenario_folder}:/scenarios
x-sensors-mount: &sensors-mount ./${sensors_config}:/sensors.json
# ==============================================================================
services:
# --- core services ----------------------------------------------------------
carla-simulator:
extends:
file: ../utils/components.yml
service: carla-simulator-offscreen
carla-ros-bridge:
extends:
file: ../utils/components.yml
service: carla-ros-bridge
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- *sensors-mount
- ./launch/demo.launch.py:/demo.launch.py
command: bash -ic "ros2 launch /demo.launch.py town:=${town}"
# ----------------------------------------------------------------------------
# --- checking services ------------------------------------------------------
time-health-check:
extends:
file: ../utils/components.yml
service: carla-client
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- ./src/time_controller.py:/opt/carla/PythonAPI/time_controller.py
command: bash -ic "python time_controller.py --host carla-simulator ${max_simulation_time} ${max_real_time}"
spawned-vehicle-check:
extends:
file: ../utils/components.yml
service: carla-client
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- ./src/spawned_vehicle_check.py:/opt/carla/PythonAPI/spawned_vehicle_check.py
command: sleep infinity
healthcheck:
test: ["CMD-SHELL", "bash -ic \"python spawned_vehicle_check.py --host carla-simulator --role_name_list ${role_names}\""]
interval: 1s
start_period: 10s
retries: 3
# ----------------------------------------------------------------------------
# --- Option A: apply random permutation setups ------------------------------
carla-simulation-controller:
extends:
file: ../utils/components.yml
service: carla-client
depends_on:
spawned-vehicle-check:
condition: service_healthy
volumes:
- ./src/simulation_controller.py:/opt/carla/PythonAPI/simulation_controller.py
- ./src/set_environment.py:/opt/carla/PythonAPI/set_environment.py
- *sensors-mount
command: bash -ic "python simulation_controller.py --host carla-simulator ${key_config_string}"
# --- Option B: apply concrete scenario setups -------------------------------
carla-scenario-runner:
extends:
file: ../utils/components.yml
service: carla-scenario-runner
depends_on:
spawned-vehicle-check:
condition: service_healthy
volumes:
- *scenario-mount
command: bash -ic "python ./scenario_runner.py --host carla-simulator --openscenario /scenarios/${scenario} --waitForEgo --output"
# ----------------------------------------------------------------------------
# --- recording services -----------------------------------------------------
rosbag-record:
extends:
file: ../utils/components.yml
service: ros-monitoring-offscreen
depends_on:
spawned-vehicle-check:
condition: service_healthy
volumes:
- ${output_path}:/docker-ros/ws/data
command: bash -ic "ros2 bag record -o /docker-ros/ws/data/bags/${run_name}_$(date +%Y-%m-%d-%H-%M) ${record_topics_arg}"