From e03a15005e2131cb959e5f2858b39ac1adea0f7f Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 13 May 2024 13:25:14 +0900 Subject: [PATCH 01/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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