Skip to content

Upgrade from Iron to Jazzy #15

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

Merged
merged 18 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
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
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
# Uncomment/populate the following so that codespell ignores the specified words
# skip = *.json
# ignore-words-list = example,words,to,ignore
19 changes: 14 additions & 5 deletions .devcontainer/nouveau/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
FROM ghcr.io/robotic-decision-making-lab/ros2-template:iron-desktop
FROM ghcr.io/robotic-decision-making-lab/ros2-template:jazzy-desktop

# Install ROS dependencies
# This is done in a previous stage, but we include it again here in case anyone wants to
# add new dependencies during development
ENV USERNAME=ros
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
WORKDIR $USER_WORKSPACE

COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME

RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths . --ignore-src -r --rosdistro ${ROS_DISTRO} \
&& rosdep install -y --from-paths . --ignore-src -r --as-root=pip:false --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install debugging/linting Python packages
COPY --chown=$USER_UID:$USER_GID requirements-dev.txt .
RUN python3 -m pip install -r requirements-dev.txt \
RUN pip install -r requirements-dev.txt \
&& rm -rf requirements-dev.txt

# Install debugging/linting C++ packages
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& sudo apt-get install -y \
clang-format-18 \
clang-tidy \
clang-tools \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Disable the setuputils installation warning
# This prevents us from needing to pin the setuputils version (which doesn't always work)
ENV PYTHONWARNINGS="ignore"
6 changes: 3 additions & 3 deletions .devcontainer/nouveau/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "ROS 2 Dev Container",
"dockerFile": "Dockerfile",
"context": "../..",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ros/ws_ros/src/ros2-template,type=bind",
"workspaceFolder": "/home/ros/ws_ros/src/ros2-template",
"remoteUser": "ros",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/ros2-template,type=bind",
"workspaceFolder": "/home/ubuntu/ws_ros/src/ros2-template",
"remoteUser": "ubuntu",
"runArgs": [
"--network=host",
"--cap-add=SYS_PTRACE",
Expand Down
19 changes: 14 additions & 5 deletions .devcontainer/nvidia/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
FROM ghcr.io/robotic-decision-making-lab/ros2-template:iron-desktop-nvidia
FROM ghcr.io/robotic-decision-making-lab/ros2-template:jazzy-desktop-nvidia

# Install ROS dependencies
# This is done in a previous stage, but we include it again here in case anyone wants to
# add new dependencies during development
ENV USERNAME=ros
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
WORKDIR $USER_WORKSPACE

COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME

RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths . --ignore-src -r --rosdistro ${ROS_DISTRO} \
&& rosdep install -y --from-paths . --ignore-src -r --as-root=pip:false --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install debugging/linting Python packages
COPY --chown=$USER_UID:$USER_GID requirements-dev.txt .
RUN python3 -m pip install -r requirements-dev.txt \
RUN pip install -r requirements-dev.txt \
&& rm -rf requirements-dev.txt

# Install debugging/linting C++ packages
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& sudo apt-get install -y \
clang-format-18 \
clang-tidy \
clang-tools \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Disable the setuputils installation warning
# This prevents us from needing to pin the setuputils version (which doesn't always work)
ENV PYTHONWARNINGS="ignore"
6 changes: 3 additions & 3 deletions .devcontainer/nvidia/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "ROS 2 NVIDIA Dev Container",
"dockerFile": "Dockerfile",
"context": "../..",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ros/ws_ros/src/ros2-template,type=bind",
"workspaceFolder": "/home/ros/ws_ros/src/ros2-template",
"remoteUser": "ros",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/ros2-template,type=bind",
"workspaceFolder": "/home/ubuntu/ws_ros/src/ros2-template",
"remoteUser": "ubuntu",
"runArgs": [
"--network=host",
"--cap-add=SYS_PTRACE",
Expand Down
53 changes: 19 additions & 34 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG ROS_DISTRO=iron
ARG ROS_DISTRO=jazzy
FROM ros:$ROS_DISTRO-ros-base as ci

ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -16,11 +16,9 @@ RUN apt-get -q update \
git \
sudo \
clang \
clang-format-14 \
clang-tidy \
clang-tools \
python3-pip \
python3-dev \
python3-venv \
apt-utils \
software-properties-common \
&& apt-get autoremove -y \
Expand All @@ -39,28 +37,33 @@ RUN apt-get -q update \

FROM ci as robot

# Configure a new non-root user
ARG USERNAME=ros
ENV DEBIAN_FRONTEND=noninteractive

# Configure the ubuntu non-root user
ARG USERNAME=ubuntu
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& usermod -a -G dialout $USERNAME \
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
&& usermod -a -G dialout $USERNAME

# Switch to the non-root user
# Switch to the ubuntu non-root user
USER $USERNAME
ENV USER=$USERNAME

ENV DEBIAN_FRONTEND=noninteractive
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
WORKDIR $USER_WORKSPACE

COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME

# Create a new virtual environment for Python
ENV VIRTUAL_ENV=$USER_WORKSPACE/.venv/$PROJECT_NAME
RUN python3 -m venv --system-site-packages $VIRTUAL_ENV \
&& echo "source ${VIRTUAL_ENV}/bin/activate" >> /home/$USERNAME/.bashrc \
&& touch .venv/COLCON_IGNORE
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Uncomment to download and install external repos used by the project
# RUN vcs import src < src/$PROJECT_NAME/ros2.repos

Expand All @@ -69,7 +72,7 @@ WORKDIR $USER_WORKSPACE
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src -r --rosdistro ${ROS_DISTRO} \
&& rosdep install -y --from-paths src --ignore-src --as-root=pip:false --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*
Expand All @@ -85,29 +88,11 @@ ENV DEBIAN_FRONTEND=noninteractive
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
WORKDIR $USER_WORKSPACE

# Install tools needed for Gazebo installation
# Install Gazebo
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& sudo apt-get install -y \
lsb-release \
wget \
gnupg \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Set to the desired version of Gazebo
# Refer to the official documentation for the recommended pairings:
# https://gazebosim.org/docs/harmonic/ros_installation
ENV GAZEBO_VERSION=harmonic

RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \
&& sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& sudo apt-get install -y \
gz-$GAZEBO_VERSION \
ros-$ROS_DISTRO-ros-gz$GAZEBO_VERSION \
ros-$ROS_DISTRO-ros-gz \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
fail-fast: false
matrix:
env:
- IMAGE: iron-ci
ROS_DISTRO: iron
- IMAGE: jazzy-ci
ROS_DISTRO: jazzy
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [iron]
ROS_DISTRO: [jazzy]
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [iron]
ROS_DISTRO: [jazzy]
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [iron]
ROS_DISTRO: [jazzy]
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ROS_DISTRO: [iron]
ROS_DISTRO: [jazzy]
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install clang-format-14
run: sudo apt-get install clang-format-14
- name: Install clang-format-18
run: sudo apt-get install clang-format-18

- name: Run pre-commit
uses: pre-commit/action@v3.0.1
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
build
install
log

# virtualenv
.venv
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-14
entry: clang-format-18
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=Google', '-i']
Expand Down
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
target-version = "py310"
target-version = "py312"
2 changes: 1 addition & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/opt/ros/iron/include/**",
"/opt/ros/jazzy/include/**",
"/usr/include/gz/**"
],
"defines": [],
Expand Down
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
"autoDocstring.startOnNewLine": false,
"autoDocstring.docstringFormat": "google-notypes",
"python.autoComplete.extraPaths": [
"/opt/ros/iron/lib/python3.10/site-packages/",
"/opt/ros/iron/local/lib/python3.10/dist-packages/",
"/opt/ros/jazzy/lib/python3.12/site-packages/",
"/opt/ros/jazzy/local/lib/python3.12/dist-packages/",
"${workspaceFolder}/install/"
],
"python.analysis.extraPaths": [
"/opt/ros/iron/lib/python3.10/site-packages/",
"/opt/ros/iron/local/lib/python3.10/dist-packages/",
"/opt/ros/jazzy/lib/python3.12/site-packages/",
"/opt/ros/jazzy/local/lib/python3.12/dist-packages/",
"${workspaceFolder}/install/"
],
"C_Cpp.default.intelliSenseMode": "linux-gcc-x86",
"C_Cpp.clang_format_fallbackStyle": "Google",
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": true,
"clang-format.executable": "/usr/bin/clang-format-14",
"clang-format.executable": "/usr/bin/clang-format-19",
"[cpp]": {
"editor.rulers": [120],
"editor.tabSize": 2,
Expand Down
2 changes: 1 addition & 1 deletion example_pkg/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<description>A sample ROS 2 package</description>

<maintainer email="evanp922@gmail.com">Evan Palmer</maintainer>
<license>BSD 3-Clause</license>
<license>MIT</license>

<url type="repository">https://github.com/Robotic-Decision-Making-Lab/ros2-template.git</url>
<url type="bugtracker">https://github.com/Robotic-Decision-Making-Lab/ros2-template/issues</url>
Expand Down
Loading