From 6812e5ee6a3309f41a64869a021b0e05833dfd1b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 4 Oct 2024 14:19:38 +0900 Subject: [PATCH] docs(docker): description of how to use the development and runtime containers (#5301) * add dev container readme Signed-off-by: Yutaka Kondo * add description Signed-off-by: Yutaka Kondo * update Signed-off-by: Yutaka Kondo * add runtime description Signed-off-by: Yutaka Kondo * style(pre-commit): autofix --------- Signed-off-by: Yutaka Kondo Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docker/README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/docker/README.md b/docker/README.md index 14c39306153..2dc13c925bf 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,6 +4,68 @@ Detailed instructions on how to use the containers can be found in the [Open AD Kit documentation](https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/docker-installation/). +## Development containers + +When using Open AD Kit as a development container, it is easy to use Autoware's all-in-one development container image, `ghcr.io/autowarefoundation/autoware:universe-devel-cuda`. +If you do not need the CUDA drivers, you can also use the smaller image `ghcr.io/autowarefoundation/autoware:universe-devel`. + +```shell +$ git clone git@github.com:autowarefoundation/autoware.git +$ cd autoware +$ vcs import src < autoware.repos +$ docker run -it --rm \ + –v $PWD/src/universe/autoware.universe/XXX/autoware_YYY:/autoware/src/autoware_YYY \ + ghcr.io/autowarefoundation/autoware:universe-devel-cuda +$ colcon build --mixin debug compile-commands +$ source install/setup.bash +$ ros2 run --prefix "gdb -ex run --args" autoware_YYY ZZZ +``` + +For example, if you want to make modifications to [`autoware.universe/perception/autoware_bytetrack`](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/autoware_bytetrack), you can execute the following commands to perform the volume mount and debug build and execution of only the `autoware_bytetrack`. + +Note that `gdb` is not currently installed in the development containers, but it would be installed in the near future. + +```shell +$ docker run -it --rm \ + -v $PWD/src/universe/autoware.universe/perception/autoware_bytetrack:/autoware/src/autoware_bytetrack \ + ghcr.io/autowarefoundation/autoware:universe-devel-cuda +$ root@a566e785c4d2:/autoware# colcon build --mixin debug compile-commands +Starting >>> autoware_bytetrack +[Processing: autoware_bytetrack] +Finished <<< autoware_bytetrack [37.9s] + +Summary: 1 package finished [38.1s] +$ root@a566e785c4d2:/autoware# source install/setup.bash +$ root@a566e785c4d2:/autoware# apt update && apt install gdb +$ root@a566e785c4d2:/autoware# ros2 run --prefix "gdb -ex run --args" autoware_bytetrack bytetrack_node_exe +GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1 +... +[Thread debugging using libthread_db enabled] +... +[New Thread 0x7ff6f3fff640 (LWP 1205)] +Init ByteTrack! +``` + +## Runtime containers + +In the execution container, there is the all-in-one runtime container for Autoware, `ghcr.io/autowarefoundation/autoware:universe-cuda`, and the multi-containerized `ghcr.io/autowarefoundation/autoware:universe-***-cuda` for each component of Autoware Universe. + +The all-in-one execution container also has the autoware_launch package installed, allowing it to be started in the same way as a locally built Autoware. + +```shell +git clone git@github.com:autowarefoundation/autoware.git +cd autoware +docker run -it --rm ghcr.io/autowarefoundation/autoware:universe-cuda +ros2 launch autoware_launch planning_simulator.launch.xml map_path:=... +``` + +For example, if you want to run the runtime container that only includes the `sensing/perception` components, you can execute it as follows. + +```shell +docker run -it --rm ghcr.io/autowarefoundation/autoware:universe-sensing-perception-cuda +ros2 launch autoware_pointcloud_preprocessor preprocessor.launch.xml +``` + ## Multi-stage Dockerfile structure ![](./Dockerfile.svg)