From fdcf3a9276660105a2474d0aed363956b897090b Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Sun, 17 Nov 2024 14:29:26 -0500 Subject: [PATCH] Update tutorial Docker image names and documentation --- .docker/docker-compose.yml | 8 ++--- README.md | 12 ++++++-- ...w_to_setup_docker_containers_in_ubuntu.rst | 29 ++++++++++++------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 406ee7e9d0..3606f595e6 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -1,12 +1,12 @@ # Example command: # Humble on a Nvidia system: -# DOCKER_IMAGE=humble-tutorial docker compose run gpu +# DOCKER_IMAGE=humble-humble-tutorial-source docker compose run gpu # Rolling without discrete graphics: -# DOCKER_IMAGE=rolling-tutorial docker compose run cpu +# DOCKER_IMAGE=main-rolling-tutorial-source compose run cpu services: cpu: - image: ghcr.io/moveit/moveit2_tutorials:$DOCKER_IMAGE + image: moveit/moveit2:${DOCKER_IMAGE} container_name: moveit2_container privileged: true network_mode: host @@ -18,7 +18,7 @@ services: QT_X11_NO_MITSHM: 1 DISPLAY: $DISPLAY gpu: - image: ghcr.io/moveit/moveit2_tutorials:$DOCKER_IMAGE + image: moveit/moveit2:${DOCKER_IMAGE} container_name: moveit2_container privileged: true network_mode: host diff --git a/README.md b/README.md index d84a4ca3da..7cd4f21811 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,20 @@ Configure and build the workspace: ## Build HTML Pages Locally -If you want to test the tutorials by generating the HTML pages locally on your machine, you can use the ``build_locally`` script by issuing the following commands in the root of the moveit2_tutorials package: +If you want to test the tutorials by generating the HTML pages locally on your machine, you can use the ``build_locally.sh`` script in this repo. - export ROS_DISTRO=rolling # 20.04 +If you are using Ubuntu 24.04 (or Python 3.11 or greater), you should first create a virtual environment. + + python3 -m venv .venv + source .venv/bin/activate + +Then, issue the following commands in the root of the ``moveit2_tutorials`` package: cd $COLCON_WS/src/moveit2_tutorials + + export ROS_DISTRO=rolling # 24.04 source /opt/ros/$ROS_DISTRO/setup.bash + ./build_locally.sh The local website ``/build/html/index.html`` should automatically open in your web browser. diff --git a/doc/how_to_guides/how_to_setup_docker_containers_in_ubuntu.rst b/doc/how_to_guides/how_to_setup_docker_containers_in_ubuntu.rst index baec16f093..6f3cb049a1 100644 --- a/doc/how_to_guides/how_to_setup_docker_containers_in_ubuntu.rst +++ b/doc/how_to_guides/how_to_setup_docker_containers_in_ubuntu.rst @@ -13,16 +13,17 @@ Learning Objectives Requirements ------------ -- Ubuntu 20.04 or 22.04 +- Ubuntu 22.04 or 24.04 - `Docker Installation for Ubuntu `_ -- `Nvidia drivers for Docker `_ +- `NVIDIA drivers for Docker `_ - `docker compose (if not already installed via Docker Desktop) `_ Steps ----- -1. Install Docker and docker compose (links are available in the Requirements section) and be sure to follow the `Linux Post Install `_ instructions. If you do not complete these additional steps you will need to preface all ``docker`` commands with ``sudo``. +1. Install Docker and docker compose (links are available in the Requirements section) and be sure to follow the `Linux Post Install instructions `_. +If you do not complete these additional steps you will need to preface all ``docker`` commands with ``sudo``. -2. Open a terminal session and download docker-compose.yml +2. Open a terminal session and download ``docker-compose.yml`` .. code-block:: bash @@ -32,11 +33,16 @@ Steps .. code-block:: bash - DOCKER_IMAGE=rolling-tutorial docker compose run --rm --name moveit2_container gpu + DOCKER_IMAGE=main-rolling-tutorial-source docker compose run --rm --name moveit2_container gpu - You can replace ``rolling-tutorial`` with other tagged images, e.g. ``humble-tutorial``. Similarly, you can replace ``gpu`` with ``cpu`` if you do not wish to run using Nvidia GPU drivers and you can change the name of the container by replacing ``moveit2_container``. The ``--rm`` argument will remove the container when you stop (or exit) it, otherwise you can keep your modified container on disk and start it using ``docker start moveit2_container`` + You can replace ``DOCKER_IMAGE`` with other Docker image names, such as ``main-jazzy-tutorial-source`` or ``humble-humble-tutorial source``. + This is based on the convention ``--tutorial-source``. -4. You should now be inside of your Docker container, in the workspace directory, with the completed :doc:`Planning Around Objects ` and :doc:`Pick and Place with MoveIt Task Constructor ` tutorials. Go ahead and try one of the launch commands like ``ros2 launch moveit2_tutorials demo.launch.py`` + Similarly, you can replace the ``gpu`` service name with ``cpu`` if you do not wish to run using Nvidia GPU drivers and you can change the name of the container by replacing ``moveit2_container``. + The ``--rm`` argument will remove the container when you stop (or exit) it, otherwise you can keep your modified container on disk and start it using ``docker start moveit2_container``. + +4. You should now be inside of your Docker container, in the workspace directory, with the completed :doc:`Planning Around Objects ` and :doc:`Pick and Place with MoveIt Task Constructor ` tutorials. +Go ahead and try one of the launch commands like ``ros2 launch moveit2_tutorials demo.launch.py``. If you wish to enter the container through another terminal, use: @@ -48,11 +54,12 @@ Further Reading --------------- - For more information about Docker best practices with respect to MoveIt, refer to `this blog post `_ - from PickNik's Vatan Aksoy Tezer and Brennard Pierce. + from Vatan Aksoy Tezer and Brennand Pierce. -- There are tagged images for both ``rolling`` and ``humble`` which are built on top of the ``rolling-source`` and ``humble-source`` MoveIt 2 Docker images `here `__. +- There are tagged images for ``rolling``, ``jazzy``, and ``humble`` which are built on top of MoveIt 2 Docker images `here `__. - You can find more tagged images for MoveIt 2 Docker containers `here `__. - 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 tagged images coincide with ROS 2 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 these images by substituting the DOCKER_IMAGE environment variable with a tag name from the above link (like ``rolling-source``), but you must use `this docker-compose.yml `_ instead (simply copy it to a different location and run your ``docker compose`` command there). + You can use any of these images by substituting the ``DOCKER_IMAGE `` environment variable with a tag name from the above link (like ``main-rolling-tutorial-source``), but you must use `this docker-compose.yml `_ instead (simply copy it to a different location and run your ``docker compose`` command there).