Skip to content

Commit

Permalink
Run CI with Dockerfiles for Foxy and Dashing.
Browse files Browse the repository at this point in the history
These are stubs at the moment and only build cartographer,
but can be easily extended.

Signed-off-by: Michael Grupp <[email protected]>
  • Loading branch information
MichaelGrupp committed Nov 2, 2020
1 parent 70b03e4 commit 51e6934
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ cache:
- /home/travis/docker/

env:
- ROS_RELEASE=kinetic DOCKER_CACHE_FILE=/home/travis/docker/kinetic-cache.tar.gz
- ROS_RELEASE=melodic DOCKER_CACHE_FILE=/home/travis/docker/melodic-cache.tar.gz
- ROS_RELEASE=noetic DOCKER_CACHE_FILE=/home/travis/docker/noetic-cache.tar.gz
- ROS_RELEASE=dashing DOCKER_CACHE_FILE=/home/travis/docker/dashing-cache.tar.gz
- ROS_RELEASE=foxy DOCKER_CACHE_FILE=/home/travis/docker/foxy-cache.tar.gz

before_install:
# $GITHUB_TOKEN must be a valid GitHub access token without access rights (https://github.com/settings/tokens).
Expand Down
60 changes: 60 additions & 0 deletions Dockerfile.dashing
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2020 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM osrf/ros:dashing-desktop

ARG CARTOGRAPHER_VERSION=master

# We require a GitHub access token to be passed.
ARG github_token

# Bionic's base image doesn't ship with sudo and wstool.
RUN apt-get update && apt-get install -y sudo python3-wstool

# First, we invalidate the entire cache if cartographer-project/cartographer has
# changed. This file's content changes whenever master changes. See:
# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
ADD https://api.github.com/repos/cartographer-project/cartographer/git/refs/heads/master?access_token=$github_token \
cartographer_ros/cartographer_version.json

# wstool needs the updated rosinstall file to clone the correct repos.
COPY cartographer_ros.rosinstall cartographer_ros/
COPY scripts/prepare_dev_workspace.sh cartographer_ros/scripts/
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
cartographer_ros/scripts/prepare_dev_workspace.sh

# rosdep needs the updated package.xml files to install the correct debs.
COPY cartographer_ros/package.xml dev_ws/src/cartographer_ros/cartographer_ros/
COPY cartographer_ros_msgs/package.xml dev_ws/src/cartographer_ros/cartographer_ros_msgs/
COPY cartographer_rviz/package.xml dev_ws/src/cartographer_ros/cartographer_rviz/
COPY scripts/install_debs.sh cartographer_ros/scripts/
RUN cartographer_ros/scripts/install_debs.sh

# Install Abseil.
RUN /dev_ws/src/cartographer/scripts/install_abseil.sh

# Build, install, and test all packages individually to allow caching. The
# ordering of these steps must match the topological package ordering.
COPY scripts/install_and_test.sh cartographer_ros/scripts/

RUN cartographer_ros/scripts/install_and_test.sh cartographer

# TODO(MichaelGrupp): add all build steps for ROS2.
COPY cartographer_ros_msgs dev_ws/src/cartographer_ros/cartographer_ros_msgs
RUN cartographer_ros/scripts/install_and_test.sh cartographer_ros_msgs

RUN rm -rf /var/lib/apt/lists/*
# A BTRFS bug may prevent us from cleaning up these directories.
# https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_cannot_delete_an_empty_directory
RUN rm -rf cartographer_ros || true
60 changes: 60 additions & 0 deletions Dockerfile.foxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2020 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM osrf/ros:foxy-desktop

ARG CARTOGRAPHER_VERSION=master

# We require a GitHub access token to be passed.
ARG github_token

# Bionic's base image doesn't ship with sudo and wstool.
RUN apt-get update && apt-get install -y sudo python3-wstool

# First, we invalidate the entire cache if cartographer-project/cartographer has
# changed. This file's content changes whenever master changes. See:
# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
ADD https://api.github.com/repos/cartographer-project/cartographer/git/refs/heads/master?access_token=$github_token \
cartographer_ros/cartographer_version.json

# wstool needs the updated rosinstall file to clone the correct repos.
COPY cartographer_ros.rosinstall cartographer_ros/
COPY scripts/prepare_dev_workspace.sh cartographer_ros/scripts/
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
cartographer_ros/scripts/prepare_dev_workspace.sh

# rosdep needs the updated package.xml files to install the correct debs.
COPY cartographer_ros/package.xml dev_ws/src/cartographer_ros/cartographer_ros/
COPY cartographer_ros_msgs/package.xml dev_ws/src/cartographer_ros/cartographer_ros_msgs/
COPY cartographer_rviz/package.xml dev_ws/src/cartographer_ros/cartographer_rviz/
COPY scripts/install_debs.sh cartographer_ros/scripts/
RUN cartographer_ros/scripts/install_debs.sh

# Install Abseil.
RUN /dev_ws/src/cartographer/scripts/install_abseil.sh

# Build, install, and test all packages individually to allow caching. The
# ordering of these steps must match the topological package ordering.
COPY scripts/install_and_test.sh cartographer_ros/scripts/

RUN cartographer_ros/scripts/install_and_test.sh cartographer

# TODO(MichaelGrupp): add all build steps for ROS2.
COPY cartographer_ros_msgs dev_ws/src/cartographer_ros/cartographer_ros_msgs
RUN cartographer_ros/scripts/install_and_test.sh cartographer_ros_msgs

RUN rm -rf /var/lib/apt/lists/*
# A BTRFS bug may prevent us from cleaning up these directories.
# https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_cannot_delete_an_empty_directory
RUN rm -rf cartographer_ros || true

0 comments on commit 51e6934

Please sign in to comment.