Skip to content

Commit

Permalink
feat!: upgrade to jazzy on noble (#13)
Browse files Browse the repository at this point in the history
* feat: update to use the noble image

* fix: use branch of mypy generator for rolling

* feat: use gcc14, node20, apt pkgs for rr and sccache
  • Loading branch information
russkel authored May 6, 2024
1 parent 932435c commit fae8c18
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 58 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ jobs:
echo Published ${{ needs.release.outputs.published }}
echo Version ${{ needs.release.outputs.version }}
docker manifest create ghcr.io/greenroom-robotics/ros_builder:iron-latest \
ghcr.io/greenroom-robotics/ros_builder:iron-latest-amd64 \
ghcr.io/greenroom-robotics/ros_builder:iron-latest-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-latest \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:iron-latest-cuda \
ghcr.io/greenroom-robotics/ros_builder:iron-latest-cuda-amd64 \
ghcr.io/greenroom-robotics/ros_builder:iron-latest-cuda-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }} \
ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}-amd64 \
ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }} \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}-cuda \
ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}-cuda-amd64 \
ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}-cuda-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda-arm64
docker manifest push ghcr.io/greenroom-robotics/ros_builder:iron-latest
docker manifest push ghcr.io/greenroom-robotics/ros_builder:iron-latest-cuda
docker manifest push ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}
docker manifest push ghcr.io/greenroom-robotics/ros_builder:iron-${{ needs.release.outputs.version }}-cuda
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-latest
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda
45 changes: 25 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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,14 +32,14 @@ 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
Expand All @@ -49,10 +49,12 @@ ENV LC_ALL C.UTF-8
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update && apt-get install --no-install-recommends -y \
build-essential \
gcc-12-base \
g++-12 \
gcc-14-base \
g++-14 \
gdb \
rr \
cmake \
sccache \
debhelper \
dh-python \
dpkg-dev \
Expand All @@ -75,18 +77,19 @@ 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/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

# set gcc version to latest available on ubuntu rel
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 && \
update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-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
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 && \
update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-14 14 && \
update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-14 14 && \
update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-14 14

# bootstrap rosdep
RUN rosdep init && \
Expand All @@ -106,18 +109,19 @@ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
# install yarn and pyright
RUN apt-get install -y nodejs && npm install --global yarn pyright

RUN pip install pre-commit
RUN pip install --break-system-packages pre-commit

# Install Greenroom fork of bloom
RUN pip install https://github.com/Greenroom-Robotics/bloom/archive/refs/heads/gr.zip
RUN pip install --break-system-packages https://github.com/Greenroom-Robotics/bloom/archive/refs/heads/gr.zip

# Install Greenroom's rosdep fork which allows installation from URLs and specific versions with downgrades
RUN apt-get remove python3-rosdep -y
RUN pip install -U https://github.com/Greenroom-Robotics/rosdep/archive/refs/heads/greenroom.zip
RUN pip install --break-system-packages -U https://github.com/Greenroom-Robotics/rosdep/archive/refs/heads/greenroom.zip

RUN useradd --create-home --home /home/ros --shell /bin/bash --uid 1000 ros && \
RUN usermod --move-home --home /home/ros --login ros ubuntu && \
usermod -a -G audio,video,sudo,plugdev,dialout ros && \
passwd -d ros && \
usermod -a -G audio,video,sudo,plugdev,dialout ros
groupmod --new-name ros ubuntu

# Build external source packages
WORKDIR /home/ros
Expand Down Expand Up @@ -145,4 +149,5 @@ 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 curl -sSL https://install.python-poetry.org | python3 -
RUN pip install --break-system-packages poetry
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This builds a base ROS 2 docker image used for building Greenroom packages.

There are 4 different variations of `ros_builder`. See [ghcr](https://github.com/Greenroom-Robotics/ros_builder/pkgs/container/ros_builder). These are

* ` ghcr.io/greenroom-robotics/ros_builder:iron-lastest` **AMD64**
* ` ghcr.io/greenroom-robotics/ros_builder:iron-lastest-cuda` **AMD64**
* ` ghcr.io/greenroom-robotics/ros_builder:iron-lastest` **ARM64**
* ` ghcr.io/greenroom-robotics/ros_builder:iron-lastest-cuda` **ARM64**
* ` ghcr.io/greenroom-robotics/ros_builder:jazzy-lastest` **AMD64**
* ` ghcr.io/greenroom-robotics/ros_builder:jazzy-lastest-cuda` **AMD64**
* ` ghcr.io/greenroom-robotics/ros_builder:jazzy-lastest` **ARM64**
* ` ghcr.io/greenroom-robotics/ros_builder:jazzy-lastest-cuda` **ARM64**

## Releasing

Expand All @@ -31,4 +31,4 @@ Trigger the [publish.yml](./.github/workflows/publish.yml) github action
*This will be fast(er) to build but slow to upload.*

* `yarn version --patch|minor|major`
* `python3 scripts/docker-build.py --version 1.0.0 --arch amd64 --ros_distro iron`
* `python3 scripts/docker-build.py --version 1.0.0 --arch amd64 --ros_distro jazzy`
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 release.config.amd64.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = {
[
"@semantic-release/exec",
{
"prepareCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch amd64 --ros_distro iron",
"publishCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch amd64 --ros_distro iron --push true"
"prepareCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch amd64 --ros_distro jazzy",
"publishCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch amd64 --ros_distro jazzy --push true"
}
],
[
Expand Down
4 changes: 2 additions & 2 deletions release.config.arm64.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = {
[
"@semantic-release/exec",
{
"prepareCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch arm64 --ros_distro iron",
"publishCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch arm64 --ros_distro iron --push true"
"prepareCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch arm64 --ros_distro jazzy",
"publishCmd": "scripts/docker-build.py --version ${nextRelease.version} --arch arm64 --ros_distro jazzy --push true"
}
]
],
Expand Down
24 changes: 12 additions & 12 deletions scripts/docker-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import List, Dict


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

ENV = Dict[str, str]
Expand Down Expand Up @@ -47,16 +47,16 @@ def build_image(base_image: str, ros_distro: str, arch: str, tags: List[str], pu


# Build images
build_image(
base_image=f"nvidia/cuda:{CUDA_VERSION}",
ros_distro=args.ros_distro,
arch=args.arch,
tags=[
f"ghcr.io/greenroom-robotics/ros_builder:{args.ros_distro}-{args.version}-cuda-{args.arch}",
f"ghcr.io/greenroom-robotics/ros_builder:{args.ros_distro}-latest-cuda-{args.arch}"
],
push=args.push,
)
# build_image(
# base_image=f"nvidia/cuda:{CUDA_VERSION}",
# ros_distro=args.ros_distro,
# arch=args.arch,
# tags=[
# f"ghcr.io/greenroom-robotics/ros_builder:{args.ros_distro}-{args.version}-cuda-{args.arch}",
# f"ghcr.io/greenroom-robotics/ros_builder:{args.ros_distro}-latest-cuda-{args.arch}"
# ],
# push=args.push,
# )
build_image(
base_image=f"ubuntu:{UBUNTU_CODENAME}",
ros_distro=args.ros_distro,
Expand Down

0 comments on commit fae8c18

Please sign in to comment.