Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template docker-compose.yaml for merging #3

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 8 additions & 91 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,106 +1,23 @@
# Docker Compose file for user overlays of the MoveIt Pro images.
# Docker Compose file that will be merged with /opt/moveit_pro/docker-compose.yaml.
# For more details on how merging works, see https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/#merging-rules.

# Services that are listed under `/opt/moveit_pro/docker-compose.yaml` are mirrored here for merging.
# Feel free to remove services here that are unmodified.
services:
# Sets common properties for other services. Should not be instantiated directly.
# The base image that all MoveIt Pro services extend off of. Builds the user workspace.
base:
# Extend the installed MoveIt Pro docker compose file.
# Change this to match your environment, if MoveIt Pro was installed to a different location.
extends:
file: /opt/moveit_pro/docker-compose.yaml
service: base
image: moveit-pro-overlay
build:
context: .
target: user-overlay
# List any arguments for building the user workspace here.
args:
- USER_UID=${STUDIO_USER_UID:-1000}
- USER_GID=${STUDIO_USER_GID:-1000}
- USERNAME=${STUDIO_USERNAME:-studio-user}
- MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main}

# Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI
# Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI.
agent_bridge:
extends: base
privileged: true
# This service relies on cgroup_rules defined in base which allow the user to use the host's network video4linux and usb_device devices.
depends_on:
rest_api:
condition: service_healthy
volumes:
# Allow the user to run graphical programs from within the docker container.
- /tmp/.X11-unix:/tmp/.X11-unix:ro
# Allow access to host hardware e.g. RealSense cameras
- /dev:/dev
deploy:
restart_policy:
condition: any
delay: 2s
command: agent_bridge.app

# Starts the REST API for the Web UI.
rest_api:
extends: base
healthcheck:
test: "curl -f http://localhost:3200/objectives"
interval: 5s
timeout: 1m
command: rest_api.app

# Starts the robot drivers.
drivers:
extends: base
privileged: true
# Ensures the drivers container has RT priority
ulimits:
rtprio: 99
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0" # Allow access to the gripper.
command: robot.app

# Starts the web UI frontend.
web_ui:
image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main}
ports:
- "80:80"
network_mode: host

# Starts RViz for visualization.
rviz:
extends: base
profiles:
- rviz
command: bash -c "ros2 launch moveit_studio_agent developer_rviz.launch.py"

# Starts MoveIt Setup Assistant for creating MoveIt configurations.
setup_assistant:
extends: base
profiles:
- setup_assistant
command: bash -c "ros2 launch moveit_setup_assistant setup_assistant.launch.py"

# Developer specific configuration
# Developer specific configuration when running `moveit_pro dev`.
dev:
extends: base
build:
target: user-overlay-dev
image: moveit-studio-overlay-dev
stdin_open: true
tty: true
privileged: true
volumes:
# Mount the source code, colcon generated artifacts, and ccache
- ./src/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/src:rw
- ./build/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/build:rw
- ./install/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/install:rw
- ./log/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/log:rw
- ./.ccache/:/home/${STUDIO_USERNAME:-studio-user}/.ccache:rw
- ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log
# Allow access to host hardware e.g. RealSense cameras
- /dev:/dev
command: sleep infinity
# Making a separate profile prevents this service from being built when using `docker compose build`
# and launched when using `docker compose up`.
profiles: ["dev"]

volumes:
ignition_resources:
Loading