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: Add ROS 2 Jazzy Jalisco #168

Merged
merged 2 commits into from
Jun 4, 2024
Merged

feat: Add ROS 2 Jazzy Jalisco #168

merged 2 commits into from
Jun 4, 2024

Conversation

Tiryoh
Copy link
Owner

@Tiryoh Tiryoh commented Jun 4, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a Docker setup for a ROS2 desktop environment with VNC access, including tools like Ubuntu Mate, noVNC, Websockify, Firefox, VSCodium, and ROS Jazzy.
    • Added scripts to automate user creation, VNC configuration, ROS environment setup, and desktop shortcuts.
  • Chores

    • Added CI workflows for deployment and testing using Jazzy, triggered by specific branch pushes, scheduled events, and manual dispatch.

Copy link

coderabbitai bot commented Jun 4, 2024

Walkthrough

The recent updates introduce new workflows and configurations for the Jazzy project. The changes include setting up GitHub Actions workflows for deploying and testing Jazzy, creating a Dockerfile for a ROS2 desktop environment with VNC access, and an entrypoint script to automate various setup tasks. These modifications aim to streamline the development, testing, and deployment processes for the Jazzy project.

Changes

Files/Paths Change Summaries
.github/workflows/deploy-jazzy.yml Added a workflow to publish to a registry using Jazzy, triggered on specific branches, paths, scheduled events, and manual dispatch.
.github/workflows/test-jazzy.yml Introduced a workflow for building and testing Jazzy on specific triggers like pull requests, scheduled weekly runs, and manual dispatch.
jazzy/Dockerfile Created a Dockerfile for setting up a ROS2 desktop environment with VNC access, including essential tools and packages.
jazzy/entrypoint.sh Added a script to automate user creation, VNC setup, ROS environment configuration, and desktop shortcut creation.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Docker
    participant ROS Environment

    Developer->>GitHub Actions: Push code
    GitHub Actions-->>GitHub Actions: Trigger deploy-jazzy.yml workflow
    GitHub Actions-->>GitHub Actions: Trigger test-jazzy.yml workflow
    GitHub Actions->>Docker: Build Docker image using Dockerfile
    Docker->>ROS Environment: Set up ROS Jazzy with VNC access
    Docker->>Developer: Provide VNC access and tools
Loading

Poem

In the code's embrace, workflows align,
Jazzy's setup, a dance so fine.
Docker builds a world anew,
With VNC and tools, for me and you.
Scripts that hum, like a gentle breeze,
Bringing ease, to developers' seas.
🌟🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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 changed the title feat: Add ROS 2 Jazzy feat: Add ROS 2 Jazzy Jalisco Jun 4, 2024
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: 6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c3e5d18 and 3da6e2a.

Files selected for processing (4)
  • .github/workflows/deploy-jazzy.yml (1 hunks)
  • .github/workflows/test-jazzy.yml (1 hunks)
  • jazzy/Dockerfile (1 hunks)
  • jazzy/entrypoint.sh (1 hunks)
Files not reviewed due to errors (1)
  • jazzy/entrypoint.sh (no review received)
Files skipped from review due to trivial changes (2)
  • .github/workflows/deploy-jazzy.yml
  • .github/workflows/test-jazzy.yml
Additional context used
Hadolint
jazzy/Dockerfile

[warning] 43-43: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[info] 43-43: Avoid additional packages by specifying --no-install-recommends


[warning] 51-51: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[info] 51-51: Avoid additional packages by specifying --no-install-recommends


[info] 63-63: Multiple consecutive RUN instructions. Consider consolidation.


[info] 64-64: Multiple consecutive RUN instructions. Consider consolidation.


[info] 67-67: Multiple consecutive RUN instructions. Consider consolidation.


[info] 70-70: Multiple consecutive RUN instructions. Consider consolidation.


[info] 71-71: Multiple consecutive RUN instructions. Consider consolidation.


[info] 74-74: Avoid additional packages by specifying --no-install-recommends


[warning] 74-74: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check


[warning] 74-74: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[warning] 88-88: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check


[warning] 88-88: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[info] 88-88: Avoid additional packages by specifying --no-install-recommends


[info] 88-88: Avoid use of wget without progress bar. Use wget --progress=dot:giga <url>. Or consider using -q or -nv (shorthands for --quiet or --no-verbose).


[warning] 103-103: Either use Wget or Curl but not both


[info] 103-103: Avoid additional packages by specifying --no-install-recommends


[warning] 103-103: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[warning] 103-103: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check


[info] 129-129: Multiple consecutive RUN instructions. Consider consolidation.

Shellcheck
jazzy/entrypoint.sh

[info] 347-347: Want to escape a single quote? echo 'This is how it'''s done'.


[info] 349-349: Want to escape a single quote? echo 'This is how it'''s done'.

Comment on lines +74 to +85
RUN wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg \
-O /etc/apt/keyrings/packages.mozilla.org.asc && \
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" \
| tee -a /etc/apt/sources.list.d/mozilla-apt.list && \
echo 'Package: *Pin: origin packages.mozilla.orgPin-Priority: 900' \
| tee /etc/apt/preferences.d/mozilla-apt && \
apt-get update -q && \
apt-get install -y \
firefox && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Ensure the use of pipefail when using pipes in RUN commands to handle potential errors properly.

+ SHELL ["/bin/bash", "-o", "pipefail"]
- wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O /etc/apt/keyrings/packages.mozilla.org.asc
+ wget --progress=dot:giga https://packages.mozilla.org/apt/repo-signing-key.gpg -O /etc/apt/keyrings/packages.mozilla.org.asc

Also, pin the Firefox version to ensure reproducibility and consider using --no-install-recommends.

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[info] 74-74: Avoid additional packages by specifying --no-install-recommends


[warning] 74-74: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check


[warning] 74-74: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>

Comment on lines +43 to +48
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ubuntu-mate-desktop && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Pin package versions to ensure reproducibility and avoid potential future compatibility issues.

- apt-get install -y ubuntu-mate-desktop
+ apt-get install -y ubuntu-mate-desktop=<specific_version>

Also, consider using --no-install-recommends to minimize the installation of unnecessary packages.

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[warning] 43-43: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[info] 43-43: Avoid additional packages by specifying --no-install-recommends

Comment on lines +51 to +59
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
tigervnc-standalone-server tigervnc-common \
supervisor wget curl gosu git sudo python3-full python3-pip tini \
build-essential vim sudo lsb-release locales \
bash-completion tzdata terminator && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Pin package versions to ensure reproducibility.

- apt-get install -y tigervnc-standalone-server tigervnc-common supervisor wget curl gosu git sudo python3-full python3-pip tini build-essential vim sudo lsb-release locales bash-completion tzdata terminator
+ apt-get install -y tigervnc-standalone-server=<version> tigervnc-common=<version> supervisor=<version> wget=<version> curl=<version> gosu=<version> git=<version> sudo=<version> python3-full=<version> python3-pip=<version> tini=<version> build-essential=<version> vim=<version> sudo=<version> lsb-release=<version> locales=<version> bash-completion=<version> tzdata=<version> terminator=<version>

Also, consider using --no-install-recommends to minimize the installation of unnecessary packages.

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[warning] 51-51: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[info] 51-51: Avoid additional packages by specifying --no-install-recommends

Comment on lines +88 to +96
RUN wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
-O /usr/share/keyrings/vscodium-archive-keyring.asc && \
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| tee /etc/apt/sources.list.d/vscodium.list && \
apt-get update -q && \
apt-get install -y codium && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Ensure the use of pipefail when using pipes in RUN commands to handle potential errors properly.

+ SHELL ["/bin/bash", "-o", "pipefail"]
- wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc
+ wget --progress=dot:giga https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc

Also, pin the VSCodium version to ensure reproducibility and consider using --no-install-recommends.

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[warning] 88-88: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check


[warning] 88-88: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[info] 88-88: Avoid additional packages by specifying --no-install-recommends


[info] 88-88: Avoid use of wget without progress bar. Use wget --progress=dot:giga <url>. Or consider using -q or -nv (shorthands for --quiet or --no-verbose).

Comment on lines +103 to +113
RUN apt-get update -q && \
apt-get install -y curl gnupg2 lsb-release && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get update -q && \
apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
python3-argcomplete \
python3-colcon-common-extensions \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Consolidate RUN commands and ensure the use of pipefail when using pipes to handle potential errors properly.

+ SHELL ["/bin/bash", "-o", "pipefail"]
- RUN apt-get update -q && \
-     apt-get install -y curl gnupg2 lsb-release && \
-     curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
-     echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
-     apt-get update -q && \
-     apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
-     python3-argcomplete \
-     python3-colcon-common-extensions \
-     python3-rosdep python3-vcstool && \
-     rosdep init && \
-     rm -rf /var/lib/apt/lists/*
+ RUN apt-get update -q && \
+     apt-get install -y curl gnupg2 lsb-release && \
+     curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
+     echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
+     apt-get update -q && \
+     apt-get install -y ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
+     python3-argcomplete \
+     python3-colcon-common-extensions \
+     python3-rosdep python3-vcstool && \
+     rosdep init && \
+     rm -rf /var/lib/apt/lists/*

Also, pin the versions of the installed packages to ensure reproducibility and consider using --no-install-recommends.

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[warning] 103-103: Either use Wget or Curl but not both


[info] 103-103: Avoid additional packages by specifying --no-install-recommends


[warning] 103-103: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>


[warning] 103-103: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

Comment on lines +63 to +71
RUN pip install --no-cache-dir --break-system-packages git+https://github.com/novnc/websockify.git@v0.10.0
RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html

# Set remote resize function enabled by default
RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js

# Disable auto update and crash report
RUN sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades
RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
Copy link

Choose a reason for hiding this comment

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

Consolidate multiple RUN instructions to reduce the number of layers in the Docker image.

- RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
- RUN pip install --no-cache-dir --break-system-packages git+https://github.com/novnc/websockify.git@v0.10.0
- RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
- RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js
- RUN sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades
- RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
+ RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc && \
+    pip install --no-cache-dir --break-system-packages git+https://github.com/novnc/websockify.git@v0.10.0 && \
+    ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html && \
+    sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js && \
+    sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades && \
+    sed -i 's/enabled=1/enabled=0/g' /etc/default/apport

Committable suggestion was skipped due to low confidence.

Tools
Hadolint

[info] 63-63: Multiple consecutive RUN instructions. Consider consolidation.


[info] 64-64: Multiple consecutive RUN instructions. Consider consolidation.


[info] 67-67: Multiple consecutive RUN instructions. Consider consolidation.


[info] 70-70: Multiple consecutive RUN instructions. Consider consolidation.


[info] 71-71: Multiple consecutive RUN instructions. Consider consolidation.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@Tiryoh Tiryoh merged commit bc1801e into master Jun 4, 2024
3 checks passed
@Tiryoh Tiryoh deleted the feature/ros2-jazzy branch June 4, 2024 14:21
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.

None yet

1 participant