Skip to content

Conversation

abake48
Copy link
Contributor

@abake48 abake48 commented Jan 14, 2022

Description

Added How To Guide for creating Docker containers for Moveit2 in Ubuntu

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • While waiting for someone to review your request, please consider reviewing another open pull request to support the maintainers

@tylerjw
Copy link
Member

tylerjw commented Jan 14, 2022

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
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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!
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link

@jonathan-fries jonathan-fries Jan 14, 2022

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.

Copy link
Contributor

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!

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link

@jonathan-fries jonathan-fries Jan 14, 2022

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

Copy link
Contributor

@jackcenter jackcenter Jan 14, 2022

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

Suggested change
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

Choose a reason for hiding this comment

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

Suggested change
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

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

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.

Copy link
Contributor

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

@mergify
Copy link

mergify bot commented Jan 18, 2022

This pull request is in conflict. Could you fix it @abake48?

abake48 and others added 2 commits May 10, 2022 10:51
Copy link
Contributor

@stephanie-eng stephanie-eng left a 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.
Copy link
Contributor

@stephanie-eng stephanie-eng May 11, 2022

Choose a reason for hiding this comment

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

Suggested change
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 \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
3. Fetch docker script and make it executable
3. Download the Docker script and make it executable.

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:

Suggested change
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!
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

@stephanie-eng stephanie-eng May 11, 2022

Choose a reason for hiding this comment

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

Suggested change
- `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.

Copy link
Contributor

@stephanie-eng stephanie-eng May 11, 2022

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, with moveit/moveit2:<tag_name>, where <tag_name> is from the above link. The above example steps use the image with the tag galactic-source.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@stephanie-eng stephanie-eng 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 some very tiny suggestions but otherwise this looks great to me!

@@ -0,0 +1,84 @@
How to Setup MoveIt 2 Docker Containers in Ubuntu
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor

@stephanie-eng stephanie-eng 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 making those changes!

Copy link
Member

@tylerjw tylerjw left a 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.
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

@tylerjw tylerjw merged commit c526967 into moveit:main May 24, 2022
@tylerjw tylerjw added backport-foxy This label signals Mergify to backport this PR to Foxy backport-galactic This label signals Mergify to backport this PR to Galactic backport-humble This label signals Mergify to backport this PR to Humble labels May 24, 2022
mergify bot pushed a commit that referenced this pull request May 24, 2022
Co-authored-by: Jafar Abdi <cafer.abdi@gmail.com>
Co-authored-by: Jack <jack.center@picknik.ai>
(cherry picked from commit c526967)
mergify bot pushed a commit that referenced this pull request May 24, 2022
Co-authored-by: Jafar Abdi <cafer.abdi@gmail.com>
Co-authored-by: Jack <jack.center@picknik.ai>
(cherry picked from commit c526967)
mergify bot pushed a commit that referenced this pull request May 24, 2022
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
vatanaksoytezer pushed a commit that referenced this pull request May 24, 2022
vatanaksoytezer pushed a commit that referenced this pull request May 24, 2022
tylerjw pushed a commit that referenced this pull request May 24, 2022
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
@tylerjw tylerjw mentioned this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-foxy This label signals Mergify to backport this PR to Foxy backport-galactic This label signals Mergify to backport this PR to Galactic backport-humble This label signals Mergify to backport this PR to Humble
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants