From e03a15005e2131cb959e5f2858b39ac1adea0f7f Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 13 May 2024 13:25:14 +0900 Subject: [PATCH 01/32] introduce src-imported stage Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index c7ce5cca809..2ee0a4c9664 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -39,6 +39,17 @@ RUN --mount=type=ssh \ # Create entrypoint CMD ["/bin/bash"] +FROM $BASE_IMAGE as src-imported +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /autoware +COPY autoware.repos /autoware/ +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + ros-dev-tools \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache +RUN --mount=type=ssh \ + mkdir src \ + && vcs import src < autoware.repos + FROM base as prebuilt SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO @@ -56,14 +67,10 @@ RUN --mount=type=ssh \ && find / -name 'libcu*.a' -delete \ && find / -name 'libnv*.a' -delete -# Copy repository files -COPY autoware.repos /autoware/ - # Install rosdep dependencies +COPY --from=src-imported /autoware/src /autoware/src RUN --mount=type=ssh \ - mkdir src \ - && vcs import src < autoware.repos \ - && apt-get update \ + apt-get update \ && rosdep update \ && DEBIAN_FRONTEND=noninteractive rosdep install -y --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \ && source /opt/ros/"$ROS_DISTRO"/setup.bash \ @@ -101,12 +108,11 @@ ARG LIB_DIR ARG SETUP_ARGS # Set up runtime environment and artifacts -COPY autoware.repos /autoware/ +COPY --from=src-imported /autoware/src /autoware/src RUN --mount=type=ssh \ ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --download-artifacts --no-cuda-drivers --runtime openadk \ && pip uninstall -y ansible ansible-core \ - && mkdir src \ - && vcs import src < autoware.repos \ + && apt-get update \ && rosdep update \ && DEBIAN_FRONTEND=noninteractive rosdep install -y --dependency-types=exec --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \ @@ -114,7 +120,7 @@ RUN --mount=type=ssh \ && find / -name "*.o" -type f -delete \ && find / -name "*.h" -type f -delete \ && find / -name "*.hpp" -type f -delete \ - && rm -rf /autoware/src /autoware/ansible /autoware/autoware.repos \ + && rm -rf /autoware/src /autoware/ansible \ /root/.local/pipx /opt/ros/"$ROS_DISTRO"/include /etc/apt/sources.list.d/cuda*.list \ /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \ /usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm* From e5aead0ac02c42dc2c042e929c08f6c01c061d4b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 14 May 2024 17:36:59 +0900 Subject: [PATCH 02/32] empty Signed-off-by: Yutaka Kondo From 2d70277670ccd08630854819d6f34f1aff3bb98e Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 17 May 2024 23:07:09 +0900 Subject: [PATCH 03/32] generate install package lists --- docker/autoware-openadk/Dockerfile | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 2ee0a4c9664..06ece79cb7d 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -41,6 +41,8 @@ CMD ["/bin/bash"] FROM $BASE_IMAGE as src-imported SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + WORKDIR /autoware COPY autoware.repos /autoware/ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ @@ -50,6 +52,20 @@ RUN --mount=type=ssh \ mkdir src \ && vcs import src < autoware.repos +# Generate install package lists +RUN rosdep keys --dependency-types=build --ignore-src --from-paths src \ + | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ + | grep -v '^#' \ + | sed 's/ \+/\n/g'\ + | sort \ + > /rosdep-build-depend-packages.txt +RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ + | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ + | grep -v '^#' \ + | sed 's/ \+/\n/g'\ + | sort \ + > /rosdep-exec-depend-packages.txt + FROM base as prebuilt SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO @@ -69,10 +85,10 @@ RUN --mount=type=ssh \ # Install rosdep dependencies COPY --from=src-imported /autoware/src /autoware/src +COPY --from=src-imported /rosdep-build-depend-packages.txt /tmp/rosdep-build-depend-packages.txt RUN --mount=type=ssh \ apt-get update \ - && rosdep update \ - && DEBIAN_FRONTEND=noninteractive rosdep install -y --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \ + && cat /tmp/rosdep-build-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ && source /opt/ros/"$ROS_DISTRO"/setup.bash \ && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \ " -Wno-dev" \ @@ -108,19 +124,18 @@ ARG LIB_DIR ARG SETUP_ARGS # Set up runtime environment and artifacts -COPY --from=src-imported /autoware/src /autoware/src +COPY --from=src-imported /rosdep-exec-depend-packages.txt /tmp/rosdep-exec-depend-packages.txt RUN --mount=type=ssh \ ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --download-artifacts --no-cuda-drivers --runtime openadk \ && pip uninstall -y ansible ansible-core \ && apt-get update \ - && rosdep update \ - && DEBIAN_FRONTEND=noninteractive rosdep install -y --dependency-types=exec --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \ + && cat /tmp/rosdep-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \ && find /usr/lib/$LIB_DIR-linux-gnu -name "*.a" -type f -delete \ && find / -name "*.o" -type f -delete \ && find / -name "*.h" -type f -delete \ && find / -name "*.hpp" -type f -delete \ - && rm -rf /autoware/src /autoware/ansible \ + && rm -rf /autoware/ansible \ /root/.local/pipx /opt/ros/"$ROS_DISTRO"/include /etc/apt/sources.list.d/cuda*.list \ /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \ /usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm* From 05d35ae9d6ae49016bc474e2eff36393159535dc Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 17 May 2024 23:16:43 +0900 Subject: [PATCH 04/32] append || true Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 06ece79cb7d..b1072279230 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -58,13 +58,15 @@ RUN rosdep keys --dependency-types=build --ignore-src --from-paths src \ | grep -v '^#' \ | sed 's/ \+/\n/g'\ | sort \ - > /rosdep-build-depend-packages.txt + > /rosdep-build-depend-packages.txt \ + || true RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ | grep -v '^#' \ | sed 's/ \+/\n/g'\ | sort \ - > /rosdep-exec-depend-packages.txt + > /rosdep-exec-depend-packages.txt \ + || true FROM base as prebuilt SHELL ["/bin/bash", "-o", "pipefail", "-c"] From a3900661c1ed14db51e542ce79348e0f9f5a03fb Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 17 May 2024 23:29:31 +0900 Subject: [PATCH 05/32] cat packages Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index b1072279230..d5c6031f16f 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -59,14 +59,16 @@ RUN rosdep keys --dependency-types=build --ignore-src --from-paths src \ | sed 's/ \+/\n/g'\ | sort \ > /rosdep-build-depend-packages.txt \ - || true + || true \ + && cat /rosdep-build-depend-packages.txt RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ | grep -v '^#' \ | sed 's/ \+/\n/g'\ | sort \ > /rosdep-exec-depend-packages.txt \ - || true + || true \ + && cat /rosdep-exec-depend-packages.txt FROM base as prebuilt SHELL ["/bin/bash", "-o", "pipefail", "-c"] From 99cd9bf7d0de4e67260fbc55894516a58c97bed2 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 16 May 2024 06:09:55 +0900 Subject: [PATCH 06/32] chore(docker): separate `rosdep install` and `colcon build` RUN commands (#4719) --- docker/autoware-openadk/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index d5c6031f16f..ed993a8d6de 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -93,7 +93,10 @@ COPY --from=src-imported /rosdep-build-depend-packages.txt /tmp/rosdep-build-dep RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-build-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ - && source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache + +# Build Autoware +RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \ && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \ " -Wno-dev" \ " --no-warn-unused-cli" \ @@ -101,7 +104,6 @@ RUN --mount=type=ssh \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ && find /autoware/install -type d -exec chmod 777 {} \; \ && chmod -R 777 /var/tmp/ccache \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \ && rm -rf /autoware/build /autoware/src CMD ["/bin/bash"] From bcc6509bb3f0e3396467733e8cac8b2a66da8949 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 17 May 2024 23:52:22 +0900 Subject: [PATCH 07/32] wip Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index ed993a8d6de..f471d3c632f 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -93,6 +93,7 @@ COPY --from=src-imported /rosdep-build-depend-packages.txt /tmp/rosdep-build-dep RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-build-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && apt-get install -y --no-install-recommends ros-"$ROS_DISTRO"-cudnn-cmake-module \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware From a50e7e50672dd8993b29a21ca552d940c83be0b7 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 00:01:35 +0900 Subject: [PATCH 08/32] wip Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index f471d3c632f..68ec359d434 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -93,7 +93,9 @@ COPY --from=src-imported /rosdep-build-depend-packages.txt /tmp/rosdep-build-dep RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-build-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ - && apt-get install -y --no-install-recommends ros-"$ROS_DISTRO"-cudnn-cmake-module \ + && apt-get install -y --no-install-recommends \ + ros-"$ROS_DISTRO"-cudnn-cmake-module \ + ros-"$ROS_DISTRO"-tensorrt-cmake-module \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware From 0fec25990c4a9efa6d8d689ec2cb83258f1f3606 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 08:41:46 +0900 Subject: [PATCH 09/32] Update Dockerfile --- docker/autoware-openadk/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 68ec359d434..741ad296e90 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -53,7 +53,7 @@ RUN --mount=type=ssh \ && vcs import src < autoware.repos # Generate install package lists -RUN rosdep keys --dependency-types=build --ignore-src --from-paths src \ +RUN rosdep keys --ignore-src --from-paths src \ | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ | grep -v '^#' \ | sed 's/ \+/\n/g'\ From 0c65eaee73ccba6a149fdaa5479859d1f6201573 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 10:15:50 +0900 Subject: [PATCH 10/32] Update Dockerfile --- docker/autoware-openadk/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 741ad296e90..1b6ce0c1919 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -93,9 +93,6 @@ COPY --from=src-imported /rosdep-build-depend-packages.txt /tmp/rosdep-build-dep RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-build-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ - && apt-get install -y --no-install-recommends \ - ros-"$ROS_DISTRO"-cudnn-cmake-module \ - ros-"$ROS_DISTRO"-tensorrt-cmake-module \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware From f20962220d24bf7b5f6848028f6e8460c96b7ed4 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 19:11:08 +0900 Subject: [PATCH 11/32] install pacmod --- ansible/playbooks/openadk.yaml | 4 ++-- ansible/playbooks/universe.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/playbooks/openadk.yaml b/ansible/playbooks/openadk.yaml index f343d9cef55..bfb338dad2f 100644 --- a/ansible/playbooks/openadk.yaml +++ b/ansible/playbooks/openadk.yaml @@ -26,6 +26,8 @@ when: module == 'base' - role: autoware.dev_env.build_tools when: module == 'all' and install_devel=='y' + - role: autoware.dev_env.pacmod + when: module == 'base' # Module specific dependencies - role: autoware.dev_env.geographiclib @@ -34,8 +36,6 @@ when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - role: autoware.dev_env.tensorrt when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - - role: autoware.dev_env.pacmod - when: module == 'planning-control' or module == 'perception-localization' or module == 'all' # Development environment - role: autoware.dev_env.dev_tools diff --git a/ansible/playbooks/universe.yaml b/ansible/playbooks/universe.yaml index e443c041bc5..531bdf56031 100644 --- a/ansible/playbooks/universe.yaml +++ b/ansible/playbooks/universe.yaml @@ -45,13 +45,13 @@ - role: autoware.dev_env.rmw_implementation - role: autoware.dev_env.gdown - role: autoware.dev_env.build_tools + - role: autoware.dev_env.pacmod + when: module == 'planning-control' or module == 'perception-localization' or module == 'all' # Autoware module dependencies - role: autoware.dev_env.geographiclib - role: autoware.dev_env.cuda when: prompt_install_nvidia == 'y' - - role: autoware.dev_env.pacmod - when: rosdistro != 'rolling' - role: autoware.dev_env.tensorrt when: prompt_install_nvidia == 'y' From af11db7b4b839c7efeb94c2024cbb10170189815 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 19:18:49 +0900 Subject: [PATCH 12/32] rename --- docker/autoware-openadk/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 1b6ce0c1919..be2a563ecd2 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -58,9 +58,9 @@ RUN rosdep keys --ignore-src --from-paths src \ | grep -v '^#' \ | sed 's/ \+/\n/g'\ | sort \ - > /rosdep-build-depend-packages.txt \ + > /rosdep-all-depend-packages.txt \ || true \ - && cat /rosdep-build-depend-packages.txt + && cat /rosdep-all-depend-packages.txt RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ | grep -v '^#' \ @@ -89,10 +89,10 @@ RUN --mount=type=ssh \ # Install rosdep dependencies COPY --from=src-imported /autoware/src /autoware/src -COPY --from=src-imported /rosdep-build-depend-packages.txt /tmp/rosdep-build-depend-packages.txt +COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend-packages.txt RUN --mount=type=ssh \ apt-get update \ - && cat /tmp/rosdep-build-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && cat /tmp/rosdep-all-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware From 3990ff0c6b6e02e96695dd49ebd24caf6d725381 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 19:59:28 +0900 Subject: [PATCH 13/32] Revert "install pacmod" This reverts commit ebff10f4747489da490fa54497c2722fdec91def. --- ansible/playbooks/openadk.yaml | 4 ++-- ansible/playbooks/universe.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/playbooks/openadk.yaml b/ansible/playbooks/openadk.yaml index bfb338dad2f..f343d9cef55 100644 --- a/ansible/playbooks/openadk.yaml +++ b/ansible/playbooks/openadk.yaml @@ -26,8 +26,6 @@ when: module == 'base' - role: autoware.dev_env.build_tools when: module == 'all' and install_devel=='y' - - role: autoware.dev_env.pacmod - when: module == 'base' # Module specific dependencies - role: autoware.dev_env.geographiclib @@ -36,6 +34,8 @@ when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - role: autoware.dev_env.tensorrt when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' + - role: autoware.dev_env.pacmod + when: module == 'planning-control' or module == 'perception-localization' or module == 'all' # Development environment - role: autoware.dev_env.dev_tools diff --git a/ansible/playbooks/universe.yaml b/ansible/playbooks/universe.yaml index 531bdf56031..e443c041bc5 100644 --- a/ansible/playbooks/universe.yaml +++ b/ansible/playbooks/universe.yaml @@ -45,13 +45,13 @@ - role: autoware.dev_env.rmw_implementation - role: autoware.dev_env.gdown - role: autoware.dev_env.build_tools - - role: autoware.dev_env.pacmod - when: module == 'planning-control' or module == 'perception-localization' or module == 'all' # Autoware module dependencies - role: autoware.dev_env.geographiclib - role: autoware.dev_env.cuda when: prompt_install_nvidia == 'y' + - role: autoware.dev_env.pacmod + when: rosdistro != 'rolling' - role: autoware.dev_env.tensorrt when: prompt_install_nvidia == 'y' From 3dd8d576e3465ac8f6eaf68cd375c9c85e9b7de9 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 20:25:43 +0900 Subject: [PATCH 14/32] install pacmod3 --- docker/autoware-openadk/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index be2a563ecd2..62e04ee0766 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -93,6 +93,7 @@ COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend- RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-all-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-pacmod3 \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware From 00d2e3bf8b61c2fea76ce3888cf57219d7aa628f Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 21:19:48 +0900 Subject: [PATCH 15/32] register pamod3 repos --- docker/autoware-openadk/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 62e04ee0766..4f922e58c10 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -45,8 +45,11 @@ ARG ROS_DISTRO WORKDIR /autoware COPY autoware.repos /autoware/ -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ - ros-dev-tools \ +# Register the pacmod3_msgs repository +RUN sh -c 'echo "deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ $(lsb_release -sc) main" \ + > /etc/apt/sources.list.d/autonomoustuff-public.list' \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + python3-vcstool \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache RUN --mount=type=ssh \ mkdir src \ @@ -93,7 +96,6 @@ COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend- RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-all-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ - && apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-pacmod3 \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware From 35366deb778336751336f97f5309b257012fd219 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 21:19:58 +0900 Subject: [PATCH 16/32] ignore hadolint --- docker/autoware-openadk/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 4f922e58c10..991ed84aba0 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -93,6 +93,7 @@ RUN --mount=type=ssh \ # Install rosdep dependencies COPY --from=src-imported /autoware/src /autoware/src COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend-packages.txt +# hadolint ignore=SC2002 RUN --mount=type=ssh \ apt-get update \ && cat /tmp/rosdep-all-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ @@ -134,6 +135,7 @@ ARG SETUP_ARGS # Set up runtime environment and artifacts COPY --from=src-imported /rosdep-exec-depend-packages.txt /tmp/rosdep-exec-depend-packages.txt +# hadolint ignore=SC2002 RUN --mount=type=ssh \ ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --download-artifacts --no-cuda-drivers --runtime openadk \ && pip uninstall -y ansible ansible-core \ From 3eb3913b057da79088971bdb01f318d4c004a460 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 21:37:44 +0900 Subject: [PATCH 17/32] revert --- docker/autoware-openadk/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 991ed84aba0..fc28a0d862f 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -45,10 +45,7 @@ ARG ROS_DISTRO WORKDIR /autoware COPY autoware.repos /autoware/ -# Register the pacmod3_msgs repository -RUN sh -c 'echo "deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ $(lsb_release -sc) main" \ - > /etc/apt/sources.list.d/autonomoustuff-public.list' \ - && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ python3-vcstool \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache RUN --mount=type=ssh \ From b693322f0696350a1e1624d7796bdd7eee4bd3a8 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 21:47:10 +0900 Subject: [PATCH 18/32] run set-dev-env.sh --- ansible/playbooks/rosdep.yaml | 10 ++++++++++ docker/autoware-openadk/Dockerfile | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ansible/playbooks/rosdep.yaml diff --git a/ansible/playbooks/rosdep.yaml b/ansible/playbooks/rosdep.yaml new file mode 100644 index 00000000000..c7c23a245ab --- /dev/null +++ b/ansible/playbooks/rosdep.yaml @@ -0,0 +1,10 @@ +- name: Register rosdep package repositories + hosts: localhost + connection: local + pre_tasks: + - name: Verify OS + ansible.builtin.fail: + msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/. + when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '22.04' + roles: + - role: autoware.dev_env.pacmod diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index fc28a0d862f..ecc4f0d534d 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -32,7 +32,6 @@ WORKDIR /autoware RUN --mount=type=ssh \ ./setup-dev-env.sh -y --module base --runtime openadk \ && pip uninstall -y ansible ansible-core \ - && pip install --no-cache-dir vcstool \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \ && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc @@ -43,6 +42,11 @@ FROM $BASE_IMAGE as src-imported SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO +RUN --mount=type=ssh \ + ./setup-dev-env.sh -y rosdep \ + && pip uninstall -y ansible ansible-core \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache + WORKDIR /autoware COPY autoware.repos /autoware/ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ From 99fd7eaf90d321cc9a5a0adc3639561d314ce646 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 21:51:11 +0900 Subject: [PATCH 19/32] pip install --- docker/autoware-openadk/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index ecc4f0d534d..7a04ff8fd86 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -45,13 +45,11 @@ ARG ROS_DISTRO RUN --mount=type=ssh \ ./setup-dev-env.sh -y rosdep \ && pip uninstall -y ansible ansible-core \ + && pip install --no-cache-dir vcstool \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache WORKDIR /autoware COPY autoware.repos /autoware/ -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ - python3-vcstool \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache RUN --mount=type=ssh \ mkdir src \ && vcs import src < autoware.repos From bdc1316ba71b0526681bd2ca11303642aee6d150 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sat, 18 May 2024 21:53:19 +0900 Subject: [PATCH 20/32] copy --- docker/autoware-openadk/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 7a04ff8fd86..d3b6b5cbd73 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -42,6 +42,11 @@ FROM $BASE_IMAGE as src-imported SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO +# Copy files +COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /autoware/ +COPY ansible/ /autoware/ansible/ +WORKDIR /autoware + RUN --mount=type=ssh \ ./setup-dev-env.sh -y rosdep \ && pip uninstall -y ansible ansible-core \ From be49c85d9ac550c0b576ae4fd412bd812b42bf81 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Sun, 19 May 2024 09:44:04 +0900 Subject: [PATCH 21/32] rosdep update --- docker/autoware-openadk/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index d3b6b5cbd73..23d260f0317 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -60,13 +60,12 @@ RUN --mount=type=ssh \ && vcs import src < autoware.repos # Generate install package lists -RUN rosdep keys --ignore-src --from-paths src \ +RUN rosdep update && rosdep keys --ignore-src --from-paths src \ | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ | grep -v '^#' \ | sed 's/ \+/\n/g'\ | sort \ > /rosdep-all-depend-packages.txt \ - || true \ && cat /rosdep-all-depend-packages.txt RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ | xargs rosdep resolve --rosdistro ${ROS_DISTRO} \ @@ -74,7 +73,6 @@ RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ | sed 's/ \+/\n/g'\ | sort \ > /rosdep-exec-depend-packages.txt \ - || true \ && cat /rosdep-exec-depend-packages.txt FROM base as prebuilt From 92d85cfcb8cb465b4d1638128d0873a98f03782d Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 20 May 2024 15:27:31 +0900 Subject: [PATCH 22/32] vcs import outside dockerfile Signed-off-by: Yutaka Kondo --- .../docker-build-and-push-main-self-hosted.yaml | 16 ++++++++++++++++ .../workflows/docker-build-and-push-main.yaml | 16 ++++++++++++++++ docker/autoware-openadk/Dockerfile | 10 +++------- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml index 69a553a6cb0..98b194f5d76 100644 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ b/.github/workflows/docker-build-and-push-main-self-hosted.yaml @@ -56,9 +56,25 @@ jobs: - name: Check out repository uses: actions/checkout@v4 + - name: Install vcstool + run: | + sudo apt-get -y update + sudo apt-get -y install python3-pip + pip install --no-cache-dir vcstool + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Free disk space uses: ./.github/actions/free-disk-space + - name: Run vcs import + run: | + mkdir src + vcs import src < autoware.repos + - name: Build 'autoware-openadk' uses: ./.github/actions/docker-build-and-push with: diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml index bea0df4a950..729f7e9297a 100644 --- a/.github/workflows/docker-build-and-push-main.yaml +++ b/.github/workflows/docker-build-and-push-main.yaml @@ -51,9 +51,25 @@ jobs: - name: Check out repository uses: actions/checkout@v4 + - name: Install vcstool + run: | + sudo apt-get -y update + sudo apt-get -y install python3-pip + pip install --no-cache-dir vcstool + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Free disk space uses: ./.github/actions/free-disk-space + - name: Run vcs import + run: | + mkdir src + vcs import src < autoware.repos + - name: Build 'autoware-openadk' uses: ./.github/actions/docker-build-and-push with: diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 23d260f0317..24cdee9b7ca 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -50,14 +50,10 @@ WORKDIR /autoware RUN --mount=type=ssh \ ./setup-dev-env.sh -y rosdep \ && pip uninstall -y ansible ansible-core \ - && pip install --no-cache-dir vcstool \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache -WORKDIR /autoware -COPY autoware.repos /autoware/ -RUN --mount=type=ssh \ - mkdir src \ - && vcs import src < autoware.repos +# Copy repository files +COPY src /autoware/src # Generate install package lists RUN rosdep update && rosdep keys --ignore-src --from-paths src \ @@ -110,7 +106,7 @@ RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ && find /autoware/install -type d -exec chmod 777 {} \; \ && chmod -R 777 /var/tmp/ccache \ - && rm -rf /autoware/build /autoware/src + && rm -rf /autoware/build CMD ["/bin/bash"] From ed61b07166f8351be2395d6e205a949859771fab Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 16 May 2024 21:58:32 +0900 Subject: [PATCH 23/32] enable docker build cache Signed-off-by: Yutaka Kondo --- .github/workflows/build-main-self-hosted.yaml | 2 ++ .github/workflows/build-main.yaml | 2 ++ .github/workflows/docker-build-and-push-main-self-hosted.yaml | 2 ++ .github/workflows/docker-build-and-push-main.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml index c0bba91845b..a80328efeb7 100644 --- a/.github/workflows/build-main-self-hosted.yaml +++ b/.github/workflows/build-main-self-hosted.yaml @@ -57,6 +57,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index 4b276a7ad32..1207230ab0a 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -52,6 +52,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml index 98b194f5d76..f41f519cf06 100644 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ b/.github/workflows/docker-build-and-push-main-self-hosted.yaml @@ -85,6 +85,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml index 729f7e9297a..9b03273c284 100644 --- a/.github/workflows/docker-build-and-push-main.yaml +++ b/.github/workflows/docker-build-and-push-main.yaml @@ -80,6 +80,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true From cb43babe0a2544a0c72546df49810a83b20bcedf Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 17 May 2024 11:20:10 +0900 Subject: [PATCH 24/32] empty Signed-off-by: Yutaka Kondo From ea872bc7e8f86d9b8a8e19151d413f1c82a42007 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 17 May 2024 11:55:45 +0900 Subject: [PATCH 25/32] add no-cuda/cuda suffix Signed-off-by: Yutaka Kondo --- .github/workflows/build-main-self-hosted.yaml | 4 ++-- .github/workflows/build-main.yaml | 4 ++-- .github/workflows/docker-build-and-push-main-self-hosted.yaml | 4 ++-- .github/workflows/docker-build-and-push-main.yaml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml index a80328efeb7..9c40bcfd5b2 100644 --- a/.github/workflows/build-main-self-hosted.yaml +++ b/.github/workflows/build-main-self-hosted.yaml @@ -57,8 +57,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index 1207230ab0a..1fff60ce250 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -52,8 +52,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml index f41f519cf06..ff5ae7a16c6 100644 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ b/.github/workflows/docker-build-and-push-main-self-hosted.yaml @@ -85,8 +85,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml index 9b03273c284..ee132df8666 100644 --- a/.github/workflows/docker-build-and-push-main.yaml +++ b/.github/workflows/docker-build-and-push-main.yaml @@ -80,8 +80,8 @@ jobs: *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true From 78be8061e95bcfd0d54dc31f35da614f1eb07217 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 22 May 2024 14:54:30 +0900 Subject: [PATCH 26/32] remove --download-artifacts Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index c7362e17069..fe3b966b4d0 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -125,7 +125,7 @@ ARG SETUP_ARGS COPY --from=src-imported /rosdep-exec-depend-packages.txt /tmp/rosdep-exec-depend-packages.txt # hadolint ignore=SC2002 RUN --mount=type=ssh \ - ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --download-artifacts --no-cuda-drivers --runtime openadk \ + ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers --runtime openadk \ && pip uninstall -y ansible ansible-core \ && apt-get update \ && cat /tmp/rosdep-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ From 4087a9efc264b7277084dd2cb73b3ee1eac16196 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 22 May 2024 14:59:38 +0900 Subject: [PATCH 27/32] remove --download-artifacts Signed-off-by: Yutaka Kondo --- docker/autoware-openadk/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index fe3b966b4d0..4d0cd0d31b0 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -105,7 +105,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install development tools and artifacts RUN --mount=type=ssh \ - ./setup-dev-env.sh -y --module dev-tools --download-artifacts openadk \ + ./setup-dev-env.sh -y --module dev-tools openadk \ && pip uninstall -y ansible ansible-core \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache From 5a9b194ad06ae35d16e0119d6c8f6a4177c9ef04 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 22 May 2024 16:16:49 +0900 Subject: [PATCH 28/32] add --data-path option Signed-off-by: Yutaka Kondo --- docker/run.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index 3ea92854b3c..943d3d10366 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -20,21 +20,23 @@ fi option_no_nvidia=false option_devel=false option_headless=false +DATA_PATH="" MAP_PATH="" WORKSPACE_PATH="" USER_ID="" WORKSPACE="" -DEFAULT_LAUNCH_CMD="ros2 launch autoware_launch autoware.launch.xml map_path:=/autoware_map vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit" +DEFAULT_LAUNCH_CMD="ros2 launch autoware_launch autoware.launch.xml data_path:=/autoware_data map_path:=/autoware_map vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit" # Function to print help message print_help() { echo -e "\n------------------------------------------------------------" - echo -e "${RED}Note:${NC} The --map-path option is mandatory if not custom launch command given. Please provide exact path to the map files." + echo -e "${RED}Note:${NC} The --data-path and --map-path options are mandatory if not custom launch command given. Please provide exact paths to the data and map files." echo -e " Default launch command: ${GREEN}${DEFAULT_LAUNCH_CMD}${NC}" echo -e "------------------------------------------------------------" echo -e "${RED}Usage:${NC} run.sh [OPTIONS] [LAUNCH_CMD](optional)" echo -e "Options:" echo -e " ${GREEN}--help/-h${NC} Display this help message" + echo -e " ${GREEN}--data-path${NC} Specify to mount data files into /autoware_data (mandatory if no custom launch command is provided)" echo -e " ${GREEN}--map-path${NC} Specify to mount map files into /autoware_map (mandatory if no custom launch command is provided)" echo -e " ${GREEN}--no-nvidia${NC} Disable NVIDIA GPU support" echo -e " ${GREEN}--devel${NC} Use the latest development version of Autoware" @@ -64,6 +66,10 @@ parse_arguments() { WORKSPACE_PATH="$2" shift ;; + --data-path) + DATA_PATH="$2" + shift + ;; --map-path) MAP_PATH="$2" shift @@ -89,12 +95,19 @@ parse_arguments() { # Set image and workspace variables set_variables() { - # Check if map path is provided for default launch command + # Check if data and map paths are provided for default launch command + if [ "$DATA_PATH" == "" ] && [ "$LAUNCH_CMD" == "" ]; then + print_help + exit 1 + fi if [ "$MAP_PATH" == "" ] && [ "$LAUNCH_CMD" == "" ]; then print_help exit 1 fi + # Mount data path if provided + DATA="-v ${DATA_PATH}:/autoware_data:ro" + # Mount map path if provided MAP="-v ${MAP_PATH}:/autoware_map:ro" @@ -150,6 +163,7 @@ main() { echo -e "${GREEN}\n-----------------------LAUNCHING CONTAINER-----------------------" echo -e "${GREEN}IMAGE:${NC} ${IMAGE}" + echo -e "${GREEN}DATA PATH(mounted):${NC} ${DATA_PATH}:/autoware_data" echo -e "${GREEN}MAP PATH(mounted):${NC} ${MAP_PATH}:/autoware_map" echo -e "${GREEN}WORKSPACE(mounted):${NC} ${WORKSPACE_PATH}:/workspace" echo -e "${GREEN}LAUNCH CMD:${NC} ${LAUNCH_CMD}" @@ -159,7 +173,7 @@ main() { set -x docker run -it --rm --net=host ${GPU_FLAG} ${USER_ID} ${MOUNT_X} \ -e XAUTHORITY=${XAUTHORITY} -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR -e NVIDIA_DRIVER_CAPABILITIES=all -v /etc/localtime:/etc/localtime:ro \ - ${WORKSPACE} ${MAP} ${IMAGE} \ + ${WORKSPACE} ${DATA} ${MAP} ${IMAGE} \ ${LAUNCH_CMD} } From 8abf60961c27c2f0d0bb1ec6d320ce8da67e9a9e Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 23 May 2024 21:43:38 +0900 Subject: [PATCH 29/32] wip Signed-off-by: Yutaka Kondo --- docker/run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 943d3d10366..6301bcb0f1c 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -20,7 +20,7 @@ fi option_no_nvidia=false option_devel=false option_headless=false -DATA_PATH="" +DATA_PATH="${HOME}/autoware_data" MAP_PATH="" WORKSPACE_PATH="" USER_ID="" @@ -106,6 +106,9 @@ set_variables() { fi # Mount data path if provided + if [ ! -d "$DATA_PATH" ]; then + # TODO(youtalk) + fi DATA="-v ${DATA_PATH}:/autoware_data:ro" # Mount map path if provided From e5c328cc692446be9d7178b38e7d027f3a9b6be5 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 24 May 2024 21:59:04 +0900 Subject: [PATCH 30/32] run download_artifacts Signed-off-by: Yutaka Kondo --- ansible/playbooks/docker.yaml | 4 ++++ setup-dev-env.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/docker.yaml b/ansible/playbooks/docker.yaml index 5cc84043e27..443d355709a 100644 --- a/ansible/playbooks/docker.yaml +++ b/ansible/playbooks/docker.yaml @@ -24,3 +24,7 @@ when: prompt_install_nvidia == 'y' - role: autoware.dev_env.docker_engine - role: autoware.dev_env.nvidia_container_toolkit + + # ONNX files and other artifacts + - role: autoware.dev_env.artifacts + when: prompt_download_artifacts == 'y' diff --git a/setup-dev-env.sh b/setup-dev-env.sh index e5cb6953f61..48afecc4444 100755 --- a/setup-dev-env.sh +++ b/setup-dev-env.sh @@ -133,7 +133,7 @@ if [ "$option_yes" = "true" ] || [ "$option_download_artifacts" = "true" ]; then fi # Check downloading artifacts -if [ "$target_playbook" = "autoware.dev_env.openadk" ]; then +if [ "$target_playbook" = "autoware.dev_env.docker" ] || [ "$target_playbook" = "autoware.dev_env.openadk" ]; then if [ "$option_download_artifacts" = "true" ]; then echo -e "\e[36mArtifacts will be downloaded to $option_data_dir\e[m" ansible_args+=("--extra-vars" "prompt_download_artifacts=y") From b6f3c06374971f8d6f629d9d8f818c0e661bad14 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 24 May 2024 21:59:17 +0900 Subject: [PATCH 31/32] remove todo Signed-off-by: Yutaka Kondo --- docker/run.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index 6301bcb0f1c..ab4becedb1e 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -106,9 +106,6 @@ set_variables() { fi # Mount data path if provided - if [ ! -d "$DATA_PATH" ]; then - # TODO(youtalk) - fi DATA="-v ${DATA_PATH}:/autoware_data:ro" # Mount map path if provided From 6b744d5328072c36cdaaceca288a5553679cf619 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 24 May 2024 22:26:48 +0900 Subject: [PATCH 32/32] revert run Signed-off-by: Yutaka Kondo --- docker/run.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index ab4becedb1e..ebcd32ff29e 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -30,13 +30,13 @@ DEFAULT_LAUNCH_CMD="ros2 launch autoware_launch autoware.launch.xml data_path:=/ # Function to print help message print_help() { echo -e "\n------------------------------------------------------------" - echo -e "${RED}Note:${NC} The --data-path and --map-path options are mandatory if not custom launch command given. Please provide exact paths to the data and map files." + echo -e "${RED}Note:${NC} The --map-path option is mandatory if not custom launch command given. Please provide exact path to the map files." echo -e " Default launch command: ${GREEN}${DEFAULT_LAUNCH_CMD}${NC}" echo -e "------------------------------------------------------------" echo -e "${RED}Usage:${NC} run.sh [OPTIONS] [LAUNCH_CMD](optional)" echo -e "Options:" echo -e " ${GREEN}--help/-h${NC} Display this help message" - echo -e " ${GREEN}--data-path${NC} Specify to mount data files into /autoware_data (mandatory if no custom launch command is provided)" + echo -e " ${GREEN}--data-path${NC} Specify to mount data files into /autoware_data" echo -e " ${GREEN}--map-path${NC} Specify to mount map files into /autoware_map (mandatory if no custom launch command is provided)" echo -e " ${GREEN}--no-nvidia${NC} Disable NVIDIA GPU support" echo -e " ${GREEN}--devel${NC} Use the latest development version of Autoware" @@ -95,17 +95,13 @@ parse_arguments() { # Set image and workspace variables set_variables() { - # Check if data and map paths are provided for default launch command - if [ "$DATA_PATH" == "" ] && [ "$LAUNCH_CMD" == "" ]; then - print_help - exit 1 - fi + # Check if map path is provided for default launch command if [ "$MAP_PATH" == "" ] && [ "$LAUNCH_CMD" == "" ]; then print_help exit 1 fi - # Mount data path if provided + # Mount data path DATA="-v ${DATA_PATH}:/autoware_data:ro" # Mount map path if provided