-
Notifications
You must be signed in to change notification settings - Fork 228
How to docker ubuntu #291
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
How to docker ubuntu #291
Conversation
Please run the local checks pre-commit and htmlproofer as explained here to get this to pass CI: https://moveit.picknik.ai/main/doc/how_to_contribute/how_to_contribute_to_site.html |
cd ~/Docker/scripts/ | ||
gedit start-docker.sh | ||
|
||
2. Copy and paste the following script inside of the opened text file |
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 would recommend just pulling the script with wget instead of copy pasting
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.
@tylerjw where in this repo should I add the script? /_scripts
?
:: | ||
mkdir -p ~/Docker/scripts | ||
cd ~/Docker/scripts/ | ||
gedit start-docker.sh |
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 think it's better if we make people use this script as functions in their bashrc
:: | ||
~/Docker/scripts/start-docker.sh moveit2-galactic moveit/moveit2:galactic-source false | ||
|
||
4. You should now be inside of your docker container, in the workspace directory. You should now be able to start working with Moveit! |
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.
It is good to add here that people don't have to use the second argument (image name). After the first run. the first ~/Docker/scripts/start-docker.sh moveit2-galactic moveit/moveit2:galactic-source
creates a container named moveit2-galactic. After the container is created users can just run the container with ~/Docker/scripts/start-docker.sh moveit2-galactic
@@ -0,0 +1,126 @@ | |||
How to Setup Moveit2 Docker Containers in Ubuntu |
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.
How to Setup Moveit2 Docker Containers in Ubuntu | |
How to Setup Moveit 2 Docker Containers in Ubuntu |
|
||
1. Open a terminal session and create an empty text file. | ||
:: | ||
mkdir -p ~/Docker/scripts |
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 had to do this as four commands:
mkdir Docker
cd Docker
mkdir scripts
cd scripts
I may be doing something wrong.
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.
Is there any chance you are missing -p
@jonathan-fries ?
How to Setup Moveit2 Docker Containers in Ubuntu | ||
================================================= | ||
This guide will provide a walkthrough on how to get docker container with Moveit2 dependencies setup quickly. | ||
Provided in this guide is a script that will get you up and running in Moveit quickly! |
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.
Provided in this guide is a script that will get you up and running in Moveit quickly! | |
It includes a script that will get you up and running in Moveit quickly! |
fi | ||
fi | ||
|
||
There are 3 parameters for the script. |
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.
This shows up included in the script block on the page for me, which causes the script to have errors.
- using_gpu : if `true`, the docker will be run using nvidia gpu drivers. By default, this value is true. | ||
|
||
3. Running the script | ||
|
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 think we need to tell the user to make the script executable
chmod +x start-docker.sh |
- name_of_the_image : if you are creating a fresh docker container, provide the name of the docker image here | ||
- using_gpu : if `true`, the docker will be run using nvidia gpu drivers. By default, this value is true. | ||
|
||
3. Running the script |
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.
3. Running the script | |
3. Run the script |
- using_gpu : if `true`, the docker will be run using nvidia gpu drivers. By default, this value is true. | ||
|
||
3. Running the script | ||
|
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 had to do a chmod on the script to make it executable.
|
||
To run the script and use nvidia gpu drivers | ||
:: | ||
~/Docker/scripts/start-docker.sh moveit2-galactic moveit/moveit2:galactic-source |
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 get permission denied errors when trying to run this. I don't know the sudo password for the machine so perhaps that would bypass that problem. Perhaps everyone in the Linux world knows to do this? It wasn't obvious to me.
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 think having a note near the top would help for this. Something along the lines of step 1: ensure you've installed docker and completed the Linux Postinstall steps. If you do not complete these additional steps you'll need to preface docker commands with sudo
This pull request is in conflict. Could you fix it @abake48? |
Co-authored-by: Jack <jack.center@picknik.ai>
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 put a few editorial comments in, mostly to do with grammar/capitalization. Thanks for this great tutorial!
@@ -0,0 +1,72 @@ | |||
How to Setup Moveit 2 Docker Containers in Ubuntu | |||
================================================= | |||
This guide will provide a walkthrough on how to get docker container with Moveit 2 dependencies setup quickly. |
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.
This guide will provide a walkthrough on how to get docker container with Moveit 2 dependencies setup quickly. | |
This guide will provide a walkthrough on how to get a Docker container with MoveIt 2 dependencies set up quickly. |
================================================= | ||
This guide will provide a walkthrough on how to get docker container with Moveit 2 dependencies setup quickly. | ||
It includes a script that will get you up and running in Moveit quickly! | ||
This guide is intended for people who would like to have a separate environment for working with Moveit up and running quickly \ |
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.
This guide is intended for people who would like to have a separate environment for working with Moveit up and running quickly \ | |
This guide is intended for people who would like to have a separate environment for working with MoveIt up and running quickly \ |
Learning Objectives | ||
------------------- | ||
|
||
- How to setup a docker environment using the provided script |
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.
- How to setup a docker environment using the provided script | |
- How to setup a Docker environment using the provided script |
mkdir -p ~/Docker/scripts | ||
cd ~/Docker/scripts/ | ||
|
||
3. Fetch docker script and make it executable |
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.
3. Fetch docker script and make it executable | |
3. Download the Docker script and make it executable. |
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 user also needs to install nvidia-docker2 if they are going to use NVIDIA GPU
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'll add that to the pre reqs!
wget https://raw.githubusercontent.com/ros-planning/moveit2_tutorials/how-to-docker-ubuntu/_scripts/start-docker.sh | ||
chmod +x ~/Docker/scripts/start-docker.sh | ||
|
||
4. Run the script |
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.
4. Run the script | |
4. Run the script. |
|
||
~/Docker/scripts/start-docker.sh moveit2-galactic moveit/moveit2:galactic-source false | ||
|
||
After running the script for the first time, you only would need to |
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.
After running the script for the first time, you only would need to | |
After running the script for the first time, you only would need to: |
Or maybe, to be a bit more descriptive:
After running the script for the first time, you only would need to | |
Running the script for the first time creates the container for you. After this, you only would need to start the container with: |
|
||
~/Docker/scripts/start-docker.sh moveit2-galactic | ||
|
||
5. You should now be inside of your docker container, in the workspace directory. You should now be able to start working with Moveit! |
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.
5. You should now be inside of your docker container, in the workspace directory. You should now be able to start working with Moveit! | |
5. You should now be inside of your Docker container, in the workspace directory. You should now be able to start working with MoveIt! |
|
||
Further Reading | ||
--------------- | ||
- For more information about Docker best practices with respects to Moveit, |
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.
- For more information about Docker best practices with respects to Moveit, | |
- For more information about Docker best practices with respect to MoveIt, |
--------------- | ||
- For more information about Docker best practices with respects to Moveit, | ||
refer to `this blog post <https://picknik.ai/ros/robotics/docker/2021/07/20/Vatan-Aksoy-Tezer-Docker.html>`_ | ||
from Picknik's Vatan Aksoy Tezer and Brennard Pierce. |
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.
from Picknik's Vatan Aksoy Tezer and Brennard Pierce. | |
from PickNik's Vatan Aksoy Tezer and Brennard Pierce. |
refer to `this blog post <https://picknik.ai/ros/robotics/docker/2021/07/20/Vatan-Aksoy-Tezer-Docker.html>`_ | ||
from Picknik's Vatan Aksoy Tezer and Brennard Pierce. | ||
|
||
- `Here <https://hub.docker.com/r/moveit/moveit2/tags>`_ is a list of the available moveit2 docker images available. |
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 <https://hub.docker.com/r/moveit/moveit2/tags>`_ is a list of the available moveit2 docker images available. | |
- `Here <https://hub.docker.com/r/moveit/moveit2/tags>`_ is a list of the available MoveIt 2 Docker images available. |
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.
Perhaps it could help to add a bit more exposition on how to use these here, some thing like:
You can use any of the images in that link by substituting the second parameter in the script.
name_of_the_image
, withmoveit/moveit2:<tag_name>
, where<tag_name>
is from the above link. The above example steps use the image with the taggalactic-source
.
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.
Also maybe a small explanation of the tags here, particularly the only ones needed to be used by users are release
and source
tags.
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.
That's a good idea, I'll add that.
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 have some very tiny suggestions but otherwise this looks great to me!
@@ -0,0 +1,84 @@ | |||
How to Setup MoveIt 2 Docker Containers in Ubuntu |
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.
How to Setup MoveIt 2 Docker Containers in Ubuntu | |
How to Set Up MoveIt 2 Docker Containers in Ubuntu |
~/Docker/scripts/start-docker.sh moveit2-galactic moveit/moveit2:galactic-source | ||
|
||
If the above command fails, it is likely that Nvidia drivers cannot be used or are installed correctly. In which case, you can still proceed without using Nvidia drivers! | ||
First, You'll need to remove the container you just created by running the following command: |
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.
First, You'll need to remove the container you just created by running the following command: | |
First, you'll need to remove the container you just created by running the following command: |
mkdir -p ~/Docker/scripts | ||
cd ~/Docker/scripts/ | ||
|
||
3. Download the Docker script and make it executable |
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.
3. Download the Docker script and make it executable | |
3. Download the Docker script and make it executable. |
- You can find a list of tagged images for the MoveIt 2 Docker container `here <https://hub.docker.com/r/moveit/moveit2/tags>`_. | ||
The tagged images coincide with ROS2 version releases. The ``release`` version of the container provides an environment in which MoveIt 2 is installed via the binaries. | ||
The ``source`` version of the Docker image will build MoveIt 2 from source. | ||
You can use any of the images in that link by substituting the second parameter in the script. ``name_of_the_image``, with moveit/moveit2:<tag_name>, where ``<tag_name>`` is from the above link. |
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.
You can use any of the images in that link by substituting the second parameter in the script. ``name_of_the_image``, with moveit/moveit2:<tag_name>, where ``<tag_name>`` is from the above link. | |
You can use any of the images in that link by substituting the second parameter in the script, ``name_of_the_image``, with moveit/moveit2:<tag_name>, where ``<tag_name>`` is from the above link. |
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.
Thanks for making those changes!
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 tried this out and it worked well. I ran it with this command and it worked for me. I think you should update the text in this HowTo to target Ubuntu 22.04 and Rolling as this is for main.
start-docker.sh moveit2-rolling moveit/moveit2:rolling-source
This guide will provide a walkthrough on how to get a Docker container with MoveIt 2 dependencies set up quickly. | ||
It includes a script that will get you up and running in MoveIt quickly! | ||
This guide is intended for people who would like to have a separate environment for working with MoveIt up and running quickly \ | ||
without having to do much configuring. In this guide, we will be setting up a ROS2 Galactic environment. |
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.
As this targets the main branch it would be really nice if this was for Ubuntu 22.04 and Rolling. If you make that switch this tutorial should also easily apply to Humble. Of course we can also backport this to Galactic as well.
.. code-block:: bash | ||
|
||
wget https://raw.githubusercontent.com/ros-planning/moveit2_tutorials/how-to-docker-ubuntu/_scripts/start-docker.sh | ||
chmod +x ~/Docker/scripts/start-docker.sh |
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 don't think you need the full file-path here as the first command will write this into the local directory.
|
||
.. code-block:: bash | ||
|
||
mkdir -p ~/Docker/scripts |
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.
Would it be much more standard to just put this in .local/bin
or some similar directory? Then you don't need to specify the full file path later... that or maybe you could create a repo with this file if you expect to update it in the future and people could put it in ~/opt
or something similar and then they could update it when you push updates.
Co-authored-by: Jafar Abdi <cafer.abdi@gmail.com> Co-authored-by: Jack <jack.center@picknik.ai> (cherry picked from commit c526967)
Co-authored-by: Jafar Abdi <cafer.abdi@gmail.com> Co-authored-by: Jack <jack.center@picknik.ai> (cherry picked from commit c526967)
Co-authored-by: Jafar Abdi <cafer.abdi@gmail.com> Co-authored-by: Jack <jack.center@picknik.ai> (cherry picked from commit c526967) # Conflicts: # doc/how_to_guides/how_to_guides.rst
Co-authored-by: Jafar Abdi <cafer.abdi@gmail.com> Co-authored-by: Jack <jack.center@picknik.ai> (cherry picked from commit c526967) # Conflicts: # doc/how_to_guides/how_to_guides.rst
Description
Added How To Guide for creating Docker containers for Moveit2 in Ubuntu
Checklist