ros-infrastructure / ros_buildfarm

ROS buildfarm based on Docker
Apache License 2.0
77 stars 95 forks source link

Copy rosdoc2 sources into docker image instead of bind-mounting them read-only. #1030

Closed nuclearsandwich closed 4 months ago

nuclearsandwich commented 4 months ago

This is being explored as a fix for #1029. The deprecated option that we were relying on to allow rosdoc2 to be built from a read-only source directory has been removed and I did not find a suitable PEP517 builder with an out-of-tree option.

I probably could have just cut :ro from the docker run invocation and called it a day and I may open that PR to see how it compares. I was trying to avoid modifying the system host's rosdoc2 clone, but given that most of this occurs in the bootstrap task I don't think that these portions of the workspace are preserved at all between job runs so that concern may be groundless.

For this solution, I copied in the source directory first to the docker build context and then into the image itself before installing it with --break-system-packages which seems to be required even when installing into a local user directory.

One thing I don't like about this approach and the mixing of pip and break-system-packages is the fact that dependencies unsatisfied when pip install . ... is invoked will be pulled in from pip along with our local project. I would like to mitigate this with the installation of dependencies from apt before pip is invoked with an option not to also install dependencies. Whether I do this with a full rosdep setup or by eye is TBD.

nuclearsandwich commented 4 months ago

It does indeed fix the test. Now I have to decide if an alternative is preferred.

nuclearsandwich commented 4 months ago

Closing in favor of #1031.