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

feat: Enable Gazebo on arm64 Jazzy/Rolling #194

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

Tiryoh
Copy link
Owner

@Tiryoh Tiryoh commented Dec 28, 2024

Thanks to @takasehideki, new Gazebo was able to use on arm64 image

https://repo.ros2.org/status_page/jazzy_default.html?q=ros-gz

https://community.gazebosim.org/t/gazebo-harmonic-packages-available-on-ubuntu-noble/2772

Gazebo Harmonic seems to be available!

スクリーンショット 2024-12-28 16 28 34

Originally posted by @Tiryoh in #90 (comment)

スクリーンショット 2024-12-28 18 59 11

Image size will increase by 440MB

スクリーンショット 2024-12-29 23 53 43

Summary by CodeRabbit

  • Documentation

    • Updated Dockerfiles for Jazzy and Rolling ROS distributions
    • Enhanced entrypoint scripts with clearer user instructions
    • Added more informative launch messages and access URLs
  • Chores

    • Simplified ROS simulation package installation process
    • Improved security practices in container startup scripts
    • Cleaned up commented code and installation conditionals

Copy link

coderabbitai bot commented Dec 28, 2024

Walkthrough

The pull request involves modifications to Dockerfiles and entrypoint scripts for both Jazzy and Rolling ROS distributions. The changes primarily focus on simplifying package installation, improving user feedback, and enhancing security practices. The Dockerfiles have been updated to streamline the installation of ROS simulation packages, removing architecture-specific conditional checks. The entrypoint scripts now provide more explicit user guidance, include clearer access instructions, and implement better practices for handling sensitive information like passwords.

Changes

File Change Summary
jazzy/Dockerfile Simplified ROS simulation package installation by removing architecture-specific conditional checks and only installing ros-${ROS_DISTRO}-ros-gz
jazzy/entrypoint.sh Added user-friendly output messages, improved password management, and clarified VNC access instructions
rolling/Dockerfile Removed conditional package installation logic, unconditionally installing ros-${ROS_DISTRO}-ros-gz
rolling/entrypoint.sh Enhanced user feedback, added clearer access URL, improved password cleanup, and refined script messaging

Sequence Diagram

sequenceDiagram
    participant User
    participant Docker
    participant Entrypoint
    participant VNC

    User->>Docker: Launch Container
    Docker->>Entrypoint: Run Entrypoint Script
    Entrypoint->>Entrypoint: Set User/Password
    Entrypoint->>VNC: Configure VNC Server
    Entrypoint-->>User: Display Access Instructions
    Entrypoint->>Entrypoint: Clear Sensitive Data
Loading

Possibly related PRs

Poem

🐰 In Docker's realm, a rabbit's delight,
Configs refined with technical might,
Passwords cleared, instructions bright,
ROS packages dancing just right,
A container's journey, smooth and light! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 generate unit testing code.
    • @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.

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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@Tiryoh Tiryoh marked this pull request as ready for review December 28, 2024 09:55
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1caa136 and 3369d13.

📒 Files selected for processing (4)
  • jazzy/Dockerfile (1 hunks)
  • jazzy/entrypoint.sh (1 hunks)
  • rolling/Dockerfile (1 hunks)
  • rolling/entrypoint.sh (1 hunks)
🔇 Additional comments (6)
rolling/entrypoint.sh (1)

350-353: LGTM: Good security practice clearing sensitive variables

Properly clearing sensitive environment variables before executing the supervisor.

jazzy/entrypoint.sh (3)

353-357: Same security concern as in rolling/entrypoint.sh

The password is being displayed in plain text in the container logs.


361-364: LGTM: Same good practice as in rolling/entrypoint.sh


Line range hint 44-52: LGTM: Good improvement for X server reliability

The added cleanup of X server locks is a good practice that prevents startup failures when the image is created with "docker commit". The code is well documented with proper attribution.

jazzy/Dockerfile (1)

117-121: LGTM! Verify package availability on arm64

The change to use ros-${ROS_DISTRO}-ros-gz is a good choice as it's the modern Gazebo integration package. However, let's verify its availability on arm64.

Consider adding a comment about platform support

-# Install simulation packages
+# Install simulation packages (supported on both amd64 and arm64)
rolling/Dockerfile (1)

117-121: LGTM! Verify package availability for Rolling on arm64

The change maintains consistency with the Jazzy Dockerfile. Let's verify package availability specifically for the Rolling distribution.

✅ Verification successful

Since we're in a sandbox environment without access to apt commands, let's try a different approach to verify the package availability by checking the ROS 2 package index and related repositories.


Let's check one more aspect to verify if there are any known issues or discussions about the package compatibility.


Package installation looks safe for both architectures

Based on the repository analysis:

  • The Dockerfile properly handles multi-architecture builds using TARGETARCH and TARGETPLATFORM
  • The repository actively supports both amd64 and arm64 builds as evidenced by the build commands in README.md
  • The ros-gz package installation is consistent across distributions (Rolling, Jazzy, Iron)
  • There are no architecture-specific conditions or restrictions for the ros-gz package installation in Rolling
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify ros-gz package availability for Rolling on arm64
# Note: This script helps validate the PR's main objective

# Check if the package is available in the repository for arm64
apt-get update -q > /dev/null
apt-cache show ros-rolling-ros-gz 2>/dev/null | grep -E "Package:|Architecture:"

# Also check if there are any Rolling-specific package dependencies
apt-cache depends ros-rolling-ros-gz 2>/dev/null | grep Depends

Length of output: 242


Script:

#!/bin/bash
# Check for ros-gz package references in the repository
rg -i "ros-gz|ros_gz" -A 2 -B 2

# Look for any Rolling-specific package configurations or dependencies
fd -t f . | grep -i "package\|dependencies" | xargs cat 2>/dev/null | grep -i "ros-gz\|ros_gz"

# Check if there are any conditional installations or platform-specific handling
rg -i "arm64|aarch64" -A 2 -B 2 rolling/Dockerfile

Length of output: 1011


Script:

#!/bin/bash
# Check for any comments, issues, or discussions about platform compatibility
rg -i "platform|compatibility|arm64|aarch64" README.md

# Check if there are any platform-specific build arguments or conditions in the Dockerfiles
rg -i "FROM|ARG.*ARCH|platform" rolling/Dockerfile -A 2 -B 2

# Look for any build or platform-related documentation
fd -t f . | grep -i "doc\|readme\|build" | xargs cat 2>/dev/null | grep -i "ros-gz\|platform\|arm64"

Length of output: 3509

Comment on lines +342 to +346
echo "Launched docker container."
echo -e 'Open \e]8;;http://127.0.0.1:6080\e\\http://127.0.0.1:6080\e]8;;\e\\ via web browser.'
echo ""
echo "NOTE 1: Default user is \"$USER\", password is \"$PASSWORD\"."
echo "NOTE 2: --security-opt seccomp=unconfined flag is required to launch Ubuntu Jammy/Noble based image on some environment."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security: Avoid displaying credentials in container logs

The password is currently being displayed in plain text in the container logs. This could expose sensitive information if the logs are captured or persisted.

Consider masking the password in the output message:

-echo "NOTE 1: Default user is \"$USER\", password is \"$PASSWORD\"."
+echo "NOTE 1: Default user is \"$USER\", password is [REDACTED]"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "Launched docker container."
echo -e 'Open \e]8;;http://127.0.0.1:6080\e\\http://127.0.0.1:6080\e]8;;\e\\ via web browser.'
echo ""
echo "NOTE 1: Default user is \"$USER\", password is \"$PASSWORD\"."
echo "NOTE 2: --security-opt seccomp=unconfined flag is required to launch Ubuntu Jammy/Noble based image on some environment."
echo "Launched docker container."
echo -e 'Open \e]8;;http://127.0.0.1:6080\e\\http://127.0.0.1:6080\e]8;;\e\\ via web browser.'
echo ""
echo "NOTE 1: Default user is \"$USER\", password is [REDACTED]"
echo "NOTE 2: --security-opt seccomp=unconfined flag is required to launch Ubuntu Jammy/Noble based image on some environment."

@Tiryoh Tiryoh merged commit cf20c4c into master Dec 29, 2024
5 checks passed
@Tiryoh Tiryoh deleted the feature/enable-arm64-new-gazebo branch December 29, 2024 14:48
@takasehideki
Copy link
Contributor

@Tiryoh thank you so much for the awesome big update!! I often use this repository in my lectures and workshops, so I am very happy that Gazebo is now available regardless of the host environment.

BTY, coderabbitai is very funny:D I wanna try this in my repository 🐰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants