Skip to content

Commit 576543a

Browse files
authored
Upgrade from Iron to Jazzy (#15)
* Added Jazzy and virtualenv configurations * Testing groups * Fixed gid and pip * Fixed venv install * Another attempt * Using ros binary install for gazebo * Testing ubuntu user * Adding ubuntu to sudoers list * Fixed cpp compiler install * Added venv to path * Fix python version in ruff config * Switched back to main for pipelines * Addressed PR comments * Attempt at fixing format workflow * Update to use 24.04 runner * Addressed comment about codespell config * removed unneccessary flag * Removed apt update
1 parent 4655183 commit 576543a

File tree

16 files changed

+81
-74
lines changed

16 files changed

+81
-74
lines changed

.codespellrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
# Uncomment and populate the following so that codespell ignores the specified words/files
3+
# skip =
4+
# ignore-words-list =

.devcontainer/nouveau/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
FROM ghcr.io/robotic-decision-making-lab/ros2-template:iron-desktop
1+
FROM ghcr.io/robotic-decision-making-lab/ros2-template:jazzy-desktop
22

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

108
COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME
@@ -18,9 +16,20 @@ RUN sudo apt-get -q update \
1816
&& sudo rm -rf /var/lib/apt/lists/*
1917

2018
# Install debugging/linting Python packages
21-
COPY --chown=$USER_UID:$USER_GID requirements-dev.txt .
22-
RUN python3 -m pip install -r requirements-dev.txt \
23-
&& rm -rf requirements-dev.txt
19+
RUN pip install \
20+
pre-commit \
21+
mypy
22+
23+
# Install debugging/linting C++ packages
24+
RUN sudo apt-get -q update \
25+
&& sudo apt-get -q -y upgrade \
26+
&& sudo apt-get install -y \
27+
clang-format-18 \
28+
clang-tidy \
29+
clang-tools \
30+
&& sudo apt-get autoremove -y \
31+
&& sudo apt-get clean -y \
32+
&& sudo rm -rf /var/lib/apt/lists/*
2433

2534
# Disable the setuputils installation warning
2635
# This prevents us from needing to pin the setuputils version (which doesn't always work)

.devcontainer/nouveau/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "ROS 2 Dev Container",
33
"dockerFile": "Dockerfile",
44
"context": "../..",
5-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ros/ws_ros/src/ros2-template,type=bind",
6-
"workspaceFolder": "/home/ros/ws_ros/src/ros2-template",
7-
"remoteUser": "ros",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/ros2-template,type=bind",
6+
"workspaceFolder": "/home/ubuntu/ws_ros/src/ros2-template",
7+
"remoteUser": "ubuntu",
88
"runArgs": [
99
"--network=host",
1010
"--cap-add=SYS_PTRACE",

.devcontainer/nvidia/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
FROM ghcr.io/robotic-decision-making-lab/ros2-template:iron-desktop-nvidia
1+
FROM ghcr.io/robotic-decision-making-lab/ros2-template:jazzy-desktop-nvidia
22

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

108
COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME
@@ -18,9 +16,20 @@ RUN sudo apt-get -q update \
1816
&& sudo rm -rf /var/lib/apt/lists/*
1917

2018
# Install debugging/linting Python packages
21-
COPY --chown=$USER_UID:$USER_GID requirements-dev.txt .
22-
RUN python3 -m pip install -r requirements-dev.txt \
23-
&& rm -rf requirements-dev.txt
19+
RUN pip install \
20+
pre-commit \
21+
mypy
22+
23+
# Install debugging/linting C++ packages
24+
RUN sudo apt-get -q update \
25+
&& sudo apt-get -q -y upgrade \
26+
&& sudo apt-get install -y \
27+
clang-format-18 \
28+
clang-tidy \
29+
clang-tools \
30+
&& sudo apt-get autoremove -y \
31+
&& sudo apt-get clean -y \
32+
&& sudo rm -rf /var/lib/apt/lists/*
2433

2534
# Disable the setuputils installation warning
2635
# This prevents us from needing to pin the setuputils version (which doesn't always work)

.devcontainer/nvidia/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "ROS 2 NVIDIA Dev Container",
33
"dockerFile": "Dockerfile",
44
"context": "../..",
5-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ros/ws_ros/src/ros2-template,type=bind",
6-
"workspaceFolder": "/home/ros/ws_ros/src/ros2-template",
7-
"remoteUser": "ros",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/ros2-template,type=bind",
6+
"workspaceFolder": "/home/ubuntu/ws_ros/src/ros2-template",
7+
"remoteUser": "ubuntu",
88
"runArgs": [
99
"--network=host",
1010
"--cap-add=SYS_PTRACE",

.docker/Dockerfile

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG ROS_DISTRO=iron
1+
ARG ROS_DISTRO=jazzy
22
FROM ros:$ROS_DISTRO-ros-base as ci
33

44
ENV DEBIAN_FRONTEND=noninteractive
@@ -16,11 +16,9 @@ RUN apt-get -q update \
1616
git \
1717
sudo \
1818
clang \
19-
clang-format-14 \
20-
clang-tidy \
21-
clang-tools \
2219
python3-pip \
2320
python3-dev \
21+
python3-venv \
2422
apt-utils \
2523
software-properties-common \
2624
&& apt-get autoremove -y \
@@ -39,28 +37,33 @@ RUN apt-get -q update \
3937

4038
FROM ci as robot
4139

42-
# Configure a new non-root user
43-
ARG USERNAME=ros
40+
ENV DEBIAN_FRONTEND=noninteractive
41+
42+
# Configure the ubuntu non-root user
43+
ARG USERNAME=ubuntu
4444
ARG USER_UID=1000
4545
ARG USER_GID=$USER_UID
4646

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

54-
# Switch to the non-root user
51+
# Switch to the ubuntu non-root user
5552
USER $USERNAME
5653
ENV USER=$USERNAME
5754

58-
ENV DEBIAN_FRONTEND=noninteractive
5955
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
6056
WORKDIR $USER_WORKSPACE
6157

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

60+
# Create a new virtual environment for Python
61+
ENV VIRTUAL_ENV=$USER_WORKSPACE/.venv/$PROJECT_NAME
62+
RUN python3 -m venv --system-site-packages $VIRTUAL_ENV \
63+
&& echo "source ${VIRTUAL_ENV}/bin/activate" >> /home/$USERNAME/.bashrc \
64+
&& touch .venv/COLCON_IGNORE
65+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
66+
6467
# Uncomment to download and install external repos used by the project
6568
# RUN vcs import src < src/$PROJECT_NAME/ros2.repos
6669

@@ -69,7 +72,7 @@ WORKDIR $USER_WORKSPACE
6972
RUN sudo apt-get -q update \
7073
&& sudo apt-get -q -y upgrade \
7174
&& rosdep update \
72-
&& rosdep install -y --from-paths src --ignore-src -r --rosdistro ${ROS_DISTRO} \
75+
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
7376
&& sudo apt-get autoremove -y \
7477
&& sudo apt-get clean -y \
7578
&& sudo rm -rf /var/lib/apt/lists/*
@@ -85,29 +88,11 @@ ENV DEBIAN_FRONTEND=noninteractive
8588
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
8689
WORKDIR $USER_WORKSPACE
8790

88-
# Install tools needed for Gazebo installation
91+
# Install Gazebo
8992
RUN sudo apt-get -q update \
9093
&& sudo apt-get -q -y upgrade \
9194
&& sudo apt-get install -y \
92-
lsb-release \
93-
wget \
94-
gnupg \
95-
&& sudo apt-get autoremove -y \
96-
&& sudo apt-get clean -y \
97-
&& sudo rm -rf /var/lib/apt/lists/*
98-
99-
# Set to the desired version of Gazebo
100-
# Refer to the official documentation for the recommended pairings:
101-
# https://gazebosim.org/docs/harmonic/ros_installation
102-
ENV GAZEBO_VERSION=harmonic
103-
104-
RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
105-
&& 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 \
106-
&& sudo apt-get -q update \
107-
&& sudo apt-get -q -y upgrade \
108-
&& sudo apt-get install -y \
109-
gz-$GAZEBO_VERSION \
110-
ros-$ROS_DISTRO-ros-gz$GAZEBO_VERSION \
95+
ros-$ROS_DISTRO-ros-gz \
11196
&& sudo apt-get autoremove -y \
11297
&& sudo apt-get clean -y \
11398
&& sudo rm -rf /var/lib/apt/lists/*

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
env:
22-
- IMAGE: iron-ci
23-
ROS_DISTRO: iron
22+
- IMAGE: jazzy-ci
23+
ROS_DISTRO: jazzy
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4

.github/workflows/docker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
ROS_DISTRO: [iron]
21+
ROS_DISTRO: [jazzy]
2222
runs-on: ubuntu-latest
2323
permissions:
2424
packages: write
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
ROS_DISTRO: [iron]
62+
ROS_DISTRO: [jazzy]
6363
runs-on: ubuntu-latest
6464
permissions:
6565
packages: write
@@ -107,7 +107,7 @@ jobs:
107107
strategy:
108108
fail-fast: false
109109
matrix:
110-
ROS_DISTRO: [iron]
110+
ROS_DISTRO: [jazzy]
111111
runs-on: ubuntu-latest
112112
permissions:
113113
packages: write
@@ -148,7 +148,7 @@ jobs:
148148
strategy:
149149
fail-fast: false
150150
matrix:
151-
ROS_DISTRO: [iron]
151+
ROS_DISTRO: [jazzy]
152152
runs-on: ubuntu-latest
153153
permissions:
154154
packages: write

.github/workflows/format.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ on:
1010
jobs:
1111
pre-commit:
1212
name: Format
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout repository
1616
uses: actions/checkout@v4
1717

1818
- name: Setup Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: "3.10"
21+
python-version: "3.12"
2222

23-
- name: Install clang-format-14
24-
run: sudo apt-get install clang-format-14
23+
- name: Install clang-format-18
24+
run: sudo apt-get install clang-format-18
2525

2626
- name: Run pre-commit
2727
uses: pre-commit/action@v3.0.1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
build
33
install
44
log
5+
6+
# virtualenv
7+
.venv

0 commit comments

Comments
 (0)