From 07265c7cd5a629a6d4e72007be9860d6309196e6 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:06:39 +0900 Subject: [PATCH 01/18] add base image workflow Signed-off-by: Yutaka Kondo --- .../docker-build-and-push-base/action.yaml | 63 +++++++++++++++++++ .github/workflows/autoware-base.yaml | 38 +++++++++++ docker/Dockerfile.base | 48 ++++++++++++++ docker/docker-bake-base.hcl | 22 +++++++ 4 files changed, 171 insertions(+) create mode 100644 .github/actions/docker-build-and-push-base/action.yaml create mode 100644 .github/workflows/autoware-base.yaml create mode 100644 docker/Dockerfile.base create mode 100644 docker/docker-bake-base.hcl diff --git a/.github/actions/docker-build-and-push-base/action.yaml b/.github/actions/docker-build-and-push-base/action.yaml new file mode 100644 index 0000000000..560e208c4b --- /dev/null +++ b/.github/actions/docker-build-and-push-base/action.yaml @@ -0,0 +1,63 @@ +name: docker-build-and-push-base +description: Composite action to build and push base images to registry. + +inputs: + target-image: + description: Target docker image name in the registry. + required: true + build-args: + description: Additional build args. + required: false + +runs: + using: composite + steps: + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Get current date + id: date + run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT + shell: bash + + - name: Docker meta for autoware-base:latest + id: meta-base + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=${{ steps.date.outputs.date }} + bake-target: docker-metadata-action-base + flavor: | + latest=true + + - name: Docker meta for autoware-base:latest-cuda + id: meta-base-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=latest-cuda + type=raw,value=cuda-${{ steps.date.outputs.date }} + bake-target: docker-metadata-action-base-cuda + flavor: | + latest=false + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} + + - name: Build and Push to GitHub Container Registry + uses: docker/bake-action@v5 + with: + push: true + files: | + docker/docker-bake.hcl + ${{ steps.meta-base.outputs.bake-file }} + ${{ steps.meta-base-cuda.outputs.bake-file }} + provenance: false + set: | + ${{ inputs.build-args }} diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml new file mode 100644 index 0000000000..695f0ba360 --- /dev/null +++ b/.github/workflows/autoware-base.yaml @@ -0,0 +1,38 @@ +name: autoware-base + +on: + push: + branches: + - main + tags: + workflow_dispatch: + +jobs: + load-env: + uses: ./.github/workflows/load-env.yaml + + docker-build-and-push: + needs: load-env + runs-on: ubuntu-22.04 + steps: + - name: Check out this repository + uses: actions/checkout@v4 + + - name: Check out autowarefoundation/autoware repository + uses: actions/checkout@v4 + with: + repository: autowarefoundation/autoware + path: 'autoware' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build Autoware's base images + uses: ./.github/actions/docker-build-and-push-base + with: + name: autoware-base + target-image: docker-bake-base.hcl + build-args: | + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + tag-prefix: ${{ needs.load-env.outputs.rosdistro }} diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base new file mode 100644 index 0000000000..9a9344fb13 --- /dev/null +++ b/docker/Dockerfile.base @@ -0,0 +1,48 @@ +ARG BASE_IMAGE + +# hadolint ignore=DL3006 +FROM $BASE_IMAGE AS base +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +# Copy files +COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /autoware/ +COPY ansible/ /autoware/ansible/ +COPY docker/scripts/cleanup_apt.sh /autoware/cleanup_apt.sh +RUN chmod +x /autoware/cleanup_apt.sh +WORKDIR /autoware + +# Install apt packages and add GitHub to known hosts for private repositories +RUN rm -f /etc/apt/apt.conf.d/docker-clean \ + && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + gosu \ + ssh \ + && /autoware/cleanup_apt.sh \ + && mkdir -p ~/.ssh \ + && ssh-keyscan github.com >> ~/.ssh/known_hosts + +# Set up base environment +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module base --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh \ + && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc + +# Create entrypoint +COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh +RUN chmod +x /ros_entrypoint.sh +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM base AS base-cuda +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Set up CUDA runtime environment and artifacts +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + ./setup-dev-env.sh -y --module base --download-artifacts --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh true diff --git a/docker/docker-bake-base.hcl b/docker/docker-bake-base.hcl new file mode 100644 index 0000000000..43cb7facc0 --- /dev/null +++ b/docker/docker-bake-base.hcl @@ -0,0 +1,22 @@ +group "default" { + targets = [ + "base", + "base-cuda" + ] +} + +// For docker/metadata-action +target "docker-metadata-action-base" {} +target "docker-metadata-action-base-cuda" {} + +target "base" { + inherits = ["docker-metadata-action-base"] + dockerfile = "docker/Dockerfile.base" + target = "base" +} + +target "base-cuda" { + inherits = ["docker-metadata-action-base-cuda"] + dockerfile = "docker/Dockerfile.base" + target = "base-cuda" +} From bb9f18a787535831d1bbe162774b2f3328311229 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:11:48 +0900 Subject: [PATCH 02/18] MUST REVERT Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index 695f0ba360..86900db6fb 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -1,6 +1,7 @@ name: autoware-base on: + pull_request: push: branches: - main From 54c47920c4afb33f78b441f94e39ee522842ee6b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:14:25 +0900 Subject: [PATCH 03/18] rename Signed-off-by: Yutaka Kondo --- .github/actions/docker-build-and-push-base/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build-and-push-base/action.yaml b/.github/actions/docker-build-and-push-base/action.yaml index 560e208c4b..680e642f8d 100644 --- a/.github/actions/docker-build-and-push-base/action.yaml +++ b/.github/actions/docker-build-and-push-base/action.yaml @@ -37,7 +37,7 @@ runs: with: images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} tags: | - type=raw,value=latest-cuda + type=raw,value=cuda-latest type=raw,value=cuda-${{ steps.date.outputs.date }} bake-target: docker-metadata-action-base-cuda flavor: | From 50ed3958bd65c504d0dce46e762811191efbb154 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:15:52 +0900 Subject: [PATCH 04/18] rename Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index 86900db6fb..e2640012ee 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -12,7 +12,7 @@ jobs: load-env: uses: ./.github/workflows/load-env.yaml - docker-build-and-push: + docker-build-and-push-base: needs: load-env runs-on: ubuntu-22.04 steps: From 4f847bff47cf35705782e0d7252f91295f5e0b72 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:18:44 +0900 Subject: [PATCH 05/18] fix with Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index e2640012ee..57032140d7 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -31,9 +31,7 @@ jobs: - name: Build Autoware's base images uses: ./.github/actions/docker-build-and-push-base with: - name: autoware-base - target-image: docker-bake-base.hcl + target-image: autoware-base build-args: | *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} - tag-prefix: ${{ needs.load-env.outputs.rosdistro }} From efe264ffdbc3e275516988ab506f8d0f19de85a0 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:19:29 +0900 Subject: [PATCH 06/18] change run Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index 57032140d7..f50556c164 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -14,7 +14,7 @@ jobs: docker-build-and-push-base: needs: load-env - runs-on: ubuntu-22.04 + runs-on: buildjet-16vcpu-ubuntu-2204 steps: - name: Check out this repository uses: actions/checkout@v4 From b84711938e3a1c28f5faa38c574dcafce6a9c77b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:21:57 +0900 Subject: [PATCH 07/18] fix hcl Signed-off-by: Yutaka Kondo --- .github/actions/docker-build-and-push-base/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build-and-push-base/action.yaml b/.github/actions/docker-build-and-push-base/action.yaml index 680e642f8d..92238bcc54 100644 --- a/.github/actions/docker-build-and-push-base/action.yaml +++ b/.github/actions/docker-build-and-push-base/action.yaml @@ -55,7 +55,7 @@ runs: with: push: true files: | - docker/docker-bake.hcl + docker/docker-bake-base.hcl ${{ steps.meta-base.outputs.bake-file }} ${{ steps.meta-base-cuda.outputs.bake-file }} provenance: false From a3ec7f0709f7383c64646c0b9c6ee693bea32dea Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:47:25 +0900 Subject: [PATCH 08/18] add platform Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index f50556c164..9da25b6725 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -33,5 +33,6 @@ jobs: with: target-image: autoware-base build-args: | + *.platform=linux/amd64,linux/arm64 *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} From e3265cfd36dca090395e4c4313a93ebb80ba23df Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 19:49:21 +0900 Subject: [PATCH 09/18] fix description Signed-off-by: Yutaka Kondo --- .github/actions/docker-build-and-push-base/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build-and-push-base/action.yaml b/.github/actions/docker-build-and-push-base/action.yaml index 92238bcc54..8a5a779904 100644 --- a/.github/actions/docker-build-and-push-base/action.yaml +++ b/.github/actions/docker-build-and-push-base/action.yaml @@ -31,7 +31,7 @@ runs: flavor: | latest=true - - name: Docker meta for autoware-base:latest-cuda + - name: Docker meta for autoware-base:cuda-latest id: meta-base-cuda uses: docker/metadata-action@v5 with: From c29513aabcc70a792fc1eba414e01e485451ce4e Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 20:12:36 +0900 Subject: [PATCH 10/18] remove checkout Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index 9da25b6725..455325f5e9 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -19,12 +19,6 @@ jobs: - name: Check out this repository uses: actions/checkout@v4 - - name: Check out autowarefoundation/autoware repository - uses: actions/checkout@v4 - with: - repository: autowarefoundation/autoware - path: 'autoware' - - name: Set up QEMU uses: docker/setup-qemu-action@v3 From f775d194c0c832c4a75d4ecdf2a2d67a1b6273fb Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 22 Nov 2024 21:09:34 +0900 Subject: [PATCH 11/18] Revert "MUST REVERT" This reverts commit bb9f18a787535831d1bbe162774b2f3328311229. --- .github/workflows/autoware-base.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index 455325f5e9..c4a3f2a89a 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -1,7 +1,6 @@ name: autoware-base on: - pull_request: push: branches: - main From 728a0ebacecaa395ce76b0ad6d40f53b6705e54f Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 13:39:40 +0900 Subject: [PATCH 12/18] remove entrypoint Signed-off-by: Yutaka Kondo --- docker/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2a9047076c..8a82503b6d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,7 +36,6 @@ RUN --mount=type=ssh \ # Create entrypoint COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh RUN chmod +x /ros_entrypoint.sh -ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] FROM base AS base-cuda From d37c720ec3ebfbe255e6423454a325e8f038ddac Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 13:47:53 +0900 Subject: [PATCH 13/18] remove entrypoint Signed-off-by: Yutaka Kondo --- docker/Dockerfile.base | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 9a9344fb13..dca6fb8a0f 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -34,7 +34,6 @@ RUN --mount=type=ssh \ # Create entrypoint COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh RUN chmod +x /ros_entrypoint.sh -ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] FROM base AS base-cuda From 01843f49fc0d534687781587b3a3f6ae0847ebf0 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 14:07:05 +0900 Subject: [PATCH 14/18] use autoware-base images Signed-off-by: Yutaka Kondo --- amd64.env | 2 ++ docker/Dockerfile | 74 ++++++++++++----------------------------------- 2 files changed, 20 insertions(+), 56 deletions(-) diff --git a/amd64.env b/amd64.env index 38eadee0a9..22e12b03f5 100644 --- a/amd64.env +++ b/amd64.env @@ -1,6 +1,8 @@ rosdistro=humble rmw_implementation=rmw_cyclonedds_cpp base_image=ros:humble-ros-base-jammy +autoware_base_image=ghcr.io/youtalk/autoware-base:latest +autoware_base_cuda_image=ghcr.io/youtalk/autoware-base:cuda-latest cuda_version=12.3 cudnn_version=8.9.5.29-1+cuda12.2 tensorrt_version=8.6.1.6-1+cuda12.0 diff --git a/docker/Dockerfile b/docker/Dockerfile index 8a82503b6d..d2ba84d017 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,52 +1,6 @@ ARG BASE_IMAGE - -# hadolint ignore=DL3006 -FROM $BASE_IMAGE AS base -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -ARG ROS_DISTRO - -# Copy files -COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /autoware/ -COPY ansible/ /autoware/ansible/ -COPY docker/scripts/cleanup_apt.sh /autoware/cleanup_apt.sh -RUN chmod +x /autoware/cleanup_apt.sh -COPY docker/scripts/cleanup_system.sh /autoware/cleanup_system.sh -RUN chmod +x /autoware/cleanup_system.sh -WORKDIR /autoware - -# Install apt packages and add GitHub to known hosts for private repositories -RUN rm -f /etc/apt/apt.conf.d/docker-clean \ - && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache -RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ - gosu \ - ssh \ - && /autoware/cleanup_apt.sh \ - && mkdir -p ~/.ssh \ - && ssh-keyscan github.com >> ~/.ssh/known_hosts - -# Set up base environment -RUN --mount=type=ssh \ - --mount=type=cache,target=/var/cache/apt,sharing=locked \ - ./setup-dev-env.sh -y --module base --no-nvidia --no-cuda-drivers --runtime openadkit \ - && pip uninstall -y ansible ansible-core \ - && /autoware/cleanup_apt.sh \ - && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc - -# Create entrypoint -COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh -RUN chmod +x /ros_entrypoint.sh -CMD ["/bin/bash"] - -FROM base AS base-cuda -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -# Set up CUDA runtime environment and artifacts -# hadolint ignore=SC2002 -RUN --mount=type=ssh \ - ./setup-dev-env.sh -y --module base --download-artifacts --no-cuda-drivers --runtime openadkit \ - && pip uninstall -y ansible ansible-core \ - && /autoware/cleanup_apt.sh true +ARG AUTOWARE_BASE_IMAGE +ARG AUTOWARE_BASE_CUDA_IMAGE # hadolint ignore=DL3006 FROM $BASE_IMAGE AS rosdep-depend @@ -158,7 +112,8 @@ RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ > /rosdep-exec-depend-packages.txt \ && cat /rosdep-exec-depend-packages.txt -FROM base AS core-devel +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS core-devel SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ENV CCACHE_DIR="/root/.ccache" @@ -413,7 +368,8 @@ COPY --from=universe-devel /opt/autoware /opt/autoware ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base AS universe-sensing-perception +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-sensing-perception SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR @@ -438,7 +394,8 @@ RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base-cuda AS universe-sensing-perception-cuda +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_CUDA_IMAGE AS universe-sensing-perception-cuda SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR @@ -459,7 +416,8 @@ COPY --from=universe-sensing-perception-devel-cuda /opt/autoware /opt/autoware ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base AS universe-localization-mapping +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-localization-mapping SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR @@ -484,7 +442,8 @@ RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base AS universe-planning-control +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-planning-control SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR @@ -509,7 +468,8 @@ RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base AS universe-vehicle-system +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-vehicle-system SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR @@ -534,7 +494,8 @@ RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base AS universe +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR @@ -559,7 +520,8 @@ RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] -FROM base-cuda AS universe-cuda +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_CUDA_IMAGE AS universe-cuda SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR From a0761d05748fdc6c5469b5592334c656dfc41c6f Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 14:08:58 +0900 Subject: [PATCH 15/18] update health-check Signed-off-by: Yutaka Kondo --- .github/workflows/health-check-arm64.yaml | 2 ++ .github/workflows/health-check-nightly.yaml | 2 ++ .github/workflows/health-check.yaml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/health-check-arm64.yaml b/.github/workflows/health-check-arm64.yaml index ec14237312..acefa7fa3c 100644 --- a/.github/workflows/health-check-arm64.yaml +++ b/.github/workflows/health-check-arm64.yaml @@ -34,6 +34,8 @@ jobs: build-args: | ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} LIB_DIR=aarch64 - name: Show disk space diff --git a/.github/workflows/health-check-nightly.yaml b/.github/workflows/health-check-nightly.yaml index ae79cabdeb..78351e13eb 100644 --- a/.github/workflows/health-check-nightly.yaml +++ b/.github/workflows/health-check-nightly.yaml @@ -50,6 +50,8 @@ jobs: build-args: | ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} LIB_DIR=x86_64 - name: Show disk space diff --git a/.github/workflows/health-check.yaml b/.github/workflows/health-check.yaml index d65a3239cf..829a526441 100644 --- a/.github/workflows/health-check.yaml +++ b/.github/workflows/health-check.yaml @@ -44,6 +44,8 @@ jobs: build-args: | ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} LIB_DIR=x86_64 - name: Show disk space From 04a15a7b22f3a3ec489fa3591e71f3c1bd748b4d Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 14:53:40 +0900 Subject: [PATCH 16/18] update load-env Signed-off-by: Yutaka Kondo --- .github/workflows/load-env.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/load-env.yaml b/.github/workflows/load-env.yaml index ff7f24b688..477adfc908 100644 --- a/.github/workflows/load-env.yaml +++ b/.github/workflows/load-env.yaml @@ -28,5 +28,7 @@ jobs: - name: Set env id: set-env run: | - echo "base_image=${{ env.base_image }}" >> $GITHUB_OUTPUT echo "rosdistro=${{ env.rosdistro }}" >> $GITHUB_OUTPUT + echo "base_image=${{ env.base_image }}" >> $GITHUB_OUTPUT + echo "autoware_base_image=${{ env.autoware_base_image }}" >> $GITHUB_OUTPUT + echo "autoware_base_cuda_image=${{ env.autoware_base_cuda_image }}" >> $GITHUB_OUTPUT From 040e4aa3c4eb40a7adb9011023b50338926e197b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 15:24:15 +0900 Subject: [PATCH 17/18] update load-env Signed-off-by: Yutaka Kondo --- .github/workflows/load-env.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/load-env.yaml b/.github/workflows/load-env.yaml index 477adfc908..48af4b3a14 100644 --- a/.github/workflows/load-env.yaml +++ b/.github/workflows/load-env.yaml @@ -3,17 +3,23 @@ name: load-env on: workflow_call: outputs: - base_image: - value: ${{ jobs.load-env.outputs.base_image }} rosdistro: value: ${{ jobs.load-env.outputs.rosdistro }} + base_image: + value: ${{ jobs.load-env.outputs.base_image }} + autoware_base_image: + value: ${{ jobs.load-env.outputs.autoware_base_image }} + autoware_base_cuda_image: + value: ${{ jobs.load-env.outputs.autoware_base_cuda_image }} jobs: load-env: runs-on: ubuntu-22.04 outputs: - base_image: ${{ steps.set-env.outputs.base_image }} rosdistro: ${{ steps.set-env.outputs.rosdistro }} + base_image: ${{ steps.set-env.outputs.base_image }} + autoware_base_image: ${{ steps.set-env.outputs.autoware_base_image }} + autoware_base_cuda_image: ${{ steps.set-env.outputs.autoware_base_cuda_image }} steps: - name: Check out repository uses: actions/checkout@v4 From a4f81ed95acddf1f52caa99430afb3424cebe8eb Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 15:54:42 +0900 Subject: [PATCH 18/18] add cleanup_system Signed-off-by: Yutaka Kondo --- docker/Dockerfile.base | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index dca6fb8a0f..516870c7bb 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -10,6 +10,8 @@ COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /auto COPY ansible/ /autoware/ansible/ COPY docker/scripts/cleanup_apt.sh /autoware/cleanup_apt.sh RUN chmod +x /autoware/cleanup_apt.sh +COPY docker/scripts/cleanup_system.sh /autoware/cleanup_system.sh +RUN chmod +x /autoware/cleanup_system.sh WORKDIR /autoware # Install apt packages and add GitHub to known hosts for private repositories