Skip to content

Commit

Permalink
Avoid using extends with depends_on in docker-compose (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeller authored Mar 14, 2024
1 parent e09f12c commit 0cfeaf0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
9 changes: 9 additions & 0 deletions data-driven-development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
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
Expand All @@ -28,6 +31,9 @@ services:
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}"
Expand All @@ -36,6 +42,9 @@ services:
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
Expand Down
9 changes: 9 additions & 0 deletions software-prototyping/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ services:
extends:
file: ../utils/components.yml
service: carla-ros-bridge
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- *launch-mount
- *sensors-mount
Expand All @@ -24,11 +27,17 @@ services:
extends:
file: ../utils/components.yml
service: ros-monitoring
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- *rviz-config-mount
command: bash -ic 'rviz2 -d /config.rviz --ros-args -p use_sim_time:=true &> /dev/null'

image-segmentation:
depends_on:
carla-simulator:
condition: service_healthy
image: rwthika/carlos-image-segmentation
command: ros2 launch image_segmentation image_segmentation_launch.py image_topic:=/carla/ego_vehicle/rgb_front/image

Expand Down
15 changes: 0 additions & 15 deletions utils/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,27 @@ services:
carla-client:
extends:
service: gpu-x11-service
depends_on:
carla-simulator:
condition: service_healthy
image: rwthika/carla-simulator:client
command: sleep infinity

carla-scenario-runner:
extends:
service: gpu-x11-service
depends_on:
carla-simulator:
condition: service_healthy
image: rwthika/carla-scenario-runner

carla-ros-bridge:
extends:
service: gpu-x11-service
depends_on:
carla-simulator:
condition: service_healthy
image: rwthika/carla-ros-bridge

ros-monitoring:
extends:
service: gpu-x11-service
depends_on:
carla-simulator:
condition: service_healthy
image: rwthika/ros2-cuda:humble-desktop-full

ros-monitoring-offscreen:
extends:
service: gpu-service
depends_on:
carla-simulator:
condition: service_healthy
image: rwthika/ros2-cuda:humble-desktop-full

gpu-service:
Expand Down
9 changes: 9 additions & 0 deletions utils/tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ services:
extends:
file: ../components.yml
service: carla-client
depends_on:
carla-simulator:
condition: service_healthy
command: sleep infinity

# starts the carla-ros-bridge
carla-ros-bridge:
extends:
file: ../components.yml
service: carla-ros-bridge
depends_on:
carla-simulator:
condition: service_healthy
# ...and then execute them. Note the -ic flag for an interactive bash!
# Without an interactive bash, many important env vars wouldn't be working or even set
command: bash -ic 'ros2 launch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch.py host:=carla-simulator'
Expand All @@ -51,6 +57,9 @@ services:
extends:
file: ../components.yml
service: ros-monitoring
depends_on:
carla-simulator:
condition: service_healthy
volumes:
# you can mount custom rviz configs...
- *rviz-config-mount
Expand Down
9 changes: 9 additions & 0 deletions utils/tutorial/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ services:
extends:
file: ../components.yml
service: carla-client
depends_on:
carla-simulator:
condition: service_healthy
command: sleep infinity

# starts the carla-ros-bridge
carla-ros-bridge:
extends:
file: ../components.yml
service: carla-ros-bridge
depends_on:
carla-simulator:
condition: service_healthy
# ...and then execute them. Note the -ic flag for an interactive bash!
# Without an interactive bash, many important env vars wouldn't be working or even set
command: bash -ic 'ros2 launch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch.py host:=carla-simulator'
Expand All @@ -32,6 +38,9 @@ services:
extends:
file: ../components.yml
service: ros-monitoring
depends_on:
carla-simulator:
condition: service_healthy
volumes:
# you can mount custom rviz configs...
- *rviz-config-mount
Expand Down

0 comments on commit 0cfeaf0

Please sign in to comment.