From 8517ed14bc61427d1b7f5080d779f075227626ac Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 20 Nov 2024 12:27:08 +0900 Subject: [PATCH] refine cuda related pkgs build Signed-off-by: Yutaka Kondo --- docker/Dockerfile | 16 +++------------- docker/scripts/build_and_clean.sh | 4 +++- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8e9c9532a9..107996740b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -272,21 +272,11 @@ COPY --from=universe-sensing-perception-devel /opt/autoware /opt/autoware # hadolint ignore=SC1091 RUN --mount=type=cache,target=${CCACHE_DIR} \ - # TODO(youtalk): Move CUDA related packages into a dedicated directory - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_bytetrack,target=/autoware/src/universe/autoware.universe/perception/autoware_bytetrack \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_lidar_apollo_instance_segmentation,target=/autoware/src/universe/autoware.universe/perception/autoware_lidar_apollo_instance_segmentation \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_lidar_centerpoint,target=/autoware/src/universe/autoware.universe/perception/autoware_lidar_centerpoint \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_lidar_transfusion,target=/autoware/src/universe/autoware.universe/perception/autoware_lidar_transfusion \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_shape_estimation,target=/autoware/src/universe/autoware.universe/perception/autoware_shape_estimation \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_classifier,target=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_classifier \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_common,target=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_common \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_yolox,target=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_yolox \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_classifier,target=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_classifier \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_fine_detector,target=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_fine_detector \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/sensing/autoware_cuda_utils,target=/autoware/src/universe/autoware.universe/sensing/autoware_cuda_utils \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception,target=/autoware/src/universe/autoware.universe/perception \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/sensing,target=/autoware/src/universe/autoware.universe/sensing \ source /opt/ros/"$ROS_DISTRO"/setup.bash \ && source /opt/autoware/setup.bash \ - && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware "--packages-up-to autoware_tensorrt_common" ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] diff --git a/docker/scripts/build_and_clean.sh b/docker/scripts/build_and_clean.sh index 53c968ef72..36ea5838c7 100755 --- a/docker/scripts/build_and_clean.sh +++ b/docker/scripts/build_and_clean.sh @@ -3,6 +3,7 @@ function build_and_clean() { local ccache_dir=$1 local install_base=$2 + local colcon_build_args=$3 du -sh "$ccache_dir" && ccache -s && colcon build --cmake-args \ @@ -10,7 +11,8 @@ function build_and_clean() { " --no-warn-unused-cli" \ --merge-install \ --install-base "$install_base" \ - --mixin release compile-commands ccache && + --mixin release compile-commands ccache \ + "$colcon_build_args" && du -sh "$ccache_dir" && ccache -s && rm -rf /autoware/build /autoware/log }