From a4bb402b18b852a43cdfd496bf46274bf7b501d9 Mon Sep 17 00:00:00 2001 From: Dogan Ulus Date: Fri, 9 Aug 2024 22:12:21 +0300 Subject: [PATCH] Update containers --- containers/autoware-devel/Dockerfile | 56 +++++++++++++------------- containers/autoware-runtime/Dockerfile | 14 ++++--- etc/autoware/autoware.repos.yml | 28 ++++++------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/containers/autoware-devel/Dockerfile b/containers/autoware-devel/Dockerfile index 9e9c5b2..02d74a2 100644 --- a/containers/autoware-devel/Dockerfile +++ b/containers/autoware-devel/Dockerfile @@ -49,15 +49,15 @@ RUN groupadd bounverif -g 1000 && \ echo 'bounverif:bounverif' | chpasswd \ printf "%s ALL= NOPASSWD: ALL\\n" bounverif >> /etc/sudoers -ENV \ -ROS_DISTRO=humble \ -AUTOWARE_ROOT=/root/autoware \ -AUTOWARE_SOURCE_DIR=/root/autoware/src \ -AUTOWARE_BUILD_DIR=/root/autoware/build \ -AUTOWARE_INSTALL_DIR=/opt/autoware \ -AUTOWARE_DATA_DIR=/opt/autoware/data +ENV ROS_DISTRO=humble +ENV AUTOWARE_DEVEL_ROOT=/root/autoware +ENV AUTOWARE_DEVEL_SOURCE_DIR=/root/autoware/src +ENV AUTOWARE_DEVEL_BUILD_DIR=/root/autoware/build +ENV AUTOWARE_DEVEL_INSTALL_DIR=/root/autoware/autoware +ENV AUTOWARE_DEVEL_DATA_DIR=/root/autoware/data ARG AUTOWARE_VERSION +ENV AUTOWARE_VERSION=${AUTOWARE_VERSION:-latest} ENV AUTOWARE_DEVEL_VERSION=${AUTOWARE_VERSION:-latest} FROM ${IMAGE_NAME}:${AUTOWARE_VERSION}-base AS autoware-source @@ -72,9 +72,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM} python3-vcstool \ && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* -RUN --mount=type=bind,source=etc/autoware/autoware.repos.yml,target=/etc/autoware/autoware.repos.yml \ - mkdir -p ${AUTOWARE_SOURCE_DIR} && \ - vcs import --shallow ${AUTOWARE_SOURCE_DIR} < /etc/autoware/autoware.repos.yml +COPY etc/autoware/autoware.repos.yml /etc/autoware/autoware.repos.yml + +RUN mkdir -p ${AUTOWARE_DEVEL_SOURCE_DIR} && \ + vcs import --shallow ${AUTOWARE_DEVEL_SOURCE_DIR} < /etc/autoware/autoware.repos.yml FROM ${IMAGE_NAME}:${AUTOWARE_VERSION}-base AS autoware-builder ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT @@ -96,20 +97,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM} ansible-core \ && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* -RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target=${AUTOWARE_SOURCE_DIR} \ - --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM}/var/cache/apt \ - mkdir -p /etc/autoware && \ - vcs export --exact ${AUTOWARE_SOURCE_DIR} > /etc/autoware/autoware.repos.${AUTOWARE_DEVEL_VERSION}.yml && \ - export DEBIAN_FRONTEND=noninteractive && \ - apt-get update && \ - rosdep init && \ - rosdep update -q && \ - rosdep install -qy \ - --from-paths ${AUTOWARE_SOURCE_DIR} \ - --ignore-src \ - --rosdistro ${ROS_DISTRO} \ - && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* - # CUDA Toolkit Installation ARG CUDA_TOOLKIT_VERSION_MAJOR=12 ARG CUDA_TOOLKIT_VERSION_MINOR=6 @@ -131,6 +118,20 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM} RUN update-alternatives --set cuda /usr/local/cuda-${CUDA_TOOLKIT_VERSION_MAJOR}.${CUDA_TOOLKIT_VERSION_MINOR} +RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_DEVEL_SOURCE_DIR},target=${AUTOWARE_DEVEL_SOURCE_DIR} \ + --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM}/var/cache/apt \ + mkdir -p /etc/autoware && \ + vcs export --exact ${AUTOWARE_DEVEL_SOURCE_DIR} > /etc/autoware/autoware.repos.${AUTOWARE_DEVEL_VERSION}.yml && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + rosdep init && \ + rosdep update -q && \ + rosdep install -qy \ + --from-paths ${AUTOWARE_DEVEL_SOURCE_DIR} \ + --ignore-src \ + --rosdistro ${ROS_DISTRO} \ + && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* + # Build environment management ENV \ CMAKE_BUILD_TYPE=Release \ @@ -149,9 +150,9 @@ ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT # This build is only for producing a build cache to be saved in the image. # Hence, we do not want build artifacts and logs. # -RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target=${AUTOWARE_SOURCE_DIR} \ +RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_DEVEL_SOURCE_DIR},target=${AUTOWARE_DEVEL_SOURCE_DIR} \ mkdir -p /tmp/autoware && \ - ln -s ${AUTOWARE_SOURCE_DIR} /tmp/autoware/src && \ + ln -s ${AUTOWARE_DEVEL_SOURCE_DIR} /tmp/autoware/src && \ . /opt/ros/${ROS_DISTRO}/setup.sh && \ export CCACHE_BASEDIR=/tmp/autoware && \ colcon --log-base /dev/null build \ @@ -172,7 +173,8 @@ RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target= --cmake-args \ " -Wno-dev" \ " --no-warn-unused-cli" \ - && rm -rf /tmp/autoware/ + && rm -rf /tmp/autoware/ \ + && ccache --zero-stats FROM ${IMAGE_NAME}:${AUTOWARE_VERSION}-builder-with-cache AS autoware-devel ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT diff --git a/containers/autoware-runtime/Dockerfile b/containers/autoware-runtime/Dockerfile index 775a3e4..83597a5 100644 --- a/containers/autoware-runtime/Dockerfile +++ b/containers/autoware-runtime/Dockerfile @@ -2,10 +2,11 @@ ARG IMAGE_NAME=localhost/autoware ARG AUTOWARE_VERSION=latest FROM ${IMAGE_NAME}:latest-builder-with-cache AS autoware-prebuilt -# ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT +ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT ARG AUTOWARE_PACKAGES_UP_TO=autoware_launch -WORKDIR ${AUTOWARE_ROOT} + +WORKDIR ${AUTOWARE_DEVEL_ROOT} RUN --mount=type=bind,source=etc/autoware/autoware.repos.yml,target=/etc/autoware/autoware.repos.yml set -ex \ ; mkdir -p src \ @@ -45,11 +46,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM} ; apt-get autoremove -y \ ; rm -rf /var/lib/apt/lists/* -COPY --from=autoware-prebuilt ${AUTOWARE_ROOT}/install ${AUTOWARE_INSTALL_DIR} - -ENV NVIDIA_VISIBLE_DEVICES=all -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics +ENV AUTOWARE_INSTALL_DIR=/opt/autoware +COPY --from=autoware-prebuilt ${AUTOWARE_DEVEL_ROOT}/install ${AUTOWARE_INSTALL_DIR} ARG AUTOWARE_VERSION ENV AUTOWARE_RUNTIME_VERSION=${AUTOWARE_VERSION:-latest} RUN echo "AUTOWARE_RUNTIME_VERSION=${AUTOWARE_RUNTIME_VERSION}" >> /etc/environment + +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics diff --git a/etc/autoware/autoware.repos.yml b/etc/autoware/autoware.repos.yml index 1ebbeb8..6f3a937 100644 --- a/etc/autoware/autoware.repos.yml +++ b/etc/autoware/autoware.repos.yml @@ -33,10 +33,6 @@ repositories: type: git url: https://github.com/autowarefoundation/autoware.core.git version: main - core/external/autoware_auto_msgs: # TODO(mfc): Remove when autoware_msgs is merged - type: git - url: https://github.com/tier4/autoware_auto_msgs.git - version: tier4/main # universe universe/autoware.universe: type: git @@ -122,18 +118,18 @@ repositories: # url: https://github.com/autowarefoundation/awsim_labs_sensor_kit_launch.git # version: main # vehicle - vehicle/sample_vehicle_launch: - type: git - url: https://github.com/autowarefoundation/sample_vehicle_launch.git - version: main - vehicle/external/pacmod_interface: - type: git - url: https://github.com/tier4/pacmod_interface.git - version: main - vehicle/external/pacmod3_msgs: - type: git - url: https://github.com/astuff/pacmod3_msgs.git - version: 1.0.0 + # vehicle/sample_vehicle_launch: + # type: git + # url: https://github.com/autowarefoundation/sample_vehicle_launch.git + # version: main + # vehicle/external/pacmod_interface: + # type: git + # url: https://github.com/tier4/pacmod_interface.git + # version: main + # vehicle/external/pacmod3_msgs: + # type: git + # url: https://github.com/astuff/pacmod3_msgs.git + # version: 1.0.0 # param param/autoware_individual_params: type: git