Skip to content
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

Optimized dockerfile #54

Merged
merged 6 commits into from
Oct 14, 2024
Merged

Conversation

CihatAltiparmak
Copy link
Member

@CihatAltiparmak CihatAltiparmak commented Oct 13, 2024

Hello, i dunno you are interested in optimizing dockerfile but i think this is more suitable way to serve demo. In this changes, i have installed drake via apt packages. But with some major changes

  • Made build time quicker
  • Switch to rolling
  • Used drake-noble-1.30.0

I have tried and seems it works. Do you have a chance to give a try?

- Made build time quicker
- Switch to rolling
- Used drake-noble-1.30.0
@sea-bass
Copy link
Contributor

sea-bass commented Oct 13, 2024

Starting with the MoveIt dockerfile certainly optimizes out all those builds, which is great.

Will let @sjahr determine whether we want this to be on Rolling or one of the LTS distros though.

@CihatAltiparmak
Copy link
Member Author

CihatAltiparmak commented Oct 13, 2024

For distro issue, i wanna say that project uses main branch, but compiled with humble. I think this can create some problems in the future. Btw sorry for closing pr, it was a mistake.

@@ -0,0 +1,9 @@
repositories:
Copy link
Contributor

Choose a reason for hiding this comment

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

There already is a moveit_drake.repos file at the top level. Can probably just keep one of these 2 files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually inspired from upstream.repos of moveit2_tutorials. While installing via docker, we don't need to clone repositories like moveit2 (they already installed in MoveIt's docker image) . In case of local installation, user need to clone additional repositories in addition of upstream.repos. Shortly, i have tried to support both local installation method and docker installation. But if you don't mind, we can only update main moveit_drake.repos

Copy link
Member

Choose a reason for hiding this comment

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

Yes this seems to be the likely way to go forward. I am in favor of keeping both for now. This gives users the option of doing a single VCS import if working locally.

Could you add some instructions on README, under the local installation section to point users to this effect? May also be beneficial to specify that the build time is large in this case.

Copy link
Contributor

@sjahr sjahr left a comment

Choose a reason for hiding this comment

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

Nice, thank you @CihatAltiparmak! I think enabling both, docker and local installation is a great idea and I think using rolling would be a good idea too, given that moveit main is also on rolling and humble support might be dropped in the future. Still need to test the docker & @kamiradi do you mind reviewing the docker code since you created it in the first place?

Copy link
Member

@kamiradi kamiradi left a comment

Choose a reason for hiding this comment

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

Thanks for this addition @CihatAltiparmak. Pending local test on my machine and a readme instruction under local installation, LGTM.

In terms of versioning, I think we can make the decision when we make the first release? Having an LTS release and a rolling release will be helpful. @sea-bass @sjahr you guys are more experienced here.

@@ -0,0 +1,9 @@
repositories:
Copy link
Member

Choose a reason for hiding this comment

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

Yes this seems to be the likely way to go forward. I am in favor of keeping both for now. This gives users the option of doing a single VCS import if working locally.

Could you add some instructions on README, under the local installation section to point users to this effect? May also be beneficial to specify that the build time is large in this case.

Copy link
Member

@kamiradi kamiradi left a comment

Choose a reason for hiding this comment

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

I have built the container on my machine. This has definitely reduced the build time. Nice work @CihatAltiparmak. I'll merge this once you haved added the Readem local install instrcution and removed the drake debian from the workspace.

.docker/Dockerfile Outdated Show resolved Hide resolved
@CihatAltiparmak
Copy link
Member Author

CihatAltiparmak commented Oct 14, 2024

Cool, i've applied all of your suggetions, @kamiradi . Btw now maybe you can consider to bump drake version because i believe with switching to ubuntu noble, it's simpler than before. Unfortunatelly, seems with this PR, we cannot support humble at the moment owing to the fact that humble branch of moveit doesnt run properly with this project (gives compilation error). FYI

@sea-bass
Copy link
Contributor

You guys could consider taking in the Drake version and the ROS Distro as arguments to Docker build. That would give flexibility.

LABEL maintainer="Aditya Kamireddypalli [email protected]"
ARG ROS_DISTRO=rolling
ARG RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ARG DRAKE_VERSION=1.30.0-1
Copy link
Member

Choose a reason for hiding this comment

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

I guess these are default values, maybe give it through docker compose?

Copy link
Member Author

@CihatAltiparmak CihatAltiparmak Oct 14, 2024

Choose a reason for hiding this comment

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

Overall done it with a couple of details: I couldn't build docker image without setting default argument inside dockerfile. So i just have updated docker-compose yaml instead of changing dockerfile as well. Now we can change args through compose file.

@kamiradi kamiradi merged commit df7d3b4 into moveit:main Oct 14, 2024
2 checks passed
@CihatAltiparmak CihatAltiparmak deleted the fix/optimize_dockerfile branch October 14, 2024 21:11
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.

5 participants