From 7268e0216af25bd8e55340126bf4e1aed75505d7 Mon Sep 17 00:00:00 2001 From: Christopher Kelter <christopher.kelter@student.uibk.ac.at> Date: Mon, 31 Jul 2023 17:15:04 +0200 Subject: [PATCH] update readme --- README.md | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0ea2095..1b72e16 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,44 @@ Check out the readme of this project for further information. - GPU support for opencv # Available docker images -| Image | Description | -|---------------------------------------------------------------|----------------------------------------| -| `docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros/arm` | Tensorflow 2.7, ROS noetic, python 3.6 | -| `docker.uibk.ac.at:443/informatik/stair/minibot-vision/arm ` | cv_bridge, minibot-vision | +| Image | Platform | Description | +|----------------------------------------------------------------|----------|------------------------------------------------------------------------| +| `docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros:arm` | `ARMv8` | Tensorflow 2.7, ROS noetic, python 3.6 | +| `docker.uibk.ac.at:443/informatik/stair/minibot-vision:arm` | `ARMv8` | cv_bridge for python 3.6, minibot-vision | +| `docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros:amd` | `AMD64` | Minibot base image inkl. latest tensorflow and tensorflowjs, python 3.8 | +| `docker.uibk.ac.at:443/informatik/stair/minibot-vision:amd` | `AMD64` | minibot-vision | +Alle images are built automatically after a push / merge on the main branch. # Getting started +## Start and create docker container for one-time use To run the core docker image with `tensorflow`, `ROS noetic` and `minibot-vision` with GPU support for tensorflow, execute the following command: ``` -sudo docker run -it --runtime=nvidia -v /usr/local/cuda-10.2/targets/aarch64-linux/lib:/usr/local/cuda-10.2/targets/aarch64-linux/lib:ro --rm docker.uibk.ac.at:443/informatik/stair/minibot-vision/arm +sudo docker run -it --runtime=nvidia -v /usr/local/cuda-10.2/targets/aarch64-linux/lib:/usr/local/cuda-10.2/targets/aarch64-linux/lib:ro --rm docker.uibk.ac.at:443/informatik/stair/minibot-vision:arm ``` This creates an interactive container starting with the shell as entrypoint. After the container has been stopped it will be deleted. +## Create docker image for development use +### Create container for arm64v8 with GPU support for jetson nano +```` +sudo docker create -i --name minibot_vision --network host --runtime=nvidia -v /usr/local/cuda-10.2/targets/aarch64-linux/lib:/usr/local/cuda-10.2/targets/aarch64-linux/lib:ro -v HOST_OS/CATKIN_WS_PATH:/app/catkin_ws/src docker.uibk.ac.at:443/informatik/stair/minibot-vision:arm +```` +Creates a container for the jetson nano with GPU support. The container is identified by the name `minibot_vision`. `HOST_OS/CATKIN_WS_PATH` should be replaced with the path to the +catkin workspace on the host operating system. This directory will be mounted to `/app/catkin_ws/src` inside the container, +so that the content is available after updating the container. \ +The container uses the `host` network. +### Create container for amd64 without GPU support for jetson nano +```` +sudo docker create -i --name minibot_vision --network host -v HOST_OS/CATKIN_WS_PATH:/app/catkin_ws/src docker.uibk.ac.at:443/informatik/stair/minibot-vision:amd +```` +### Start the image +The container can be started using the name of the container. With `-i` the container starts in the interactive mode. +```` +sudo docker start -i minibot_vision +```` +### Connect to running container +An interactive shell can be started using hte name of the container. +```` +sudo docker exec -it minibot_vision /bin/bash +```` # Building docker container ## Base Image with Tensorflow and ROS noetic @@ -29,21 +56,22 @@ This image has been used to create an image with ROS noetic on Ubunut 18.04. The ### Build image from Dockerfile Navigate to the directory `.docker` and execute the following command on the minibot: ``` -sudo docker build --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros/arm . +sudo docker build --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros:arm --file Dockerfile.arm . ``` If you want to build the image on another device (not arm64/v8) the following command is required: ``` -sudo docker buildx build --platform=linux/arm64/v8 --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros/arm . +sudo docker buildx build --platform=linux/arm64/v8 --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros:arm --file Dockerfile.arm . ``` ## Core image with minibot vision -Based on the `docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros/arm` image a docker image with cv_bridge and the minibot-vision sources complied has been created: `docker.uibk.ac.at:443/informatik/stair/minibot-vision/arm`. +The dockerfile for hte core image is located in the `.docker` directory. \ +Based on the `docker.uibk.ac.at:443/informatik/stair/minibot-vision/ros:arm` image a docker image with cv_bridge and the minibot-vision sources complied has been created: `docker.uibk.ac.at:443/informatik/stair/minibot-vision/arm`. Inside the container the minibot-vision sources are available in the directory`/app/catkin_ws/src`. ### Build image from Dockerfile To build the image with the sources of the repository and using the base image the following command is required: ``` -sudo docker build --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision/arm . +sudo docker build --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision:arm --file Dockerfile.arm . ``` If you want to build the image on another device (not arm64/v8) the following command is required: ``` -sudo docker buildx build --platform=linux/arm64/v8 --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision/arm . +sudo docker buildx build --platform=linux/arm64/v8 --tag docker.uibk.ac.at:443/informatik/stair/minibot-vision:arm --file Dockerfile.arm . ``` -- GitLab