Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/ci-testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL maintainer="Robert Haschke rhaschke@techfak.uni-bielefeld.de"

# Switch to ros-testing
RUN apt-get update && \
apt-get install -y ros2-testing-apt-source && \
apt-get install -y ros2-testing-apt-source --no-install-recommends && \
# Upgrade packages to ros-testing and clean apt-cache within one RUN command
apt-get update && \
apt-get -qq -y dist-upgrade && \
Expand Down
7 changes: 5 additions & 2 deletions .docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ RUN \
apt-get -q install --no-install-recommends -y \
# Some basic requirements
wget git sudo curl \
# Use default gfortran for libopenmpi-dev
# https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/2166011
gfortran \
# Preferred build tools
clang clang-format clang-tidy clang-tools \
ccache && \
Expand All @@ -34,12 +37,12 @@ RUN \
#
# 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 && \
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 -r --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false || true && \
rosdep install -y -r --from-paths src --ignore-src --rosdistro "${ROS_DISTRO}" --as-root=apt:false || true && \
# Remove the source code from this container
rm -rf src && \
#
Expand Down
5 changes: 3 additions & 2 deletions .docker/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ ENV RTI_NC_LICENSE_ACCEPTED=yes

# Commands are combined in single RUN statement with "apt/lists" folder removal to reduce image size
RUN apt-get update -q && \
apt-get install -y ros2-testing-apt-source && apt-get update -q && \
apt-get install -y ros2-testing-apt-source --no-install-recommends && \
apt-get update -q && \
apt-get upgrade -q -y && \
apt-get install -y "ros-${ROS_DISTRO}-moveit-*" --no-install-recommends && \
apt-get install -y gfortran "ros-${ROS_DISTRO}-moveit-*" --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
4 changes: 2 additions & 2 deletions .docker/source/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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 --mount=type=cache,target=/root/.ccache/ \
RUN --mount=type=cache,target=/root/.ccache \
# Enable ccache
PATH=/usr/lib/ccache:$PATH && \
# Fetch required upstream sources for building
Expand All @@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/root/.ccache/ \
apt-get -q update && \
rosdep update && \
DEBIAN_FRONTEND=noninteractive \
rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false && \
rosdep install -y --from-paths src --ignore-src --rosdistro "${ROS_DISTRO}" --as-root=apt:false && \
rm -rf /var/lib/apt/lists/* && \
# Build the workspace
colcon build \
Expand Down
18 changes: 7 additions & 11 deletions .docker/tutorial-source/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,32 @@
# Source build of the repos file from the tutorial site

ARG ROS_DISTRO=rolling
ARG GZ_VERSION=ionic

FROM moveit/moveit2:${ROS_DISTRO}-source
LABEL maintainer="Tyler Weaver tyler@picknik.ai"
LABEL maintainer="Robert Haschke rhaschke@techfak.uni-bielefeld.de"

# 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 --mount=type=cache,target=/root/.ccache/,sharing=locked \
RUN --mount=type=cache,target=/root/.ccache \
# Install Gazebo, which is needed by some dependencies.
sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' && \
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - && \
sudo apt update && \
sudo apt-get install -y "gz-${GZ_VERSION}" && \
apt-get -q update && \
apt-get install -y "ros-${ROS_DISTRO}-ros-gz" --no-install-recommends && \
# Enable ccache
PATH=/usr/lib/ccache:$PATH && \
# Checkout the tutorial repo
git clone https://github.com/moveit/moveit2_tutorials src/moveit2_tutorials && \
# Fetch required upstream sources for building
vcs import --skip-existing src < src/moveit2_tutorials/moveit2_tutorials.repos && \
vcs import --skip-existing src < src/moveit2_tutorials/.github/upstream.repos && \
# Source ROS install
. "/opt/ros/${ROS_DISTRO}/setup.sh" &&\
# Install dependencies from rosdep
Comment thread
rhaschke marked this conversation as resolved.
apt-get -q update && \
rosdep update && \
DEBIAN_FRONTEND=noninteractive \
rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false && \
rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false && \
rm -rf /var/lib/apt/lists/* && \
# Build the workspace
colcon build \
--cmake-args "-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --no-warn-unused-cli" \
--ament-cmake-args -DCMAKE_BUILD_TYPE=Release \
--event-handlers desktop_notification- status- && \
ccache -s && \
ccache -s
32 changes: 1 addition & 31 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
# ignore everything
*
**
# but include these:
!moveit2*.repos
!**/package.xml
!**/COLCON_IGNORE

# https://github.com/moby/moby/issues/42788
!moveit_plugins/moveit_plugins/package.xml
!moveit_plugins/moveit_ros_control_interface/package.xml
!moveit_plugins/moveit_simple_controller_manager/package.xml
!moveit_kinematics/package.xml
!moveit_common/package.xml
!moveit_setup_assistant/package.xml
!moveit_core/package.xml
!moveit_commander/package.xml
!moveit_planners/ompl/package.xml
!moveit_planners/chomp/chomp_motion_planner/package.xml
!moveit_planners/chomp/chomp_interface/package.xml
!moveit_planners/pilz_industrial_motion_planner_testutils/package.xml
!moveit_planners/pilz_industrial_motion_planner/package.xml
!moveit_planners/moveit_planners/package.xml
!moveit_runtime/package.xml
!moveit/package.xml
!moveit_ros/warehouse/package.xml
!moveit_ros/moveit_servo/package.xml
!moveit_ros/occupancy_map_monitor/package.xml
!moveit_ros/perception/package.xml
!moveit_ros/move_group/package.xml
!moveit_ros/robot_interaction/package.xml
!moveit_ros/visualization/package.xml
!moveit_ros/planning/package.xml
!moveit_ros/planning_interface/package.xml
!moveit_ros/benchmarks/package.xml
!moveit_ros/moveit_ros/package.xml
!moveit_ros/hybrid_planning/package.xml
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ jobs:
- IMAGE: lyrical-ci-testing
IKFAST_TEST: true
EXTRA_CXX_FLAGS: -Wno-error=deprecated-declarations
CLANG_TIDY: pedantic
- IMAGE: rolling-ci
- IMAGE: lyrical-ci-testing
EXTRA_CXX_FLAGS: -Wno-error=deprecated-declarations
- IMAGE: jazzy-ci
IKFAST_TEST: true
# Moved here because Ubuntu 26.04 has issues compiling with clang++
CLANG_TIDY: pedantic
- IMAGE: humble-ci
env:
# TODO(andyz): When this clang-tidy issue is fixed, remove -Wno-unknown-warning-option
Expand Down Expand Up @@ -176,6 +175,7 @@ jobs:
- name: Generate codecov report
uses: rhaschke/lcov-action@main
if: always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
continue-on-error: true # ignore non-suppressable errors of lcov
with:
docker: ${{ env.DOCKER_IMAGE }}
workdir: ${{ env.BASEDIR }}/target_ws
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/docker.build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build Docker image

on:
workflow_call:
inputs:
image:
required: true
type: string
dockerfile:
required: true
type: string
ros_distro:
required: true
type: string
check_apt_updates:
default: false
type: boolean
full_source_context:
default: false
type: boolean

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
env:
PUSH: ${{ (github.event_name != 'pull_request') && (github.repository == 'moveit/moveit2') }}

steps:
- uses: actions/checkout@v7
- uses: rhaschke/docker-run-action@main
Comment thread
rhaschke marked this conversation as resolved.
name: Check for apt updates
continue-on-error: true
id: apt
if: inputs.check_apt_updates
with:
image: ${{ inputs.image }}
run: |
apt-get update
have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true)
echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
id: setup-buildx
- name: Login to Github Container Registry
if: env.PUSH == 'true'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: env.PUSH == 'true'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Cache
uses: actions/cache@v5
id: cache
with:
path: caches
key: docker-tutorial-cache-${{ inputs.ros_distro }}-${{ hashFiles(inputs.dockerfile) }}
- name: Inject caches into docker
uses: reproducible-containers/buildkit-cache-dance@v3
with:
builder: ${{ steps.setup-buildx.outputs.name }}
cache-dir: caches
dockerfile: ${{ inputs.dockerfile }}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}

- name: Remove .dockerignore
if: inputs.full_source_context
run: rm .dockerignore # enforce full source context
- name: Build and Push
uses: docker/build-push-action@v7
with:
context: .
file: ${{ inputs.dockerfile }}
build-args: ROS_DISTRO=${{ inputs.ros_distro }}
push: ${{ env.PUSH }}
no-cache: ${{ (inputs.check_apt_updates && steps.apt.outputs.no_cache) || github.event_name == 'workflow_dispatch' }}
cache-to: type=gha,mode=max
cache-from: |
type=gha
type=registry,ref=ghcr.io/${{ inputs.image }}
tags: |
${{ inputs.image }}
ghcr.io/${{ inputs.image }}
Loading
Loading