Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): install CUDA drivers in autoware:base image #5159

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 3 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
ARG BASE_IMAGE

# hadolint ignore=DL3006
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 (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/

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/

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
mitsudome-r marked this conversation as resolved.
Show resolved Hide resolved

# 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 @@
# 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 All @@ -33,7 +34,7 @@
CMD ["/bin/bash"]

# hadolint ignore=DL3006
FROM $BASE_IMAGE AS rosdep-depend

Check warning on line 37 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 37 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 37 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 37 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 37 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/

Check warning on line 37 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/

Check warning on line 37 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 37 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

Expand Down Expand Up @@ -82,13 +83,12 @@
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 \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youtalk this command will not run the autoware.dev_env.cuda role.
The autoware.dev_env.cuda will only run if module == 'base' and prompt_install_nvidia=='y'.
Is it possible that there is a bug here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youtalk what is misleading is the argument --no-cuda-drivers which implies that there are no CUDA drivers?.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Expand Down Expand Up @@ -116,7 +116,6 @@
FROM autoware-core AS autoware-universe
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO
ARG SETUP_ARGS
ENV CCACHE_DIR="/root/.ccache"

# Install rosdep dependencies
Expand Down
Loading