Skip to content

Jazzy ROS image is now based on "noble" (backport #220) #243

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 20 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c8e46b7
Bump docker/login-action from 3.1.0 to 3.2.0 (#172)
dependabot[bot] Jun 5, 2024
880a2d6
Bump docker/build-push-action from 5.3.0 to 5.4.0 (#175)
dependabot[bot] Jun 11, 2024
107fe4c
Bump braces from 3.0.2 to 3.0.3 in /docs (#182)
dependabot[bot] Jun 21, 2024
4efc645
Bump docker/build-push-action from 5.4.0 to 6.0.0 (#179)
dependabot[bot] Jun 22, 2024
3c1a0e6
Bump docker/build-push-action from 6.0.0 to 6.1.0 (#187)
dependabot[bot] Jun 24, 2024
9ddb154
Resolved bug in BlueROV2 Heavy and Heavy Reach launch configurations …
evan-palmer Jun 25, 2024
531ed83
Added additional resources for USB/IP tutorial (#196)
evan-palmer Jun 26, 2024
8639c41
Bump docker/build-push-action from 6.1.0 to 6.2.0 (#200)
dependabot[bot] Jul 1, 2024
ba4425b
Bump docker/build-push-action from 6.2.0 to 6.3.0 (#203)
dependabot[bot] Jul 8, 2024
e1d86cc
Bump docker/setup-qemu-action from 3.0.0 to 3.1.0 (#204)
dependabot[bot] Jul 8, 2024
73f77b8
Bump docker/setup-qemu-action from 3.1.0 to 3.2.0 (#205)
dependabot[bot] Jul 22, 2024
d7120bd
Bump docker/build-push-action from 6.3.0 to 6.5.0 (#206)
dependabot[bot] Jul 22, 2024
1434edd
Bump docker/login-action from 3.2.0 to 3.3.0 (#207)
dependabot[bot] Jul 22, 2024
8bbb19e
Fix case on "as" in Dockerfile (#214)
amarburg Jul 26, 2024
506be06
Add xacro as an exec_depend for blue_description (#215)
amarburg Jul 26, 2024
ba77c25
Add "robot" container (#221)
amarburg Aug 5, 2024
8a4e05a
Use Gazebo Harmonic (#223)
amarburg Aug 8, 2024
fe3861d
Rolling ROS image is now based on "noble" (#220)
amarburg Aug 17, 2024
4b4e695
Backport #220 into Jazzy
evan-palmer Aug 17, 2024
e04fccb
Removed testing image from nvidia-desktop compose script
evan-palmer Aug 17, 2024
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: 2 additions & 2 deletions .devcontainer/nouveau/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ghcr.io/robotic-decision-making-lab/blue:rolling-desktop
FROM ghcr.io/robotic-decision-making-lab/blue: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=blue
ENV USERNAME=ubuntu
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
WORKDIR $USER_WORKSPACE

Expand Down
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": "Nouveau Dev Container",
"dockerFile": "Dockerfile",
"context": "../..",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/blue/ws_blue/src/blue",
"remoteUser": "blue",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/ubuntu/ws_blue/src/blue",
"remoteUser": "ubuntu",
"runArgs": [
"--network=host",
"--cap-add=SYS_PTRACE",
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/nvidia/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ghcr.io/robotic-decision-making-lab/blue:rolling-desktop-nvidia
FROM ghcr.io/robotic-decision-making-lab/blue: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=blue
ENV USERNAME=ubuntu
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
WORKDIR $USER_WORKSPACE

Expand Down
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": "NVIDIA Dev Container",
"dockerFile": "Dockerfile",
"context": "../..",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/blue/ws_blue/src/blue",
"remoteUser": "blue",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/ubuntu/ws_blue/src/blue",
"remoteUser": "ubuntu",
"runArgs": [
"--network=host",
"--cap-add=SYS_PTRACE",
Expand Down
31 changes: 31 additions & 0 deletions .devcontainer/robot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Dockerfile for *-robot development container
#
ARG BLUE_GITHUB_REPO=Robotic-Decision-Making-Lab/blue
ARG ROS_DISTRO=jazzy
FROM ${BLUE_GITHUB_REPO}:${ROS_DISTRO}-robot

# 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=ubuntu
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
WORKDIR $USER_WORKSPACE

COPY --chown=$USER_UID:$USER_GID . src/blue
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys="gz-transport12 gz-sim7 gz-math7 gz-msgs9 gz-plugin2" \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install debugging/linting Python packages
RUN python3 -m pip install \
pre-commit \
mypy

# Disable the setuputils installation warning
# This prevents us from needing to pin the setuputils version (which doesn't always work)
ENV PYTHONWARNINGS="ignore"
40 changes: 40 additions & 0 deletions .devcontainer/robot/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Robot Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": "../..",
"args": {
"BLUE_GITHUB_REPO": "ghcr.io/robotic-decision-making-lab/blue",
"ROS_DISTRO": "jazzy"
}
},
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/ubuntu/ws_blue/src/blue",
"remoteUser": "ubuntu",
"runArgs": [
"--network=host",
"--cap-add=SYS_PTRACE",
"--security-opt=seccomp:unconfined",
"--security-opt=apparmor:unconfined",
"--volume=/dev:/dev",
"--privileged",
"--volume=/run/user/1000:/run/user/1000"
],
"containerEnv": {},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"ms-python.python",
"njpwerner.autodocstring",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"smilerobotics.urdf",
"esbenp.prettier-vscode",
"charliermarsh.ruff",
"josetr.cmake-language-support-vscode",
"unifiedjs.vscode-mdx"
]
}
}
}
132 changes: 97 additions & 35 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG ROS_DISTRO=rolling
FROM ros:$ROS_DISTRO-ros-base as ci
ARG ROS_DISTRO=jazzy
FROM ros:$ROS_DISTRO-ros-base AS ci

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -18,6 +18,7 @@ RUN apt-get -q update \
clang-tools \
python3-pip \
python3-dev \
python3-venv \
lsb-release \
wget \
gnupg \
Expand All @@ -26,7 +27,8 @@ RUN apt-get -q update \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Install all ROS dependencies
# Install all ROS dependencies for _just_ blue
# (we have not imported other repos from .repos files)
RUN apt-get -q update \
&& apt-get -q -y upgrade \
&& rosdep update \
Expand All @@ -36,16 +38,24 @@ RUN apt-get -q update \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

FROM ci as robot

# Configure a new non-root user
ARG USERNAME=blue
# This stage includes
# - Switching to the non-root user
# - Copying 'blue' source from this repo into the non-root user's workspace
# - Installing blue deps using pip, apt and rosdep
# - Installs the remaining blue dependencies from blue_robot.repos
# - Installs deps from rosdep for all src dependencies
# - colcon build
#
FROM ci AS robot

#
# Ubuntu 24.04 "Noble", which is used as the base image for
# jazzy and rolling images, now includes a user "ubuntu" at UID 1000
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
Expand All @@ -56,6 +66,16 @@ ENV DEBIAN_FRONTEND=noninteractive
USER $USERNAME
ENV USER=$USERNAME

# Python in Ubuntu is now marked as a "Externally managed environment",
# Per best practice, create a venv for local python packages
#
# These two ENVs effectively "activate" the venv for subsequent calls to
# python/pip in the Dockerfile
WORKDIR /home/$USERNAME
ENV VIRTUAL_ENV=/home/$USERNAME/.venv/blue
RUN python3 -m venv --system-site-packages --symlinks $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Install MAVROS dependencies
WORKDIR /home/$USERNAME
RUN wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \
Expand All @@ -81,58 +101,100 @@ RUN sudo apt-get -q update \
gstreamer1.0-plugins-ugly \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
libgstreamer1.0-dev \
gstreamer1.0-gl \
libgstreamer-plugins-base1.0-dev \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Manually install MAVROS from source in the ws_blue/ workspace
WORKDIR $USER_WORKSPACE/src/
ARG MAVROS_RELEASE=ros2
# mavlink-gdp-release has not been released for Jazzy, so we use the Rolling release
ARG MAVLINK_RELEASE=release/rolling/mavlink
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@amarburg Wanted to point this out to you

RUN git clone --depth 1 -b ${MAVROS_RELEASE} https://github.com/mavlink/mavros.git
RUN git clone --depth 1 --recursive -b ${MAVLINK_RELEASE} https://github.com/mavlink/mavlink-gbp-release.git mavlink
# - mavgen uses future.standard_library for backwards compatibility with Python2;
# However, this caused issues with Python 3.12 installed in "noble".
# Comment those lines out in mavlink.
#
# - Fix linkage for yaml-cpp in mavros_extra_plugins
RUN sed -i -e 's/^from future import standard_library/#from future import standard_library/' \
-e 's/standard_library.install_aliases()/#standard_library.install_aliases()/' \
mavlink/pymavlink/generator/mavgen.py && \
sed -i -e 's/^# find_package(yaml_cpp REQUIRED)/find_package(yaml-cpp REQUIRED)/' \
-e '/^ament_target_dependencies(mavros_extras_plugins$/i target_link_libraries(mavros_extras_plugins yaml-cpp::yaml-cpp)' \
-e '/^ament_target_dependencies(mavros_extras$/i target_link_libraries(mavros_extras yaml-cpp::yaml-cpp)' \
mavros/mavros_extras/CMakeLists.txt

WORKDIR $USER_WORKSPACE
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& vcs import src < src/blue/blue.repos \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Actually build workspace
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
&& colcon build

RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \
&& echo "source $VIRTUAL_ENV/bin/activate" >> /home/$USERNAME/.bashrc \
&& echo "\n# Ensure colcon is run in the venv\nalias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc

FROM robot as desktop
FROM robot AS desktop

ENV DEBIAN_FRONTEND=noninteractive
ENV GZ_VERSION=garden

# Install Gazebo Garden: https://gazebosim.org/docs/garden/install_ubuntu
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 -y --quiet --no-install-recommends install \
gz-garden \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install ArduPilot and ardupilot_gazebo dependencies
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& sudo apt-get -q install --no-install-recommends -y \
ENV GZ_VERSION=harmonic

# Install Gazebo Harmonic: https://gazebosim.org/docs/harmonic/install_ubuntu
# Per DL3004, use "USER root" rather than "sudo"
# https://github.com/hadolint/hadolint/wiki/DL3004
USER root
# Install custom rosdep list
ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list
RUN 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" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \
&& apt-get -q update \
&& apt-get -y --quiet --no-install-recommends install \
cppzmq-dev \
gz-${GZ_VERSION} \
python3-pexpect \
python3-wxgtk4.0 \
python3-future \
rapidjson-dev \
xterm \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*
rapidjson-dev \
libopencv-dev \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
USER $USERNAME

# Clone ArduSub
# ArduSub is installed for simulation purposes ONLY
# When deployed onto hardware, the native installation of ArduSub
# (on the FCU) will be used.
WORKDIR /home/$USERNAME
RUN git clone https://github.com/ArduPilot/ardupilot.git --recurse-submodules
# Really should do version pinning but Sub-4.5 is waaaay behind master
# (e.g. it doesn't know about "noble" yet)
ARG ARDUPILOT_RELEASE=master
RUN git clone -b ${ARDUPILOT_RELEASE} https://github.com/ArduPilot/ardupilot.git --recurse-submodules

# Install ArduSub dependencies
WORKDIR /home/$USERNAME/ardupilot
ENV SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1
RUN Tools/environment_install/install-prereqs-ubuntu.sh -y
# Do not install the STM development tools
ENV DO_AP_STM_ENV=0
# Do not activate the Ardupilot venv by default
ENV DO_PYTHON_VENV_ENV=0
RUN echo "\n# Below from ardupilot script \"install-prereqs-ubuntu.sh\"\n" >> /home/$USERNAME/.bashrc && \
Tools/environment_install/install-prereqs-ubuntu.sh -y

# Build ArduSub
WORKDIR /home/$USERNAME/ardupilot
Expand All @@ -155,7 +217,7 @@ RUN [ "/bin/bash" , "-c" , " \
WORKDIR $USER_WORKSPACE
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& vcs import src < src/blue/blue.repos \
&& vcs import src < src/blue/sim.repos \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
Expand All @@ -171,7 +233,7 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
# Setup the simulation environment variables
RUN echo "source ${USER_WORKSPACE}/src/blue/.docker/entrypoints/sim.sh" >> /home/$USERNAME/.bashrc

FROM desktop as desktop-nvidia
FROM desktop AS desktop-nvidia

# Install NVIDIA software
RUN sudo apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion .docker/compose/nouveau-desktop.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
blue:
image: ghcr.io/robotic-decision-making-lab/blue:rolling-desktop
image: ghcr.io/robotic-decision-making-lab/blue:jazzy-desktop
environment:
- DISPLAY=${DISPLAY}
- XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}
Expand Down
2 changes: 1 addition & 1 deletion .docker/compose/nvidia-desktop.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
blue:
image: ghcr.io/robotic-decision-making-lab/blue:rolling-desktop-nvidia
image: ghcr.io/robotic-decision-making-lab/blue:jazzy-desktop-nvidia
environment:
- DISPLAY=${DISPLAY}
- XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}
Expand Down
21 changes: 21 additions & 0 deletions .docker/compose/robot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
blue:
image: ghcr.io/robotic-decision-making-lab/blue:jazzy-robot
build:
dockerfile: .docker/Dockerfile
target: robot
context: ../../
network_mode: host
privileged: true
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
- apparmor:unconfined
volumes:
- /dev:/dev
- /run/user/1000:/run/user/1000
- type: bind
source: ../../
target: /home/blue/ws_blue/src/blue
command: tail -f /dev/null
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
!blue_description
!blue_demos
!blue.repos
!sim.repos
!.docker/entrypoints
!requirements-build.txt
Loading