Skip to content

Commit

Permalink
fix(docker): install ros-base according to option --runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Shark Liu <shark.liu@autocore.ai>
  • Loading branch information
Shark Liu committed Feb 21, 2023
1 parent 2746259 commit 5be9c70
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
base_image_env: cuda_base_image
base_image_env: prebuilt_base_image
setup-args: --no-cuda-drivers
additional-tag-suffix: -cuda
steps:
Expand Down Expand Up @@ -54,6 +54,7 @@ jobs:
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.PREBUILT_BASE_IMAGE=${{ env.prebuilt_base_image }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
tag-prefix: ${{ env.rosdistro }}-
tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-build-and-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
base_image_env: cuda_base_image
base_image_env: prebuilt_base_image
setup-args: --no-cuda-drivers
additional-tag-suffix: -cuda
steps:
Expand All @@ -49,6 +49,7 @@ jobs:
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.PREBUILT_BASE_IMAGE=${{ env.prebuilt_base_image }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
tag-prefix: ${{ env.rosdistro }}-
tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64
Expand Down
5 changes: 2 additions & 3 deletions amd64.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
rosdistro=humble
rmw_implementation=rmw_cyclonedds_cpp
base_image=ubuntu:20.04
cuda_base_image=nvidia/cuda:11.6.2-devel-ubuntu20.04
cuda_runtime_base_image=nvidia/cuda:11.6.2-runtime-ubuntu20.04
base_image=ubuntu:22.04
prebuilt_base_image=ubuntu:22.04
cuda_version=11.6
cudnn_version=8.4.1.50-1+cuda11.6
tensorrt_version=8.4.2-1+cuda11.6
1 change: 0 additions & 1 deletion ansible/playbooks/universe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
when: install_devel == 'true'
- role: autoware.dev_env.ros2
- role: autoware.dev_env.ros2_dev_tools
when: install_devel == 'true'
- role: autoware.dev_env.rmw_implementation

# Universe
Expand Down
6 changes: 3 additions & 3 deletions docker/autoware-universe/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG BASE_IMAGE
ARG PREBUILT_BASE_IMAGE
# hadolint ignore=DL3006
FROM $BASE_IMAGE as devel
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down Expand Up @@ -66,9 +67,8 @@ RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \
&& find /autoware/install -type d -exec chmod 777 {} \;

ARG CUDA_RUNTIME_BASE_IMAGE
# hadolint ignore=DL3006
FROM $CUDA_RUNTIME_BASE_IMAGE as prebuilt
FROM $PREBUILT_BASE_IMAGE as prebuilt

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand All @@ -95,7 +95,7 @@ RUN mkdir -p ~/.ssh \

## Set up runtime environment
RUN --mount=type=ssh \
./setup-dev-env.sh -y $SETUP_ARGS --no-cuda-drivers --no-dev --runtime --ros-install-base universe \
./setup-dev-env.sh -y $SETUP_ARGS --no-cuda-drivers --runtime universe \
&& pip uninstall -y ansible ansible-core \
&& mkdir src \
&& vcs import src < autoware.repos \
Expand Down
2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ docker buildx bake --no-cache --load --progress=plain -f "$SCRIPT_DIR/autoware-u
--set "*.platform=$platform" \
--set "*.args.ROS_DISTRO=$rosdistro" \
--set "*.args.BASE_IMAGE=$base_image" \
--set "*.args.PREBUILT_BASE_IMAGE=$prebuilt_base_image" \
--set "*.args.SETUP_ARGS=$setup_args" \
--set "*.args.CUDA_RUNTIME_BASE_IMAGE=$cuda_runtime_base_image" \
--set "devel.tags=ghcr.io/autowarefoundation/autoware-universe:$rosdistro-latest$image_name_suffix" \
--set "prebuilt.tags=ghcr.io/autowarefoundation/autoware-universe:$rosdistro-latest-prebuilt$image_name_suffix" \
"$targets"
Expand Down
4 changes: 0 additions & 4 deletions setup-dev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ while [ "$1" != "" ]; do
# Disable installation of 'cuda-drivers' in the role 'cuda'.
option_no_cuda_drivers=true
;;
--no-dev)
# Disable installation dev packages .
option_no_dev=true
;;
--runtime)
# Disable installation dev package of role 'cuda' and 'tensorrt'.
option_runtime=true
Expand Down

0 comments on commit 5be9c70

Please sign in to comment.