From c29de410aa7ca702881e4c2aa120850cf45310b0 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:16:55 +0100 Subject: [PATCH] Fix ci testing (backport #1994) (#1997) (cherry picked from commit caac9da542857d71d45d8b6d632cab8469847b46) Co-authored-by: Henning Kayser --- .docker/ci-testing/Dockerfile | 56 +++++++++++++++++++++++++++++++---- .github/workflows/docker.yaml | 1 - 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/.docker/ci-testing/Dockerfile b/.docker/ci-testing/Dockerfile index c304416645..88ee8eb1ee 100644 --- a/.docker/ci-testing/Dockerfile +++ b/.docker/ci-testing/Dockerfile @@ -2,15 +2,59 @@ # CI image using the ROS testing repository ARG ROS_DISTRO=rolling -FROM ghcr.io/ros-planning/moveit2:${ROS_DISTRO}-ci +FROM osrf/ros2:testing LABEL maintainer Robert Haschke rhaschke@techfak.uni-bielefeld.de -# Switch to ros-testing -RUN echo "deb http://packages.ros.org/ros2-testing/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2-latest.list +ENV TERM xterm -# Upgrade packages to ros-shadow-fixed and clean apt-cache within one RUN command -RUN apt-get -qq update && \ - apt-get -qq upgrade && \ +# Install ROS 2 base packages and build tools +# We are installing ros--ros-base here to mimic the behavior of the ros:-ros-base images. +# This step is split into a separate layer so that we can rely on cached dependencies instead of having +# to install them with every new build. The testing image and packages will only update every couple weeks. +RUN \ + # Update apt package list as previous containers clear the cache + apt-get -q update && \ + apt-get -q -y upgrade && \ + # + # Install base dependencies + apt-get -q install --no-install-recommends -y \ + # Some basic requirements + wget git sudo curl \ + # Preferred build tools + clang clang-format-14 clang-tidy clang-tools \ + ccache \ + ros-"$ROS_DISTRO"-ros-base && \ + # + # Clear apt-cache to reduce image size + rm -rf /var/lib/apt/lists/* + +# Setup (temporary) ROS workspace +WORKDIR /root/ws_moveit + +# Copy MoveIt sources from docker context +COPY . src/moveit2 + +# Commands are combined in single RUN statement with "apt/lists" folder removal to reduce image size +# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers +RUN \ + # Update apt package list as previous containers clear the cache + apt-get -q update && \ + apt-get -q -y upgrade && \ + # + # Globally disable git security + # https://github.blog/2022-04-12-git-security-vulnerability-announced + git config --global --add safe.directory "*" && \ + # + # Fetch all dependencies from moveit2.repos + vcs import src < src/moveit2/moveit2.repos && \ + if [ -r src/moveit2/moveit2_"$ROS_DISTRO".repos ] ; then vcs import src < src/moveit2/moveit2_"$ROS_DISTRO".repos ; fi && \ + # + # Download all dependencies of MoveIt + rosdep update && \ + DEBIAN_FRONTEND=noninteractive \ + rosdep install -y --from-paths src --ignore-src --rosdistro "$ROS_DISTRO" --as-root=apt:false && \ + # Remove the source code from this container + rm -rf src && \ # # Clear apt-cache to reduce image size rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 6ab8408a11..ff37875017 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -98,7 +98,6 @@ jobs: ${{ env.DH_IMAGE }} ci-testing: - needs: ci strategy: fail-fast: false matrix: