-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker cleanup #1946
Docker cleanup #1946
Conversation
60c6976
to
856c638
Compare
7debdcb
to
61dd64b
Compare
c06974e
to
6e79278
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filiperinaldi Thanks for the PR!
@esteve @gbiggs @amc-nu I have been involved in the development of this PR, hence I'd like for at least one of you to have a look at it before merging. The changes on this PR are also needed for #2042
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filiperinaldi @sgermanserrano Thanks for all the effort put on this PR. Looks great.
I have some questions/observations:
- Is there any recommended nvidia-docker version?
- I would suggest adding
--rm
to thedocker build
in the scripts. - After pulling the branch and running
./run.sh
I get a message telling me the imageautoware/autoware:latest-kinetic-cuda
is not available. Do you plan to upload it to docker hub before or after merging this PR? - I'm getting an error when building the CUDA version.
liblibdpm_ttic.so: undefined reference to 'cuMemFree_v2'
(Plus other undefined references when linking that same file). I think this PR might be missing Fix/colcon build #2000 . Can you confirm? If that's the case, it will be fixed after merging, so please ignore this point. - CPU version builds flawlessly. However, seems it still doesn't contain [fix] Install commands for all the packages #1861 Fix install directives #1990 it is also pointing to
devel
space. I wasn't able to run anything inside the container.
As a note @sgermanserrano @kfunaoka we'll need to update the Wiki. Maybe we need an issue and add it to the release todo list.
docker/generic/Dockerfile
Outdated
RUN su -c "bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \ | ||
cd /home/$USERNAME/Autoware/ros; \ | ||
./colcon_release'" $USERNAME | ||
RUN echo "source /home/$USERNAME/Autoware/ros/devel/setup.bash" >> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here points to devel
rm -rf /var/lib/apt/lists/* | ||
COPY --from=nvidia/opengl:1.0-glvnd-runtime-ubuntu16.04 \ | ||
/usr/local/lib/x86_64-linux-gnu \ | ||
/usr/lib/x86_64-linux-gnu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change to /usr/lib
? /usr/local/lib
makes more sense IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@esteve that change was made to address a duplication problem: filiperinaldi#10
docker/generic/Dockerfile.cuda
Outdated
/usr/local/share/glvnd/egl_vendor.d/10_nvidia.json | ||
RUN echo '/usr/local/lib/x86_64-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && \ | ||
ldconfig && \ | ||
echo '/usr/$LIB/libGL.so.1' >> /etc/ld.so.preload && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the value of $LIB
? It doesn't seem to be set anywhere.
Unify docker support with a new (and more generic) set of docker files. Two main images are created: - Base image containing an Ubuntu installation with all dependencies - Build image containing a pre-built Autoware When Cuda support is enabled, there is a further Base+Cuda support image. These Dockerfiles can be used for both AArch64 and x86_64 images. Co-authored-by: Filipe Rinaldi <filipe.rinaldi@arm.com>
5d265ba
to
0b014cf
Compare
docker/generic/Dockerfile.base
Outdated
COPY ./ /tmp/Autoware | ||
RUN apt-get update && \ | ||
apt-get install -y ros-$ROS_DISTRO-desktop-full && \ | ||
rosdep install -y --from-paths /tmp/Autoware/ros/src --ignore-src && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd advise against using rosdep here as it prevents Docker from using the cache effectively. There's also no trace of what packages are being installed, and more importantly, given that ROS1 does not guarantee ABI compatibility, any ROS package installed afterwards may cause a segfault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous Dockerfile had a list of ROS packages being installed. They were not comprehensive and were very likely to be out of sync as the dependencies change from version to version.
The rationale for doing it like this was that for a given version of Autoware, its corresponding Docker base image will have the dependencies pre-installed. If you are using this based to develop new features, then you will have to manually run rosdep again to complement the new dependencies required.
The effect on Docker's cache could be minimised with a list, but the cache would still be discarded eventually when the list gets updated. It is a trade-off between getting the dependencies automatically sorted out (instead of someone manually finding them out and updating the Dockerfile) vs increasing the usage of cache.
What do you think would be a better balance? Perhaps splitting ros-desktop-full and a few other basic ROS packages out into their own RUN command to at least re-use that layer? Move the rosdep step to be part of the build steps?
I'm not sure I understand the compatibility issue. Aren't these all deb packages which are meant to be compatible on the same distro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think would be a better balance? Perhaps splitting ros-desktop-full and a few other basic ROS packages out into their own RUN command to at least re-use that layer? Move the rosdep step to be part of the build steps?
I think having a list of known packages and then running rosdep install is a good compromise. OSRF has the process entirely automated in their images, perhaps in the future we could just have a script that runs rosdep install and if there are any new packages, add them to Dockerfile and commit the changes.
I'm not sure I understand the compatibility issue. Aren't these all deb packages which are meant to be compatible on the same distro?
Unfortunately not. If I have packages installed from a previous sync and I install new ones, they are most certainly to crash because they are not ABI-compatible. ROS releases must be upgraded/installed all at once, you can't mix packages from different syncs, even if they are from the same distribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a correction, it's not certain as I stated, but there's a chance that the packages are incompatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I'll add the version to the README.md. |
Make it explicit in the documentation that we recommend NVIDIA Docker v2.
405250d
to
c007199
Compare
Done. |
|
||
ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs | ||
|
||
# Support for Nvidia docker v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! This is where I want to add.
Good Job. You have done something I want to. I want to add OpenGL support to the dockerfile. But I found you have done it. Thank you very much. Mouri |
I think the changes look overall, but unfortunately I won't be able to review it before 1.12, so I'm dismising my review
* Docker: Add truly generic docker support Unify docker support with a new (and more generic) set of docker files. Two main images are created: - Base image containing an Ubuntu installation with all dependencies - Build image containing a pre-built Autoware When Cuda support is enabled, there is a further Base+Cuda support image. These Dockerfiles can be used for both AArch64 and x86_64 images. Co-authored-by: Filipe Rinaldi <filipe.rinaldi@arm.com> * ros/.gitignore: Ignore log and coverage folders * Autoware built using colcon instead of catkin * Install ROS dependencies via file * Docker: Recommend NVIDIA Docker version 2 Make it explicit in the documentation that we recommend NVIDIA Docker v2.
Status
PRODUCTION / DEVELOPMENT
Description
See autowarefoundation/autoware_ai#530
Related PRs
None.
Todos
Tests
Steps to Test or Reproduce