Skip to content

Commit

Permalink
feat(docker): install CUDA drivers in autoware:base image (#5159)
Browse files Browse the repository at this point in the history
* install cuda on base

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* change suffix

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

---------

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
  • Loading branch information
youtalk authored Sep 4, 2024
1 parent 28deda8 commit d5568e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ansible/playbooks/openadkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG BASE_IMAGE
FROM $BASE_IMAGE AS base

Check warning on line 4 in docker/Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build-and-push (no-cuda)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $BASE_IMAGE results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 4 in docker/Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build-and-push (cuda)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $BASE_IMAGE results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 4 in docker/Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build (no-cuda)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $BASE_IMAGE results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 4 in docker/Dockerfile

View workflow job for this annotation

GitHub Actions / docker-build (cuda)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $BASE_IMAGE results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
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 \
Expand All @@ -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
Expand Down Expand Up @@ -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 \

This comment has been minimized.

Copy link
@isouf

isouf Sep 9, 2024

@youtalk this command will not run autoware.dev_env.cuda role. The autoware.dev_env.cuda role will only run if module == 'base' and prompt_install_nvidia=='y'.

&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

Expand Down

0 comments on commit d5568e0

Please sign in to comment.