Skip to content

Commit

Permalink
Refactor environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Sep 10, 2024
1 parent 02afd07 commit ae58abe
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions containers/autoware-devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ ENV AUTOWARE_DEVEL_ROOT=/root/autoware
ENV AUTOWARE_DEVEL_SOURCE_DIR=${AUTOWARE_DEVEL_ROOT}/src
ENV AUTOWARE_DEVEL_BUILD_DIR=${AUTOWARE_DEVEL_ROOT}/build
ENV AUTOWARE_DEVEL_INSTALL_DIR=${AUTOWARE_DEVEL_ROOT}/install
ENV AUTOWARE_DEVEL_DATA_DIR=${AUTOWARE_DEVEL_ROOT}/data

ARG AUTOWARE_VERSION
ENV AUTOWARE_VERSION=${AUTOWARE_VERSION:-latest}
ENV AUTOWARE_DEVEL_VERSION=${AUTOWARE_VERSION:-latest}

ARG CUDA_TOOLKIT_VERSION_MAJOR
ARG CUDA_TOOLKIT_VERSION_MINOR
ENV CUDA_TOOLKIT_VERSION_MAJOR=${CUDA_TOOLKIT_VERSION_MAJOR:-12}
ENV CUDA_TOOLKIT_VERSION_MINOR=${CUDA_TOOLKIT_VERSION_MINOR:-6}

FROM ${IMAGE_NAME}:${AUTOWARE_VERSION}-base AS autoware-source
ARG TARGETARCH TARGETOS TARGETPLATFORM TARGETVARIANT

Expand Down Expand Up @@ -103,8 +107,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM}
&& 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
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${TARGETPLATFORM}/var/cache/apt \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update -qq && \
Expand Down Expand Up @@ -138,13 +140,12 @@ RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_DEVEL_SOURCE_DIR},t
&& apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

# Build environment management
ENV \
CMAKE_BUILD_TYPE=Release \
CMAKE_C_COMPILER_LAUNCHER=ccache \
CMAKE_CXX_COMPILER_LAUNCHER=ccache \
CMAKE_CUDA_COMPILER_LAUNCHER=ccache \
CMAKE_EXPORT_COMPILE_COMMANDS=ON \
CMAKE_GENERATOR=Ninja
ENV CMAKE_BUILD_TYPE=Release
ENV CMAKE_C_COMPILER_LAUNCHER=ccache
ENV CMAKE_CXX_COMPILER_LAUNCHER=ccache
ENV CMAKE_CUDA_COMPILER_LAUNCHER=ccache
ENV CMAKE_EXPORT_COMPILE_COMMANDS=ON
ENV CMAKE_GENERATOR=Ninja

# Ccache configuration
COPY etc/ccache.conf /etc/ccache.conf
Expand Down

0 comments on commit ae58abe

Please sign in to comment.