From d5568e061bc3c39b4d269b145aff9b749b4a1245 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 4 Sep 2024 10:55:59 +0900 Subject: [PATCH] feat(docker): install CUDA drivers in `autoware:base` image (#5159) * install cuda on base Signed-off-by: Yutaka Kondo * change suffix Signed-off-by: Yutaka Kondo --------- Signed-off-by: Yutaka Kondo --- .github/actions/docker-build-and-push/action.yaml | 2 +- ansible/playbooks/openadkit.yaml | 8 ++++---- docker/Dockerfile | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 63b53f7b17f..e28a7edec28 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -98,7 +98,7 @@ runs: bake-target: docker-metadata-action-base flavor: | latest=false - suffix=-base + suffix=-base${{ inputs.tag-suffix }} - name: Docker meta for autoware-core id: meta-autoware-core diff --git a/ansible/playbooks/openadkit.yaml b/ansible/playbooks/openadkit.yaml index 46a8757229f..5cfa0408d58 100644 --- a/ansible/playbooks/openadkit.yaml +++ b/ansible/playbooks/openadkit.yaml @@ -26,16 +26,16 @@ when: module == 'base' - role: autoware.dev_env.pacmod when: module == 'base' + - role: autoware.dev_env.cuda + when: module == 'base' and prompt_install_nvidia=='y' + - role: autoware.dev_env.tensorrt + when: module == 'base' and prompt_install_nvidia=='y' - role: autoware.dev_env.build_tools when: module == 'all' and install_devel=='y' # Module specific dependencies - role: autoware.dev_env.geographiclib when: module == 'perception-localization' or module == 'all' - - role: autoware.dev_env.cuda - when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - - role: autoware.dev_env.tensorrt - when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' # Development environment - role: autoware.dev_env.dev_tools diff --git a/docker/Dockerfile b/docker/Dockerfile index 440a3192bfa..37546ea600f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,6 +4,7 @@ ARG BASE_IMAGE FROM $BASE_IMAGE AS base SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO +ARG SETUP_ARGS # Install apt packages and add GitHub to known hosts for private repositories RUN rm -f /etc/apt/apt.conf.d/docker-clean \ @@ -24,7 +25,7 @@ WORKDIR /autoware # Set up base environment RUN --mount=type=ssh \ --mount=type=cache,target=/var/cache/apt,sharing=locked \ - ./setup-dev-env.sh -y --module base --runtime openadkit \ + ./setup-dev-env.sh -y --module base ${SETUP_ARGS} --no-cuda-drivers --runtime openadkit \ && pip uninstall -y ansible ansible-core \ && apt-get autoremove -y && rm -rf "$HOME"/.cache \ && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc @@ -94,13 +95,12 @@ RUN rosdep keys --dependency-types=exec --ignore-src --from-paths src \ FROM base AS autoware-core SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO -ARG SETUP_ARGS ENV CCACHE_DIR="/root/.ccache" # Set up development environment RUN --mount=type=ssh \ --mount=type=cache,target=/var/cache/apt,sharing=locked \ - ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadkit \ + ./setup-dev-env.sh -y --module all openadkit \ && pip uninstall -y ansible ansible-core \ && apt-get autoremove -y && rm -rf "$HOME"/.cache