Skip to content

Commit

Permalink
Update containers
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Aug 9, 2024
1 parent cbcb5de commit a4bb402
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 49 deletions.
56 changes: 29 additions & 27 deletions containers/autoware-devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand Down
14 changes: 8 additions & 6 deletions containers/autoware-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
28 changes: 12 additions & 16 deletions etc/autoware/autoware.repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a4bb402

Please sign in to comment.