From 1bf08f0d0053c9d918186902c5944b3cfe89ff43 Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:23:28 +0200 Subject: [PATCH] fix(jazzy): correct backward_ros tag and release rc2 (#115) * fix: switch to jazzy and avoid docker warnings * fix: version of backward_ros * release: rc2 --- .github/workflows/build-push.yml | 2 +- .github/workflows/reusable-build-push.yml | 10 +++++-- ros2_ws/Dockerfile | 36 +++++++++++------------ ros2_ws/VERSION.jazzy | 2 +- ros2_ws/build.sh | 4 +-- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index c8d17b5..3d93359 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -15,7 +15,7 @@ jobs: build-ws: strategy: matrix: - ros2_distro: [ iron, jazzy ] + ros2_distro: [ jazzy ] name: Build and publish ros2-ws:${{ matrix.ros2_distro }} uses: ./.github/workflows/reusable-build-push.yml diff --git a/.github/workflows/reusable-build-push.yml b/.github/workflows/reusable-build-push.yml index 7807cdb..91a6dc0 100644 --- a/.github/workflows/reusable-build-push.yml +++ b/.github/workflows/reusable-build-push.yml @@ -86,8 +86,13 @@ jobs: BUILD_FLAGS+=(--build-arg BASE_TAG=${BASE_TAG}) VERSION_TAG="v${{ needs.check-version.outputs.version }}" - IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${ROS_DISTRO}","${ROS_DISTRO}" - GIT_TAG="${VERSION_TAG}-${{ inputs.ros_distro}}" + if [[ "${VERSION_TAG}" == *"-"* ]]; then + IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${ROS_DISTRO}" + GIT_TAG="" + else + IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${ROS_DISTRO}","${ROS_DISTRO}" + GIT_TAG="${VERSION_TAG}-${{ inputs.ros_distro}}" + fi BUILD_FLAGS+=(--build-arg VERSION=${GIT_TAG}) echo "::debug::Using base image tag ${BASE_TAG}" @@ -147,6 +152,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Create git tag + if: ${{ needs.metadata.outputs.git_tag }} != "" uses: aica-technology/.github/.github/actions/git-tag@v0.8.1 with: tag: ${{ needs.metadata.outputs.git_tag }} diff --git a/ros2_ws/Dockerfile b/ros2_ws/Dockerfile index d455877..f80d726 100644 --- a/ros2_ws/Dockerfile +++ b/ros2_ws/Dockerfile @@ -1,22 +1,22 @@ ARG BASE_IMAGE=docker.io/library/ros -ARG BASE_TAG=iron -ARG ROS_DISTRO=iron +ARG BASE_TAG=jazzy +ARG ROS_DISTRO=jazzy ARG VERSION=v0.0.0 -FROM ${BASE_IMAGE}:${BASE_TAG} as environment-variables +FROM ${BASE_IMAGE}:${BASE_TAG} AS environment-variables ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONWARNINGS=ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources -ENV PIP_NO_CACHE_DIR 1 -ENV USER ros2 -ENV HOME /home/${USER} -ENV ROS2_WORKSPACE /home/${USER}/ros2_ws -ENV COLCON_HOME ${HOME}/.colcon -ENV COLCON_DEFAULTS_FILE ${COLCON_HOME}/defaults.yaml +ENV PIP_NO_CACHE_DIR=1 +ENV USER=ros2 +ENV HOME=/home/${USER} +ENV ROS2_WORKSPACE=/home/${USER}/ros2_ws +ENV COLCON_HOME=${HOME}/.colcon +ENV COLCON_DEFAULTS_FILE=${COLCON_HOME}/defaults.yaml ENV COLCON_WORKSPACE=${ROS2_WORKSPACE} ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib -FROM environment-variables as base-dependencies +FROM environment-variables AS base-dependencies # disable suggested and recommended install RUN apt-config dump | grep -we Recommends -e Suggests | sed s/1/0/ \ @@ -56,13 +56,13 @@ RUN ( \ ) > /etc/ssh/sshd_config_development \ && mkdir /run/sshd -FROM base-dependencies as base-user-iron +FROM base-dependencies AS base-user-iron # create and configure a new user RUN addgroup --gid 1000 ${USER} RUN adduser --gecos "ROS2 User" --uid 1000 --gid 1000 ${USER} && yes | passwd ${USER} -FROM base-dependencies as base-user-jazzy +FROM base-dependencies AS base-user-jazzy # rename existing ubuntu user RUN usermod -l ${USER} ubuntu @@ -70,7 +70,7 @@ RUN groupmod -n ${USER} ubuntu RUN usermod -d ${HOME} -m ros2 RUN chfn -f "ROS2 User" ros2 -FROM base-user-${ROS_DISTRO} as base-workspace +FROM base-user-${ROS_DISTRO} AS base-workspace RUN usermod -a -G dialout ${USER} RUN echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget @@ -111,7 +111,7 @@ USER root RUN mkdir -p /root/.ssh/ && ssh-keyscan github.com | tee -a /root/.ssh/known_hosts RUN echo "session required pam_limits.so" | tee --append /etc/pam.d/common-session > /dev/null -FROM base-workspace as ros2-control-iron +FROM base-workspace AS ros2-control-iron RUN apt-get update && apt-get install --no-install-recommends -y \ doxygen \ @@ -145,7 +145,7 @@ WORKDIR ${ROS2_WORKSPACE} RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" RUN rm -rf ./src -FROM base-workspace as ros2-control-jazzy +FROM base-workspace AS ros2-control-jazzy RUN apt-get update && apt-get install --no-install-recommends -y \ # doxygen \ # librange-v3-dev \ @@ -161,7 +161,7 @@ RUN git clone -b 4.11.0 --depth 1 https://github.com/ros-controls/ros2_control.g RUN git clone -b 4.8.0 --depth 1 https://github.com/ros-controls/ros2_controllers.git # get additional interface dependencies manually RUN git clone -b 5.1.0 --depth 1 https://github.com/ros-controls/control_msgs.git -RUN git clone -b 1.0.5 --depth 1 https://github.com/pal-robotics/backward_ros.git +RUN git clone -b 1.0.3 --depth 1 https://github.com/pal-robotics/backward_ros.git RUN git clone -b 4.0.0 --depth 1 https://github.com/ros/diagnostics.git RUN git clone -b 2.5.0 --depth 1 https://github.com/ros-controls/realtime_tools.git RUN git clone -b 2.1.0 --depth 1 https://github.com/ros2/rcl_interfaces.git @@ -179,9 +179,9 @@ WORKDIR ${ROS2_WORKSPACE} RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" RUN rm -rf ./src -FROM ros2-control-${ROS_DISTRO} as ros2-control +FROM ros2-control-${ROS_DISTRO} AS ros2-control -FROM environment-variables as final +FROM environment-variables AS final COPY --from=ros2-control / / RUN rm -rf /home/ubuntu diff --git a/ros2_ws/VERSION.jazzy b/ros2_ws/VERSION.jazzy index 8a9ecc2..d816485 100644 --- a/ros2_ws/VERSION.jazzy +++ b/ros2_ws/VERSION.jazzy @@ -1 +1 @@ -0.0.1 \ No newline at end of file +2.0.0-rc2 \ No newline at end of file diff --git a/ros2_ws/build.sh b/ros2_ws/build.sh index ab911aa..5a1bb1b 100755 --- a/ros2_ws/build.sh +++ b/ros2_ws/build.sh @@ -1,8 +1,8 @@ #!/bin/bash IMAGE_NAME=ghcr.io/aica-technology/ros2-ws -BASE_TAG=iron -ROS_DISTRO=iron +BASE_TAG=jazzy +ROS_DISTRO=jazzy SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" if [[ ! -f "${SCRIPT_DIR}"/config/sshd_entrypoint.sh ]]; then