Skip to content
Snippets Groups Projects
Unverified Commit 5cfcb35e authored by Carl Delsey's avatar Carl Delsey Committed by GitHub
Browse files

Adding a docker file to help test for missing package.xml dependencies (#606)

* Adding a dockerfile that builds all of ROS2 in a single workspace.

This catches missing dependencies in the package.xml files.

* Adding some comments on choice of docker starting image.

* Adding pre-release checklist.

* Removing unneeded build code

* Update to dashing branches.

* Change name to better reflect reality

* Make full_build dockerfile configurable

* ARG before FROM doesn't propogate to lines after FROM

* Updating docs and addressing review content

* More doc fixes.

* Fixing review comments
parent a892011d
No related branches found
No related tags found
No related merge requests found
......@@ -5,16 +5,6 @@
# docker build -t nav2:latest --build-arg CMAKE_BUILD_TYPE ./
FROM osrf/ros2:nightly
# install ROS2 dependencies
RUN apt-get update && apt-get install -q -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-vcstool \
wget \
&& rm -rf /var/lib/apt/lists/*
# copy ros package repo
ENV NAV2_WS /opt/nav2_ws
RUN mkdir -p $NAV2_WS/src
......
# This dockerfile expects proxies to be set via --build-arg if needed
# It also expects to be contained in the /navigation2 root folder for file copy
#
# Example build command:
# export CMAKE_BUILD_TYPE=Debug
# export BUILD_SYSTEM_TESTS=False
#
# This determines which version of the ROS2 code base to pull
# export ROS2_BRANCH=master
#
# This determines which ros2 docker image to use as a base for getting ros2_dependencies
# The latest (osrf/ros2:nightly) is usually the best choice unless a dependency
# has been removed that an older codebase depends on. In those cases, using
# ros:DISTRO-ros-core would be a good choice where distro is crystal, dashing, etc.
# export ROS2_DOCKER_IMAGE=osrf/ros2:nightly
# docker build -t nav2:full_ros_build --build-arg BUILD_SYSTEM_TESTS
# --build-arg CMAKE_BUILD_TYPE -f Dockerfile.full_ros_build ./
# We're only building on top of a ROS docker image to get the basics
# prerequisites installed such as the apt source, rosdep, etc. We don't want to
# actually use any of the ros dashing packages. Instead we are going to build
# everything from source in one big workspace.
ARG ROS2_DOCKER_BRANCH=osrf/ros2:nightly
FROM $ROS2_DOCKER_BRANCH
# install ROS2 dependencies
RUN apt-get update && apt-get install -q -y \
wget \
libasio-dev \
&& rm -rf /var/lib/apt/lists/*
# setup directory structure
ENV ROS2_WS /opt/ros2_ws
RUN mkdir -p $ROS2_WS/src
WORKDIR $ROS2_WS
# clone ROS 2 packages
ARG ROS2_BRANCH=master
RUN wget https://raw.githubusercontent.com/ros2/ros2/$ROS2_BRANCH/ros2.repos
RUN vcs import src < ros2.repos
# copy nav 2 source code
ENV NAV2_DIR $ROS2_WS/src/navigation2
COPY ./ src/navigation2/
# clone dependency package repos
ENV NAV2_DEPS_DIR $ROS2_WS/src/navigation2_dependencies
RUN mkdir -p $NAV2_DEPS_DIR
RUN vcs import src < $NAV2_DIR/tools/ros2_dependencies.repos
# delete nav2_system_tests/COLCON_IGNORE before running rosdep, otherwise it
# doesn't install nav2_system_tests dependencies.
ARG BUILD_SYSTEM_TESTS=True
RUN if [ "$BUILD_SYSTEM_TESTS" = "True" ] ; then \
rm $NAV2_DIR/nav2_system_tests/COLCON_IGNORE ; \
echo "Building of system tests enabled" ; \
fi
# install package dependencies
RUN apt-get update && \
rosdep install -q -y \
--from-paths \
$ROS2_WS/src \
src \
--ignore-src --skip-keys rti-connext-dds-5.3.1 \
&& rm -rf /var/lib/apt/lists/*
# build entire workspace
ARG CMAKE_BUILD_TYPE=Debug
RUN colcon build \
--symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
......@@ -4,20 +4,13 @@
# Example build command:
# export CMAKE_BUILD_TYPE=Debug
# export BUILD_SYSTEM_TESTS=False
# docker build -t nav2:crystal --build-arg BUILD_SYSTEM_TESTS
# --build-arg CMAKE_BUILD_TYPE -f Dockerfile.crystal ./
# docker build -t nav2:release_branch --build-arg ROS2_BRANCH=dashing \
# --build-arg BUILD_SYSTEM_TESTS # --build-arg CMAKE_BUILD_TYPE \
# -f Dockerfile.release_branch ./
FROM ros:crystal
ARG ROS2_BRANCH=dashing
# install ROS2 dependencies
RUN apt-get update && apt-get install -q -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-vcstool \
wget \
&& rm -rf /var/lib/apt/lists/*
FROM ros:$ROS2_BRANCH
# copy ros package repo
ENV NAV2_WS /opt/nav2_ws
......
# Pre Release Checklist
This documents the steps to be taken prior to making a new release of the
nav2 stack.
## Summary
1. `Ensure all dependencies are listed in the package.xml files` by doing a
build of all of ROS2, dependencies, and navigation 2 in one workspace.
2. `Ensure all dependencies are released.` by using rosdep to pull in dependencies instead of building them ourselves.
3. `Ensure the test suite passes`
## Detailed Steps
### Ensure all dependencies are listed in the package.xml files
We want to ensure that every package has a complete list of its dependencies
in the `package.xml` file. This can be done by not sourcing any ros `setup.bash` files. Instead we need to build everything as one big repo.
There is a docker file to do that, so run
```bash
sudo docker build -t nav2:full_ros_build --build-arg ROS2_BRANCH=dashing --build-arg http_proxy=http://myproxy.example.com:80 --build-arg https_proxy=http://myproxy.example.com:80 -f Dockerfile.full_ros_build ./
```
ROS2_BRANCH should be the release you are targeting or just `master` if you want
to compare against ROS2 master.
### Ensure all dependencies are released.
We want to ensure the correct version of all our dependencies have been released
to the branch we are targeting. To do that, we skip the
`ros2_dependencies.repos` install step and rely solely on rosdep to install
everything.
There is a dockerfile to do that as well, so run
```bash
sudo docker build -t nav2:rosdep_only_build --build-arg ROS2_BRANCH=dashing --build-arg http_proxy=http://myproxy.example.com:80 --build-arg https_proxy=http://myproxy.example.com:80 -f Dockerfile.release_branch ./
```
As before, ROS2_BRANCH is the branch you are targeting. In this case, there is
no master option. We can only run this dockerfile against a set of released
packages.
### Ensure the test suite passes
Ensure the test suite passes in one of the docker images you just built.
#### Crystal
For the `crystal` release, run
```bash
sudo docker run nav2:crystal colcon test
```
#### Dashing and newer
For newer releases, run
```bash
sudo docker run nav2:crystal src/navigation2/tools/run_test_suite.bash
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment