ros-tooling / setup-ros-docker

2 stars 5 forks source link

Prefer system packages over pip packages for Noble #73

Closed christophebedard closed 5 months ago

christophebedard commented 5 months ago

Relates to #67

This is similar to https://github.com/ros-tooling/setup-ros/pull/593. It updates the list of installed packages to use apt only, which matches the more recent installation instructions. I did this for Noble only, since it has the most problems with versions differing a lot between apt and pip, and I didn't want to risk breaking Humble and Iron. Therefore, for Jammy and older (which includes Humble and Iron), nothing should change.

Note that we used to install a lot of packages using pip. Some of those are included in ros-dev-tools with apt, and others were simply changed to be installed with apt instead of pip (like python3-colcon-*).


Steps to test this:

  1. Build Docker image locally
    • In this case, build the Noble ros-rolling-ros-base image
      $ cd ~/setup-ros-docker
      $ docker build --build-arg BASE_IMAGE_NAME=ubuntu --build-arg BASE_IMAGE_TAG=noble --build-arg EXTRA_APT_PACKAGES=ros-rolling-ros-base,ros-rolling-rmw-fastrtps-cpp,ros-rolling-rmw-cyclonedds-cpp,ros-rolling-rmw-connextdds --build-arg VCS_REF=0994551d9859145c82bc2e44a2157f2bfaf55ef3 --build-arg ROS_DISTRO=rolling --tag ghcr.io/christophebedard/setup-ros-docker-ubuntu-noble-ros-rolling-ros-base:pr-73 .
  2. Create personal access token and log into ghcr.io: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic
    $ export CR_PAT=$TOKEN_HERE
    $ echo $CR_PAT | docker login ghcr.io -u $USERNAME --password-stdin
  3. Push Docker image
    $ docker push ghcr.io/christophebedard/setup-ros-docker-ubuntu-noble-ros-rolling-ros-base:pr-73
  4. Find image under https://github.com/$USERNAME?tab=packages and make sure it's public
  5. Create test branch for action-ros-ci and use Docker image ghcr.io/christophebedard/setup-ros-docker-ubuntu-noble-ros-rolling-ros-base:pr-73, then run CI.

Some things to validate:

  1. Check output of pip3 freeze under action-ros-ci. Make sure the following dependencies use the version available from apt (e.g., on Noble), not the latest one from pip: pytest (7.4.4), flake8 (7.0.0), etc.
christophebedard commented 5 months ago

Everything builds fine, but these images are hard to test, because images built in a PR are not pushed anywhere. However, given that the images are kind of broken, we could just try it out.

christophebedard commented 5 months ago

I ended up building images locally, pushing them to my "personal" GitHub container registry, and then testing the images with an action-ros-ci test PR: https://github.com/ros-tooling/action-ros-ci/pull/871. Everything looks good: everything that I expected to pass is passing, and I do see that we're getting versions of dependencies corresponding to the versions from apt. I documented all commands and steps in the PR description above.

I'll merge this and then do Jammy for Humble and Iron in another PR.

clalancette commented 5 months ago

Thank you so much!