feat: updated docker setup for manipulation demo
Purpose
This PR introduces updates to the Docker setup and implements changes necessary to run the manipulation demo within a containerized environment.
Proposed Changes
- Updates to selected RAI components to ensure proper operation inside of a container.
- Updates to the Dockerfile.
- Updates to the documentation, specifically
docs/demos/manipulation.mdanddocs/setup/setup_docker.md.
Issues
Testing
- Modify the docker file to use the branch from this PR instead of the
mainbranch. Specifically, add these lines to the dockerfile after theRUN git clone https://github.com/RobotecAI/rai.git .command:
RUN git pull
RUN git switch dm/feat/docker-image-manipulator-demo
- Setup the manipulation arm demo as described in the [updated documentation](https://github.com/RobotecAI/rai/blob/dm/feat/docker-image-manipulator-demo/docs/demos/manipulation.md
- Run the demo
Summary by CodeRabbit
-
New Features
- Added a configurable Docker build process with a new argument to select dependency groups and improved environment setup for ROS 2 and Fast DDS.
- Introduced a Fast DDS XML configuration file for custom transport settings.
- Enhanced vision agent logic to better manage weight file paths and prevent redundant assignments.
-
Bug Fixes
- Added explicit device selection for model initialization in vision markup, ensuring correct use of CUDA or CPU.
- Implemented a timeout for long-running vision service calls to prevent indefinite waiting.
-
Documentation
- Expanded and reorganized Docker setup guides, including detailed instructions for manipulation demos and ROS 2 communication between host and container.
- Clarified build and run steps for different ROS 2 versions and dependency groups.
-
Chores
- Added a comprehensive
.dockerignorefile to optimize Docker image builds by excluding unnecessary files and directories.
- Added a comprehensive
@Cytrus14 Thank you for responding to my comments! Could you take a look at this one: https://github.com/RobotecAI/rai/pull/641/files#r2168690801?
@coderabbitai full review
✅ Actions performed
Full review triggered.
Walkthrough
A new .dockerignore file was added to optimize Docker build contexts. The Dockerfile was updated to support dependency group selection, environment variables, and improved installation steps. Fast DDS configuration was introduced via XML. Documentation was expanded for Docker and manipulation demo setup. Minor logic improvements were made to vision agent and segmentation tools.
Changes
| File(s) | Change Summary |
|---|---|
| .dockerignore | Added a comprehensive ignore file to exclude unnecessary files and directories from Docker build context, including Python artifacts, IDE configs, ROS/Celery/Jupyter outputs, and project-specific files. |
| docker/Dockerfile | Added build arg DEPENDENCIES (default: core_only), validation for allowed values, simplified apt install, added zip package, updated Poetry to 2.1.3, copied context instead of cloning, set Fast DDS/RMW env vars, and made Poetry install conditional on dependency group. |
| docker/fastrtps_config.xml | Introduced Fast DDS XML config defining a custom UDP transport and default participant profile for ROS 2 communication. |
| docs/demos/manipulation.md | Expanded with a new Docker Setup section, providing step-by-step instructions for running the manipulation demo in Docker, including prerequisites, build, run, and execution steps. Reorganized local setup instructions. |
| docs/setup/setup_docker.md | Expanded and reorganized Docker setup documentation: clarified image build options, added repository cloning step, detailed host-container ROS 2 communication setup, updated Docker run commands, and refined test instructions. |
| src/rai_extensions/rai_open_set_vision/rai_open_set_vision/agents/base_vision_agent.py | Added _is_weights_path_set boolean instance variable; modified weight path initialization logic to prevent repeated reassignment of _weights_path and ensure correct path handling during weight downloads. |
| src/rai_extensions/rai_open_set_vision/rai_open_set_vision/tools/segmentation_tools.py | Added a 60-second timeout to get_future_result calls in GetGrabbingPointTool._run for GroundingDino and Grounded SAM service responses; added explanatory comment. |
| src/rai_extensions/rai_open_set_vision/rai_open_set_vision/vision_markup/boxer.py | Imported torch and modified GDBoxer constructor to explicitly set model device to "cuda" if available, otherwise "cpu", when use_cuda is true. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant Docker
participant Poetry
participant ROS2
participant FastDDS
User->>Docker: Build image (with DEPENDENCIES arg)
Docker->>Docker: Validate DEPENDENCIES (core_only/all_groups)
Docker->>Docker: Install system packages (incl. zip)
Docker->>Docker: Install Poetry 2.1.3
Docker->>Docker: Copy project context
Docker->>Docker: Set FastDDS and RMW env vars
Docker->>Poetry: Install dependencies (core_only or all_groups)
Docker->>ROS2: Install ROS dependencies, build workspace
Docker->>FastDDS: Use fastrtps_config.xml for communication
sequenceDiagram
participant User
participant Host
participant DockerContainer
participant ROS2
participant FastDDS
User->>Host: Clone repo, build Docker image
User->>Host: Source ROS2, set ROS_DOMAIN_ID
User->>Host: Configure FastDDS (fastrtps_config.xml)
User->>DockerContainer: Run container with env vars and network settings
DockerContainer->>ROS2: Use FastDDS for communication
DockerContainer->>Host: Communicate via shared DDS domain
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 65.34%. Comparing base (074af8e) to head (1f09e8e).
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## main #641 +/- ##
=======================================
Coverage 65.34% 65.34%
=======================================
Files 78 78
Lines 3388 3388
=======================================
Hits 2214 2214
Misses 1174 1174
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@juliajia did you try to run manipulation demo via docker in PR https://github.com/RobotecAI/rai/pull/641 because I m trying to merge all docker PRs, but i have error when following the docs
[ERROR] [launch]: Caught exception in launch (see debug for traceback): "package 'rai_bringup' not found, searching: ['/opt/ros/jazzy']"
on command ros2 launch examples/manipulation-demo.launch.py
@jmatejcz looks like source setup shell sh is missing, or there's no colcon build before