Skip to content

Commit

Permalink
Fix ci testing (backport #1994) (#1997)
Browse files Browse the repository at this point in the history
(cherry picked from commit caac9da)

Co-authored-by: Henning Kayser <[email protected]>
  • Loading branch information
mergify[bot] and henningkayser authored Mar 9, 2023
1 parent f467d56 commit c29de41
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 7 deletions.
56 changes: 50 additions & 6 deletions .docker/ci-testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]

# 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-<distro>-ros-base here to mimic the behavior of the ros:<distro>-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/*
1 change: 0 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
${{ env.DH_IMAGE }}
ci-testing:
needs: ci
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit c29de41

Please sign in to comment.