Skip to content

Add docker file that builds against crystal release for use in testing the crystal-devel branch#562

Merged
6 commits merged intomasterfrom
unknown repository
Feb 19, 2019
Merged

Add docker file that builds against crystal release for use in testing the crystal-devel branch#562
6 commits merged intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Feb 12, 2019

Basic Info

Info Please fill out this column
Ticket(s) this addresses related to #421
Primary OS tested on Ubuntu
Robotic platform tested on NA

Description of contribution in a few bullet points

  • This new docker file builds against the Cyrstal release instead of ROS2 master, and relies entirely on rosdep to bring in dependencies. It is intended to be used to test the crystal-devel branch, and maybe make a crystal dockerhub image.

@ghost ghost requested review from mhpanah, orduno and ruffsl February 12, 2019 19:27
@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 12, 2019

Oh. I should note that is currently doesn't work on either master or crystal-devel. It doesn't work on master because master has the new NodeOptions api change. It doesn't work on crystal-devel because the that branch doesn't have the COLCON_IGNORE file in nav2_system_tests.

My plan is to merge everything up to the API breaking change from yesterday over to crystal-devel and then test with this dockerfile.

Carl Delsey and others added 4 commits February 12, 2019 13:28
Move ARG insertion after rosdep to preserve more caching layers
Seems necessary when sourcing a colcon workspace that was first initialized using the debian ros2 install,
as opposed to parent workspace installed from the ros2 nightly fat archives.
Copy link
Copy Markdown
Member

@ruffsl ruffsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some changes to the ARGs and entypoint

Also
 * fixing a syntax error on if statement
 * moving rm nav2_system_test/COLCON_IGNORE before rosdep call
WORKDIR $NAV2_WS/src
COPY ./ navigation2/

# delete nav2_system_tests/COLCON_IGNORE before running rosdep, otherwise it
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? I've never known rosdep to care what a COLCON_IGNORE file is or what it means. I think it just recurses the --from-paths looking for package.xml files. Our CI Dockerfile is setup similarly.

Moving this arg and logic to before the rosdep install would needlessly break the build caching layers when switching system tests on and off.

Searching the rosdep github repo for any mentioning of COLCON_IGNORE returns nothing:
https://github.com/ros-infrastructure/rosdep/search?q=COLCON_IGNORE&unscoped_q=COLCON_IGNORE

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that the build breaks if the rm is done after the rosdep call. It breaks because it can't find the gazebo_ros_pkgs which are the additional dependency that the nav2_system_test package brings in.

I'll admit that I'm assuming the underlying root cause.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a minimal docker to experiment with.

FROM ros:crystal
# 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
WORKDIR $NAV2_WS/src
COPY ./ navigation2/

With the COLCON_IGNORE file in place, I get the following output from rosdep

> rosdep install -s -q -y --from-paths src --ignore-src
#[apt] Installation commands:
  apt-get install -y -qq libboost-all-dev
  apt-get install -y -qq ros-crystal-launch-testing
  apt-get install -y -qq ros-crystal-behaviortree-cpp
  apt-get install -y -qq libbullet-dev
  apt-get install -y -qq libsdl1.2-dev
  apt-get install -y -qq libsdl-image1.2-dev
  apt-get install -y -qq ros-crystal-yaml-cpp-vendor
  apt-get install -y -qq ros-crystal-map-msgs
  apt-get install -y -qq ros-crystal-tf2-sensor-msgs
  apt-get install -y -qq libpcl-dev
  apt-get install -y -qq ros-crystal-laser-geometry
  apt-get install -y -qq ros-crystal-angles

If I delete the COLCON_IGNORE file

> rosdep install -s -q -y --from-paths src --ignore-src
#[apt] Installation commands:
  apt-get install -y -qq ros-crystal-launch-testing
  apt-get install -y -qq ros-crystal-gazebo-ros-pkgs
  apt-get install -y -qq ros-crystal-angles
  apt-get install -y -qq ros-crystal-behaviortree-cpp
  apt-get install -y -qq libboost-all-dev
  apt-get install -y -qq ros-crystal-map-msgs
  apt-get install -y -qq ros-crystal-tf2-sensor-msgs
  apt-get install -y -qq libpcl-dev
  apt-get install -y -qq ros-crystal-laser-geometry
  apt-get install -y -qq libbullet-dev
  apt-get install -y -qq libsdl1.2-dev
  apt-get install -y -qq libsdl-image1.2-dev
  apt-get install -y -qq ros-crystal-yaml-cpp-vendor

You'll see ros-crystal-gazebo-ros-pkgs is missing from the first list, so rosdep results in different action depending on whether the file is there or not. How it does that without ever actually referencing the file, I don't know.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it looks like rosdep is using catkin's find_packages to loop search for packages, and thus the transitive ignore.

https://github.com/ros-infrastructure/rosdep/blob/e5d6772686874165cf1ef96d0e6b64ff63076af1/src/rosdep2/catkin_packages.py#L7

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 15, 2019

I believe the circle CI build failure is because the branch is off an old version of master. I'll rebase and verify the build after the review is done to avoid messing up the history.

@ruffsl
Copy link
Copy Markdown
Member

ruffsl commented Feb 16, 2019

I've been thinking and realized rather than creating a new dockerfile for each release, we could template a dockerfile for building against any given release, e.g by using ARG in the Dockerfile's FROM:

ARG FROM_IMAGE=ros
FROM $FROM_IMAGE
...

https://www.jeffgeerling.com/blog/2017/use-arg-dockerfile-dynamic-image-specification

ROS_DISTRO=crystal
docker build \
    --tag rosplanning/navigation2:${ROS_DISTRO}-devel \
    --build-arg ros:${ROS_DISTRO}

We then add custom build phase hooks to override build command in the automated Docker Hub repo so that it uses the correct base image when build a docker image tag for each added devel branch.

/hooks/build

#!/bin/bash
ROS_DISTRO=${SOURCE_BRANCH%"-devel"}
docker build \
    --tag rosplanning/navigation2:${SOURCE_BRANCH} \
    --build-arg ros:${ROS_DISTRO}

https://docs.docker.com/docker-hub/builds/advanced/#override-build-test-or-push-commands

I'll work up a separate PR for this.

ruffsl added a commit to ruffsl/navigation2 that referenced this pull request Feb 16, 2019
@ruffsl
Copy link
Copy Markdown
Member

ruffsl commented Feb 16, 2019

I've asked the circleci folks on a issue of perhaps a missing feature:
https://discuss.circleci.com/t/conditioning-docker-image-via-base-branch-name-from-pr/28426

Copy link
Copy Markdown
Contributor

@orduno orduno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 19, 2019

@ruffsl Lacking direct support from CircleCI, it looks like we can get the information from the Github API if we can get at least the PR number from CircleCI. ie. For this PR, this command line seems to do the trick
curl -s https://api.github.com/repos/ros-planning/navigation2/pulls/562 | python3 -c "import json; import sys; pr=json.load(sys.stdin); print(pr['base']['label'])"

@ghost ghost merged commit 4a17d4a into ros-navigation:master Feb 19, 2019
mini-1235 pushed a commit to mini-1235/navigation2 that referenced this pull request Feb 5, 2025
…ts in the MPPI controller (ros-navigation#562)

* Update Migration guide

Signed-off-by: Ayush Singh <64409716+Ayush1285@users.noreply.github.com>

* Update configuration guide for MPPI

Signed-off-by: Ayush Singh <64409716+Ayush1285@users.noreply.github.com>

---------

Signed-off-by: Ayush Singh <64409716+Ayush1285@users.noreply.github.com>
Forsyth-Creations pushed a commit to Forsyth-Creations/navigation2 that referenced this pull request Feb 19, 2025
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants