Repository navigation
Conversation
| # setup environment | ||
| ENV LANG C.UTF-8 | ||
| ENV LC_ALL C.UTF-8 | ||
|
|
There was a problem hiding this comment.
everything below here should be kept for proper behavior of moveit_ci and to improve caching / Travis build speed.
There was a problem hiding this comment.
No need for this. moveit/moveit:melodic-ci-shadow-fixed derives from moveit/moveit:melodic-ci that already defines all this. Here we only need to update the packages to ros-shadow-fixed.
There was a problem hiding this comment.
the problem you're missing is that i spent a lot of time optimizing these docker images for the unified moveit repo so that travis doesn't time out. i have since then asked travis to give us extra time for free and they did, but im worries building CIs on top of each other too much will make them very large downloads. each RUN command is its own virtual machine layer, essentially
| rm -rf src/ && \ | ||
| # Clear apt-cache to reduce image size | ||
| rm -rf /var/lib/apt/lists/* | ||
| # Download moveit source so that we can get necessary dependencies |
There was a problem hiding this comment.
having separate RUN commands makes the docker way more bloated and is not best practice - why did you change all of this?
There was a problem hiding this comment.
Because it is more readable. All the ros docker containers proceed in this fashion too.
There was a problem hiding this comment.
There was a problem hiding this comment.
@rhaschke wrote:
Looks like best practice has changed
I don't think so. The page you link essentially still says that RUN statements will create new layers. The block removed was a single RUN. There are now 9 of those, compared to a single one previously.
We're not using multi-stage builds afaik, so that point also doesn't apply here.
There was a problem hiding this comment.
Yeah, you are probably right. I was mislead by ros-core-melodic's docker file.
Changed back to a single RUN command.
There was a problem hiding this comment.
I've always wondered why OR does it that way. It's a minimal set of commands though, so perhaps they just didn't bother.
One advantage of having many separate RUN statements is that Docker's caching mechanism can be exploited more easily. If you change a single char in the big RUN statement we have here, the cache for that layer is invalidated and the entire command run again. With multiple statements changes have less of an effect.
There was a problem hiding this comment.
OSRF carefully ensured that each apt call also clears apt-cache. This ensures that each layer is only incrementally adding, but never removing stuff, where the latter indeed would increase memory footprint.
In our case we need to clone MoveIt sources to install its dependencies. However these resources are removed in the end, which indeed calls for a single RUN command encompassing both steps.
| cd .. && \ | ||
| rm -rf src/ && \ | ||
| # Clear apt-cache to reduce image size | ||
| rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
this line is particularly important
There was a problem hiding this comment.
And it is still there!
There was a problem hiding this comment.
yes but it doesn't do what its intended to do if you separate it into its own RUN command - there are no memory savings. please reference how OSRF does their docker containers as third-party examples
There was a problem hiding this comment.
Got it and changed already.
| RUN cd .. && rm -rf src/ | ||
|
|
||
| # Clear apt-cache to reduce image size | ||
| RUN rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
this does not work as explained above
There was a problem hiding this comment.
It works perfectly as proven by Travis and locally.
| FROM ros:melodic-ros-base | ||
| MAINTAINER Dave Coleman [email protected] | ||
|
|
||
| # Commands are combined in single RUN statement with "lists" folder removal to reduce image size |
There was a problem hiding this comment.
can we keep this comment please?
| matrix: | ||
| - ROS_DISTRO=kinetic ROS_REPO=ros TEST=clang-format | ||
| - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=moveit.rosinstall | ||
| - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=moveit.rosinstall |
There was a problem hiding this comment.
in our last maintainer meeting we said we wanted to keep the melodic branch buildable on 16.04 and kinetic for the foreseeable future. do you think this is still feasible? if so, i'd like to keep these kinetic builds here
There was a problem hiding this comment.
As there are incompatible API changes in OMPL and KDL, we would need to resort to #ifdefs.
I think that should be possible.
There was a problem hiding this comment.
Currently, Kinetic builds are blocked by: ros/geometry2#292 (comment).
There was a problem hiding this comment.
If #830 is merged, it depends on 3 upstream ROS package API breakages:
ros/geometry#163
ros/geometry2#292
ros/geometry2#294
ros-visualization/rviz#1236
I doubt all of these breaks will/should be backported, which would force us to choose between tf2 migration or keeping things buildable on both kinetic & melodic.
There was a problem hiding this comment.
It would be a pity in both cases. I asked ROS maintainers to consider all of them for merging in ros/geometry2#292 (comment).
There was a problem hiding this comment.
If we can't support Melodic on 16.04 i understand, but that will sure slow down adoption I imagine.
| - git: | ||
| local-name: moveit_visual_tools | ||
| uri: https://github.com/ros-planning/moveit_visual_tools.git | ||
| version: melodic-devel |
There was a problem hiding this comment.
why? of course im biased but i think this is valuable to keep here
There was a problem hiding this comment.
This was neccessary (for now) as you? didn't released graph_msgs yet.
There was a problem hiding this comment.
makes sense. can you just comment it out then?
im having @davesteffen get up to speed on releasing ROS packages with bloom, and this is first on his list but he's still learning
There was a problem hiding this comment.
Yes, I will comment-out only.
| void ChainIkSolverPos_NR_JL_Mimic::updateInternalDataStructures() | ||
| { | ||
| // TODO: move (re)allocation of any internal data structures here | ||
| // to react to changes in chain |
There was a problem hiding this comment.
is this really required for the melodic build?
There was a problem hiding this comment.
Yes, it is a new abstract function in KDL 1.4, which makes the compiler complain about instantiating abstract classes...
5737f31 to
fa456dd
Compare
|
I've looked up the deprecated functions. @rhaschke could you please add the removal of these to this PR? Here's the list of MOVEIT_DEPRECATED in indigo: and here's the list from kinetic: the intersection seems to be only |
|
@bmagyar Thanks for looking up the deprecated functions. @davetcoleman originally stated to remove all Kinetic deprecations in #806 (comment). I'm not sure fully sure about this, as it provides no feedback for people migrating from Indigo. On the other hand, I'm always in favour to cleanup asap. Dave should decide. |
davetcoleman
left a comment
There was a problem hiding this comment.
@rhaschke i'm frustrated that you are randomly removing / changing Docker stuff that isn't broken that i've spent a lot of time on in the past to get just right. why did you feel the need to change all of this? only a few lines needed actual updating for melodic. you have actually introduced a lot of regressions. this review is somewhat a waste of time
| # setup environment | ||
| ENV LANG C.UTF-8 | ||
| ENV LC_ALL C.UTF-8 | ||
|
|
There was a problem hiding this comment.
the problem you're missing is that i spent a lot of time optimizing these docker images for the unified moveit repo so that travis doesn't time out. i have since then asked travis to give us extra time for free and they did, but im worries building CIs on top of each other too much will make them very large downloads. each RUN command is its own virtual machine layer, essentially
| # Perform a single RUN command only to optimize docker performance (reduce no. of layers) | ||
| # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers | ||
| RUN \ | ||
| mkdir src && cd src && \ |
There was a problem hiding this comment.
my original approach was more elegant and removed the need for this line:
-RUN mkdir -p $CATKIN_WS/src
-WORKDIR $CATKIN_WS/src
seems like you're making arbitrary changes
| # Install some base dependencies | ||
| apt-get -qq install -y \ | ||
| # Some source builds require a package.xml be downloaded via wget from an external location | ||
| wget \ |
| wstool update && \ | ||
|
|
||
| apt-get -qq update && \ | ||
| apt-get -qq dist-upgrade && \ |
There was a problem hiding this comment.
just to be aware: this will make the docker images much larger, which affects download time, which affects travis build time
There was a problem hiding this comment.
I don't see why this make the image larger. It's important to update all packages. If there are no updates, there is no increase in image size.
Additionally, it's faster to perform this update once on the docker side, than each time in Travis.
|
|
||
| # Remove the source code from this container | ||
| # TODO: in the future we may want to keep this here for further optimization of later containers | ||
| cd .. && rm -rf src/ && \ |
There was a problem hiding this comment.
lets keep these commands on separate lines like i had them for improved readability. you made this file longer in some sections (like adding lots of extra line breaks) but more complicated in places like this
| # Perform a single RUN command only to optimize docker performance (reduce no. of layers) | ||
| # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers | ||
| RUN \ | ||
| mkdir src && \ |
There was a problem hiding this comment.
This is a regression to me... my previous approach was more standard and elegant:
-ENV CATKIN_WS=/root/ws_moveit
-RUN mkdir -p $CATKIN_WS/src
-WORKDIR $CATKIN_WS/src
There was a problem hiding this comment.
Just a note: if you're using WORKDIR, there is no need for mkdir: WORKDIR already creates directories if they don't exist.
Same comment earlier in this file.
There was a problem hiding this comment.
Thanks for this hint. Indeed, my intention was to cd to CATKIN_WS and then create (and remove) src within the single RUN command, which Dave's code didn't do.
Indeed cd src was missing. Sorry for that error.
| # Update apt-get because osrf image clears this cache. download deps | ||
| # Note that because we're building on top of melodic-ci, there should not be any deps installed | ||
| # unless something has changed in the source code since the other container was made | ||
| # (they are triggered together so should only be one-build out of sync) |
There was a problem hiding this comment.
why remove my documentation?
|
|
||
| # Build repo | ||
| WORKDIR $CATKIN_WS | ||
| ENV TERM xterm |
There was a problem hiding this comment.
this removes various warnings and errors in the CI build...
There was a problem hiding this comment.
It's redundant, because these are set by the previous docker image already.
|
|
||
| # Replacing shell with bash for later docker build commands | ||
| RUN mv /bin/sh /bin/sh-old && \ | ||
| ln -s /bin/bash /bin/sh |
There was a problem hiding this comment.
No need for this hack. Works without.
| void ChainIkSolverPos_NR_JL_Mimic::updateInternalDataStructures() | ||
| { | ||
| // TODO: move (re)allocation of any internal data structures here | ||
| // to react to changes in chain |
|
I'm sorry if I overshot the mark. However, my changes are not random at all. Originally, they were motivated by the broken Melodic build in Travis, e.g. of #830. My changes essentially tried to mimick the templates from OSRF and follow these guidelines:
I admit that I didn't know about the minimize-layers guideline initially.
Hence, I see only a one reason to use a single RUN command, namely for the
IMHO, the content of Dockerfiles should reflect the semantics of the chaining:
Finally, local and online tests have shown, that the docker containers work perfectly. |
|
Fixed unittest as well. Travis is ready for Melodic now! |
|
I separated fixes to the MoveIt source base into another PR: #906. I think these are not in question. |
|
@rhaschke thanks for the unit test fixes. I thought for sure that I had fixed those files as well, but I guess I forgot to commit the changes. Regardless, thank you for catching that. |
| wstool update && \ | ||
|
|
||
| # Update apt package list as previous containers clear the cache | ||
| apt-get -qq update && \ |
There was a problem hiding this comment.
no need for update and dist-upgrade, please remove duplicate line.
From man apt-get
dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages
| FROM ros:melodic-ros-base | ||
| MAINTAINER Dave Coleman [email protected] | ||
|
|
||
| # Commands are combined in single RUN statement with "lists" folder removal to reduce image size |
There was a problem hiding this comment.
can we keep this comment please?
| ln -s /bin/bash /bin/sh | ||
| # Update apt package list as cache is cleared in previous container | ||
| # Usually upgrading involves a few packages only (if container builds became out-of-sync) | ||
| apt-get -qq update && \ |
| apt-get -qq update && \ | ||
| apt-get -qq dist-upgrade && \ | ||
|
|
||
| rosdep update && \ |
|
Thanks for reverting some of the original changes, this PR is almost there. Overall I think our phone conversation addressed our disagreements and misunderstandings |
|
This PR can be replaced by a simpler version that tweaks the existing Dockerfiles: https://github.com/ros-planning/moveit/pull/937/files Note that currently without either of these PRs Dockerhub is passing: |
|
Closing this in favour of #937. |
This PR comprises several fixes for Melodic:
ros:melodic-ros-basedocker images are now available. No need for hacks anymore.Locally, this setup successfully built all packages, except #901.
After being merged, the docker setting for
melodic-ci-*should be updated here.There is joint Travis test running for this and #830 here.