Skip to content

Support for CI on top of ros2 nightly images#454

Merged
mathias-luedtke merged 2 commits intoros-industrial:masterfrom
mikaelarguedas:nightly_foxy
Dec 21, 2019
Merged

Support for CI on top of ros2 nightly images#454
mathias-luedtke merged 2 commits intoros-industrial:masterfrom
mikaelarguedas:nightly_foxy

Conversation

@mikaelarguedas
Copy link
Copy Markdown
Contributor

Hi all, I created a way simpler and stupider version of ici for ROS 2 a while back (ros2ci). Main purpose was to be able to run CI on both released ROS 2 distros and ROS 2 nightly builds to catch breakage of packages against upcoming versions of ROS 2.

Now that ICI supports colcon + ROS 2 (hat tip @ipa-mdl 👍🎉), I'd like to integrate the support for nightly builds instead of maintaining something on the side.

I'm opening this to start discussion of supporting nightly ROS 2 CI in ICI.
Feature description:

  • run jobs based on OSRF's nightly ros2 docker images (Linux only)
  • build a "middle-lay" with missing dependencies
  • build and test packages on top of it

Is it a use case ICI would be interested in supporting?


Content of this PR:

Users wanting to run CI based on nightly builds could modify their travis config as follows:

 env:
   matrix:
     - ROS_DISTRO="dashing" ROS_REPO=main
     - ROS_DISTRO="eloquent" ROS_REPO=main
+    - DOCKER_IMAGE="osrf/ros2:nightly" UPSTREAM_WORKSPACE="additional_repos.repos"
  • osrf/ros2:nightly being the docker image provided daily by osrf with the content of the latest nightly build
  • additional_repos.repos the list of upstream packages needed to compile the repository that are NOT part of the nightly image

Example of repo using this and travis job

Copy link
Copy Markdown
Member

@mathias-luedtke mathias-luedtke left a comment

Choose a reason for hiding this comment

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

Thank you very much!
All in all I don't see any problem with merging this 👍

However, I'd like to discuss these two items first.

;;
"foxy")
ros2_defaults "bionic"
DEFAULT_DOCKER_IMAGE=
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.

Why not

Suggested change
DEFAULT_DOCKER_IMAGE=
DEFAULT_DOCKER_IMAGE=osrf/ros2:nightly

This way, one can specify DOCKER_IMAGE=osrf/ros2:nightly (for rolling nightly version) or ROS_DISTRO=foxy (for next release only)

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.

Or DOCKER_IMAGE=osrf/ros2:nightly for now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This way, one can specify DOCKER_IMAGE=osrf/ros2:nightly (for rolling nightly version) or ROS_DISTRO=foxy (for next release only)

I am not sure I understood what the intended result is from these 2 different configurations.
What are the 2 scenarios we are trying to cover with this change?
What would the .travis.yml line would look like for each?

Or DOCKER_IMAGE=osrf/ros2:nightly for now?

This will work more consistently than DEFAULT_DOCKER_IMAGE=osrf/ros2:nightly as the DEFAULT_DOCKER_IMAGE gets overwritten for some ROS_REPO values (including the default one)


A few hidden assumptions / expectations from my part that came up:

  • Clear at first glance
    It should be clear to user which job is a nightly build vs a build against a released distribution
    in ros2ci it was done by naming the job nightly
    - env: JOB_TYPE=nightly
      script:
      - cp additional_repos.repos .ros2ci/
      - .ros2ci/travis.bash $JOB_TYPE

Not sure what would be the best for ICI. Maybe having the DOCKER_IMAGE=osrf/ros2:nightly at the beginning of the line is enough 🤷‍♂️

  • Minimal effort to set up
    Should be a one liner for user to set up in their CI system e.g.:
 env:
   matrix:
     - ROS_DISTRO="dashing" ROS_REPO=main
     - ROS_DISTRO="eloquent" ROS_REPO=main
+    - DOCKER_IMAGE="osrf/ros2:nightly" UPSTREAM_WORKSPACE="additional_repos.repos"
  • Zero maintenance from users
    Once added the line should never need to be updated to keep tracking "ROS 2 master"
    • line should be ROS_DISTRO-free
  • Clearly separated from release jobs
    The job defined will never track a released ROS_DISTRO from debians, if users want to add a job for a new distro they should
 env:
   matrix:
     - ROS_DISTRO="dashing" ROS_REPO=main
     - ROS_DISTRO="eloquent" ROS_REPO=main
+    - ROS_DISTRO="foxy" ROS_REPO=main
     - DOCKER_IMAGE="osrf/ros2:nightly" UPSTREAM_WORKSPACE="additional_repos.repos"

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.

I am not sure I understood what the intended result is from these 2 different configurations.

  1. test against night build (DOCKER_IMAGE="osrf/ros2:nightly" UPSTREAM_WORKSPACE="additional_repos.repos)
  2. test against ROS2 foxy (ROS_DISTRO="foxy" ROS_REPO=main). Could point to the nightly build right now and can be switched to the testing/main repo as they become available.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for clarifying 👍

Yes it should work.
Users with all their dependencies in ros2.repos will be fine, the ones with extra dependencies will need to remove the UPSTREAM_WORKSPACE once the packages are available in the distro

ROS_DISTRO="foxy" ROS_REPO=main UPSTREAM_WORKSPACE="additional_repos.repos"

to

ROS_DISTRO="foxy" ROS_REPO=main

fi
set -o pipefail # fail if rosdep install fails
ROS_PACKAGE_PATH=$cmake_prefix_path ici_exec_in_workspace "$extend" "." rosdep install "${rosdep_opts[@]}" | { grep "executing command" || true; }
ROS_PACKAGE_PATH=$cmake_prefix_path:${ROS_PACKAGE_PATH} ici_exec_in_workspace "$extend" "." rosdep install "${rosdep_opts[@]}" | { grep "executing command" || true; }
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.

${ROS_PACKAGE_PATH} should be empty at this point

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the case of the nightly image it is not empty osrf/docker_images#328.
But it is a hack because of a rosdep issue, so I dont think this commit should be merged in industrial_ci, this is only propagating the workaround to have a working example for this discussion

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.

I see. Shouldn't this path be included in CMAKE_PREFIX_PATH? I stumbled upon this issue as well and CMAKE_PREFIX_PATH did the trick in my tests. However, I haven't tested it against the nightly build yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm I think rosdep does only look in ROS_PACKAGE_PATH and AMENT_PREFIX_PATH.
If all the packages in the nightly archive were registered in the ament index it would work (ongoing discussion at ros2/tinyxml_vendor#14)

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.

hmm I think rosdep does only look in ROS_PACKAGE_PATH

That's why I set it to CMAKE_PREFIX_PATH, this works (or worked?) for catkin and ament :)

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.

only use AMENT_PREFIX_PATH

catkin packages do not set AMENT_PREFIX_PATH (?)

So the ROS2 docker images (e.g. ros:dashing) do not set CMAKE_PREFIX_PATH

I know, and they should not set it. I am reading it from setup.bash
This is a temporary hack until rosdep can crawl the ament index.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

catkin packages do not set AMENT_PREFIX_PATH (?)

not that I know of. Even if a tool build tool like colcon did it, I wouldn't expect catkin packages to register themselves in the index.

This is a temporary hack until rosdep can crawl the ament index.

This is now a thing ros-infrastructure/rosdep#699
The nightly image sets the ROS_PACKAGE_PATH only because rosdep cannot find non-ament packages like ros2/tinyxml_vendor#14

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.

TL;DR this line can stay as is if we remove the COLCON_IGNORE

I just tested it, the COLCON_IGNORE is breaking the work-around.

If rosdep now support AMENT_PREFIX_PATH, then we don't need to set ROS_PACKAGE_PATH.

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.

#456 now reverts the work-around properly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just tested it, the COLCON_IGNORE is breaking the work-around.

In what scenario does it break? Can you clarify how it breaks?

If removing it has a negative effect, I'll reject osrf/docker_images#345

Copy link
Copy Markdown
Member

@mathias-luedtke mathias-luedtke left a comment

Choose a reason for hiding this comment

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

Please rebase this to #456 and commit my suggestion.
If the new version still passes your tests, I will merge both PRs.

As a follow-up, I'd like to rewrite env.sh to allow arbitrary Docker images.
For this to work, the variables have to be parsed in the correct order/phase and not twice as of now.

@mikaelarguedas
Copy link
Copy Markdown
Contributor Author

Please rebase this to #456 and commit my suggestion.
If the new version still passes your tests, I will merge both PRs.

Haven't tried this yet but I expect #456 to break the use of nightly images.
If the nightly images set the ROS_PACKAGE_PATH it's because some packages like ros2/tinyxml_vendor#14 cannot be found using the AMENT_PREFIX_PATH approach at the moment

So for the nightly builds to work we would have to keep populating the ROS_PACKAGE_PATH here for now

@mathias-luedtke
Copy link
Copy Markdown
Member

Haven't tried this yet but I expect #456 to break the use of nightly images.

I tested it locally with https://github.com/Karsten1987/confbot_robot/blob/ca85f937cf51b597477837c4a636dad88fc39a20/.travis.yml

It seems to work (all tests pass), but it displays a lot of connext-related errors/warnings.

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
@mikaelarguedas
Copy link
Copy Markdown
Contributor Author

It seems to work (all tests pass), but it displays a lot of connext-related errors/warnings.

Oh yeah, it will work because the ROS_PACKAGE_PATH work-around hard coded in the docker image is not being overwritten anymore 👍

I'll rebase on #456 and force-push on this branch

@mikaelarguedas
Copy link
Copy Markdown
Contributor Author

but it displays a lot of connext-related errors/warnings.

Yeah this is another issue with the OR nightly archive, unrelated to this PR

Copy link
Copy Markdown
Member

@mathias-luedtke mathias-luedtke left a comment

Choose a reason for hiding this comment

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

Oh yeah, it will work because the ROS_PACKAGE_PATH work-around hard coded in the docker image is not being overwritten anymore

Exactly :)


I am not sure if we should list foxy in the list of supported distros.

@mikaelarguedas
Copy link
Copy Markdown
Contributor Author

I am not sure if we should list foxy in the list of supported distros.

Not sure either. As long as Foxy is not released (or in beta phase) the statement would be misleading as testing against the last nightly != testing against officially released Foxy...

An alternative is to add "ROS 2 nightly builds" to the list of supported distros. It does not qualify as a distro per se but would be more accurate.
I you go that route, linking to an example of usage would be beneficial as it differs from other distros

@mathias-luedtke
Copy link
Copy Markdown
Member

An alternative is to add "ROS 2 nightly builds" to the list of supported distros

I'd like to support something like ROS_DISTRO=nightly.

I you go that route, linking to an example of usage would be beneficial as it differs from other distros

For now we should just merge it as-is.
We can update the documentation, once we have tested it further.


Please let me know if your test repo works with this version. I will postpone the merge until then.

@mikaelarguedas
Copy link
Copy Markdown
Contributor Author

I'd like to support something like ROS_DISTRO=nightly.

Yeah me too, there were some blockers on the docker image side for a while. It may be possible now, would need to check again.

Please let me know if your test repo works with this version.

It works for me!
Thanks for the support on getting this PR ready for merge 👍

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.

3 participants