From ae6c9dc1f6be2948351bf48258feb52bc99c5bdd Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Sat, 3 Aug 2024 19:16:58 +0300 Subject: [PATCH] Adjust cache settings --- containers/autoware-devel/Dockerfile | 3 ++- containers/autoware-runtime/Dockerfile | 13 +++++++------ etc/ccache.conf | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/containers/autoware-devel/Dockerfile b/containers/autoware-devel/Dockerfile index e41f097..d7831f0 100644 --- a/containers/autoware-devel/Dockerfile +++ b/containers/autoware-devel/Dockerfile @@ -34,7 +34,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM} ARG AUTOWARE_VERSION ENV AUTOWARE_DEVEL_VERSION=${AUTOWARE_VERSION:-latest} RUN echo "AUTOWARE_DEVEL_VERSION=${AUTOWARE_DEVEL_VERSION}" >> /etc/environment - + # Build arguments ARG \ CUDA_ARCH=x86_64 \ @@ -167,6 +167,7 @@ RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target= --build-base /tmp/autoware/build \ --install-base /tmp/autoware/install \ --packages-up-to autoware_launch \ + --parallel-workers 4 \ --event-handlers \ console_direct- \ console_stderr+ \ diff --git a/containers/autoware-runtime/Dockerfile b/containers/autoware-runtime/Dockerfile index 0c7d68c..cbb5983 100644 --- a/containers/autoware-runtime/Dockerfile +++ b/containers/autoware-runtime/Dockerfile @@ -1,15 +1,16 @@ ARG IMAGE_NAME=localhost/autoware -ARG AUTOWARE_BUILDER_VERSION=latest +ARG AUTOWARE_DEVEL_VERSION=latest ARG AUTOWARE_VERSION=latest -FROM ${IMAGE_NAME}:${AUTOWARE_BUILDER_VERSION}-builder-with-cache AS autoware-prebuilt +FROM ${IMAGE_NAME}:${AUTOWARE_DEVEL_VERSION}-builder-with-cache AS autoware-prebuilt ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT RUN --mount=type=bind,source=etc/autoware/autoware.repos.yml,target=/etc/autoware/autoware.repos.yml set -ex \ ; set -ex \ ; mkdir -p ${AUTOWARE_SOURCE_DIR} \ ; vcs import --shallow ${AUTOWARE_SOURCE_DIR} < /etc/autoware/autoware.repos.yml \ - ; ccache --get-config base_dir \ + ; export CCACHE_DEBUG=1 \ + ; ccache --show-config \ ; ccache --zero-stats \ ; . /opt/ros/${ROS_DISTRO}/setup.sh \ ; colcon --log-base /dev/null build \ @@ -33,7 +34,7 @@ RUN --mount=type=bind,source=etc/autoware/autoware.repos.yml,target=/etc/autowar ; rm -rf ${AUTOWARE_BUILD_DIR} \ ; ccache -v --show-stats -FROM ${IMAGE_NAME}:${AUTOWARE_BUILDER_VERSION}-base AS autoware-runtime +FROM ${IMAGE_NAME}:${AUTOWARE_DEVEL_VERSION}-base AS autoware-runtime ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT # This is not complete. It is just a placeholder for the final image. @@ -41,8 +42,8 @@ ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM}/var/cache/apt set -eux \ ; export DEBIAN_FRONTEND=noninteractive \ ; apt-get -qq update && apt-get install -qqy --no-install-recommends \ - libcublas-12-4 \ - libcurand-12-4 \ + libcublas-${CUDA_TOOLKIT_VERSION_DASHED} \ + libcurand-${CUDA_TOOLKIT_VERSION_DASHED} \ libnvinfer8 \ libnvinfer-plugin8 \ libnvparsers8 \ diff --git a/etc/ccache.conf b/etc/ccache.conf index 0effac5..fd6914e 100644 --- a/etc/ccache.conf +++ b/etc/ccache.conf @@ -3,3 +3,4 @@ # cache_dir=/var/cache/ccache base_dir=/root +debug_dir = /var/cache/ccache/debug \ No newline at end of file