Skip to content

Commit

Permalink
feat: back to the future, update iron image
Browse files Browse the repository at this point in the history
* fix: use branch of mypy generator for rolling

fix: remove --break-system-packages as it causes issues in release processes that should run on both iron and jazzy

chore: remove EXTERNALLY-MANAGED after pip is installed

fix: add ping

fix: bump rr version

fix: install poetry-plugin-export
  • Loading branch information
russkel committed Nov 19, 2024
1 parent 932435c commit 2a1c4fb
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.API_TOKEN_GITHUB }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: iron
- name: Setup Node.js
uses: actions/setup-node@v2
- name: Install npm dependencies
Expand Down
28 changes: 16 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL ["/bin/bash", "-c"]

ENV ROS_DISTRO="${ROS_DISTRO}"
ENV ROS_PYTHON_VERSION=3
ENV RMW_IMPLEMENTATION rmw_fastrtps_cpp
ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp

# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
Expand All @@ -23,7 +23,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
echo 'wireshark-common wireshark-common/install-setuid boolean true' | debconf-set-selections

# install packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
RUN apt-get update && apt-get dist-upgrade -q -y && apt-get install -q -y --no-install-recommends \
less \
dirmngr \
gnupg2 \
Expand All @@ -32,18 +32,18 @@ RUN apt-get update && apt-get install -q -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# setup ros2 apt sources
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/ros2.list
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/vulcanexus-archive-keyring.gpg] http://repo.vulcanexus.org/debian $(source /etc/os-release && echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/vulcanexus.list
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2-testing/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/ros2.list
# RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/vulcanexus-archive-keyring.gpg] http://repo.vulcanexus.org/debian $(source /etc/os-release && echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/vulcanexus.list
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gazebo-stable-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(source /etc/os-release && echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/gazebo-stable.list

# setup keys
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& curl -sSL https://raw.githubusercontent.com/eProsima/vulcanexus/main/vulcanexus.key -o /usr/share/keyrings/vulcanexus-archive-keyring.gpg \
&& curl -sSL https://packages.osrfoundation.org/gazebo.key | gpg --dearmor -o /usr/share/keyrings/gazebo-stable-keyring.gpg
# && curl -sSL https://raw.githubusercontent.com/eProsima/vulcanexus/main/vulcanexus.key -o /usr/share/keyrings/vulcanexus-archive-keyring.gpg \

# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

# install bootstrap tools and ros2 packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Expand All @@ -59,6 +59,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
fakeroot \
git \
jq \
iputils-ping \
python3-catkin-pkg \
python3-colcon-common-extensions \
python3-colcon-mixin \
Expand All @@ -75,11 +76,11 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
ros-${ROS_DISTRO}-ros-core \
ros-${ROS_DISTRO}-geographic-msgs \
ros-${ROS_DISTRO}-example-interfaces \
vulcanexus-${ROS_DISTRO}-core \
wget

RUN curl -L https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-$(uname -m)-unknown-linux-musl.tar.gz | tar zx --wildcards "*/sccache" --strip-components 1 --directory=/usr/bin
RUN curl -L https://github.com/rr-debugger/rr/releases/download/5.7.0/rr-5.7.0-Linux-$(uname -m).deb --output rr.deb && dpkg --install rr.deb && rm rr.deb
# vulcanexus-${ROS_DISTRO}-core \

RUN curl -L https://github.com/rr-debugger/rr/releases/download/5.8.0/rr-5.8.0-Linux-$(uname -m).deb --output rr.deb && dpkg --install rr.deb && rm rr.deb

# set gcc version to latest available on ubuntu rel
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 && \
Expand All @@ -88,6 +89,9 @@ RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 && \
update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-12 12 && \
update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-12 12

# Remove EXTERNALLY-MANAGED so we don't need to add --break-system-packages to pip
RUN sudo rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED

# bootstrap rosdep
RUN rosdep init && \
rosdep update --rosdistro $ROS_DISTRO
Expand Down Expand Up @@ -135,7 +139,7 @@ RUN source /opt/ros/${ROS_DISTRO}/setup.sh && colcon build --base-paths external
RUN --mount=type=bind,source=scripts,target=scripts \
source /opt/ros/${ROS_DISTRO}-ext/setup.sh && python3 scripts/rosidl_generate_inplace.py

ENV ROS_OVERLAY /opt/ros/${ROS_DISTRO}-ext
ENV ROS_OVERLAY=/opt/ros/${ROS_DISTRO}-ext
WORKDIR /home/ros
ENV PATH="/home/ros/.local/bin:${PATH}"

Expand All @@ -145,4 +149,4 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloa
USER ros

# Install poetry as ros user
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN pip install poetry poetry-plugin-export
2 changes: 1 addition & 1 deletion external.repos
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- git:
local-name: rosidl_generator_mypy
uri: https://github.com/Greenroom-Robotics/rosidl_generator_mypy
version: master
version: feature/fix-deprecation
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "ros_builder",
"private": true,
"version": "1.5.0",
"description": "Greenroom's base ROS2 image",
"version": "1.5.6",
"description": "Greenroom's base ROS 2 Iron image",
"main": "index.js",
"scripts": {},
"repository": "[email protected]:Greenroom-Robotics/ros_builder.git",
Expand Down
3 changes: 2 additions & 1 deletion release.config.amd64.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

module.exports = {
branches: ['main'],
branches: ['iron'],
tagFormat: 'iron-${version}',
plugins:
[
[
Expand Down
3 changes: 2 additions & 1 deletion release.config.arm64.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

module.exports = {
branches: ['main', 'add-integration-service-to-gama'],
branches: ['iron'],
tagFormat: 'iron-${version}',
plugins:
[
[
Expand Down
13 changes: 9 additions & 4 deletions scripts/docker-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
from typing import List, Dict


UBUNTU_VERSION = "22.04"
UBUNTU_CODENAME = "jammy"
CUDA_VERSION = "11.7.1-devel-ubuntu22.04"

ENV = Dict[str, str]


Expand Down Expand Up @@ -46,6 +42,15 @@ def build_image(base_image: str, ros_distro: str, arch: str, tags: List[str], pu
args = parser.parse_args()


if args.ros_distro == "jazzy":
UBUNTU_VERSION = "24.04"
UBUNTU_CODENAME = "noble"
CUDA_VERSION = f"12.5.1-devel-ubuntu{UBUNTU_VERSION}"
elif args.ros_distro == "iron":
UBUNTU_VERSION = "22.04"
UBUNTU_CODENAME = "jammy"
CUDA_VERSION = f"11.7.1-devel-ubuntu{UBUNTU_VERSION}"

# Build images
build_image(
base_image=f"nvidia/cuda:{CUDA_VERSION}",
Expand Down

0 comments on commit 2a1c4fb

Please sign in to comment.