Skip to content

Commit

Permalink
Merge branch 'main' into upstream-autoware-core-stage
Browse files Browse the repository at this point in the history
  • Loading branch information
youtalk authored Jul 11, 2024
2 parents 86953a0 + cc26a02 commit 4ae9c96
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 38 deletions.
2 changes: 0 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ WarningsAsErrors: "

HeaderFilterRegex: ^(?!\/usr)(?!\/opt)

AnalyzeTemporaryDtors: false

FormatStyle: none

CheckOptions:
Expand Down
25 changes: 20 additions & 5 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,37 @@ runs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Restore cache
- name: Restore ccache
uses: actions/cache/restore@v4
with:
path: |
root-ccache
key: cache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('autoware.repos') }}
key: cache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
restore-keys: |
cache-${{ inputs.platform }}-${{ inputs.name }}-
cache-${{ inputs.platform }}-
ccache-${{ inputs.platform }}-${{ inputs.name }}-
ccache-${{ inputs.platform }}-
cache-${{ inputs.platform }}-${{ inputs.name }}- # TODO(youtalk): Remove obsolete cache key
cache-${{ inputs.platform }}- # TODO(youtalk): Remove obsolete cache key
- name: Restore apt-get
uses: actions/cache/restore@v4
with:
path: |
var-cache-apt
var-lib-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
apt-get-${{ inputs.platform }}-
- name: Inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"root-ccache": "/root/.ccache"
"root-ccache": "/root/.ccache",
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt"
}
skip-extraction: true

Expand Down
53 changes: 42 additions & 11 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,68 @@ runs:
vcs import src < autoware.repos
shell: bash

- name: Cache
- name: Cache ccache
uses: actions/cache@v4
if: ${{ inputs.name == 'no-cuda' }}
id: cache
id: cache-ccahce
with:
path: |
root-ccache
key: cache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('autoware.repos') }}
key: cache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
restore-keys: |
cache-${{ inputs.platform }}-${{ inputs.name }}-
cache-${{ inputs.platform }}-
ccache-${{ inputs.platform }}-${{ inputs.name }}-
ccache-${{ inputs.platform }}-
cache-${{ inputs.platform }}-${{ inputs.name }}- # TODO(youtalk): Remove obsolete cache key
cache-${{ inputs.platform }}- # TODO(youtalk): Remove obsolete cache key
- name: Restore cache
- name: Cache apt-get
uses: actions/cache@v4
if: ${{ inputs.name == 'no-cuda' }}
id: cache-apt-get
with:
path: |
var-cache-apt
var-lib-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
apt-get-${{ inputs.platform }}-
- name: Restore ccache
uses: actions/cache/restore@v4
if: ${{ inputs.name != 'no-cuda' }}
with:
path: |
root-ccache
key: cache-${{ matrix.platform }}-${{ matrix.name }}-${{ hashFiles('autoware.repos') }}
key: ccache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/*.cpp') }}
restore-keys: |
ccache-${{ inputs.platform }}-${{ inputs.name }}-
ccache-${{ inputs.platform }}-
cache-${{ inputs.platform }}-${{ inputs.name }}- # TODO(youtalk): Remove obsolete cache key
cache-${{ inputs.platform }}- # TODO(youtalk): Remove obsolete cache key
- name: Restore apt-get
uses: actions/cache/restore@v4
if: ${{ inputs.name != 'no-cuda' }}
with:
path: |
var-cache-apt
var-lib-apt
key: apt-get-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('src/**/package.xml') }}
restore-keys: |
cache-${{ matrix.platform }}-${{ matrix.name }}-
cache-${{ matrix.platform }}-
apt-get-${{ inputs.platform }}-${{ inputs.name }}-
apt-get-${{ inputs.platform }}-
- name: Inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"root-ccache": "/root/.ccache"
"root-ccache": "/root/.ccache",
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
skip-extraction: ${{ steps.cache-ccache.outputs.cache-hit && steps.cache-apt-get.outputs.cache-hit }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/health-check.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
name: health-check

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
schedule:
- cron: 0 12 * * *
workflow_dispatch:

jobs:
label-check:
uses: autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1
with:
label: tag:run-health-check

load-env:
needs: label-check
if: ${{ needs.label-check.outputs.result == 'true' }}
uses: ./.github/workflows/load-env.yaml

docker-build:
Expand Down
10 changes: 5 additions & 5 deletions ansible/roles/artifacts/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,23 @@
- name: Download lidar_transfusion/transfusion.onnx
become: true
ansible.builtin.get_url:
url: https://awf.ml.dev.web.auto/perception/models/transfusion/v1/transfusion.onnx
url: https://awf.ml.dev.web.auto/perception/models/transfusion/t4xx1_90m/v2/transfusion.onnx
dest: "{{ data_dir }}/lidar_transfusion/transfusion.onnx"
mode: "644"
checksum: sha256:8938999cf03770ffd3301027300ea2cbcf471c180450e0434121d7294c42aa0b
checksum: sha256:ad66a061d61449af671bd0d14c2c407f0d749753f17f3165287857f686c4fd1a

- name: Download lidar_transfusion/transfusion.param.yaml
become: true
ansible.builtin.get_url:
url: https://awf.ml.dev.web.auto/perception/models/transfusion/v1/transfusion.param.yaml
url: https://awf.ml.dev.web.auto/perception/models/transfusion/t4xx1_90m/v2/transfusion.param.yaml
dest: "{{ data_dir }}/lidar_transfusion/transfusion.param.yaml"
mode: "644"
checksum: sha256:0e18776040f14e380037ef6ecb500d1d1d151f21ff7d5c890606673f7e100e14
checksum: sha256:fdd8dd21b7c1c0f9a15119fa6a79565f927ce8f6bac4ddf095cb7e27672cb3d8

- name: Download lidar_transfusion/detection_class_remapper.param.yaml
become: true
ansible.builtin.get_url:
url: https://awf.ml.dev.web.auto/perception/models/transfusion/v1/detection_class_remapper.param.yaml
url: https://awf.ml.dev.web.auto/perception/models/transfusion/t4xx1_90m/v2/detection_class_remapper.param.yaml
dest: "{{ data_dir }}/lidar_transfusion/detection_class_remapper.param.yaml"
mode: "644"
checksum: sha256:c711f8875ece9b527dfe31ffc75f8c0de2e77945ef67860a959a4e04c36772d5
Expand Down
12 changes: 6 additions & 6 deletions autoware.repos
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ repositories:
core/autoware_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_msgs.git
version: main
version: 1.1.0
core/autoware_adapi_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_adapi_msgs.git
version: main
version: 1.3.0
core/autoware_internal_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_internal_msgs.git
version: main
version: 1.1.0
# TODO(youtalk): Remove autoware_common when https://github.com/autowarefoundation/autoware/issues/4911 is closed
core/autoware_common:
type: git
Expand All @@ -20,15 +20,15 @@ repositories:
core/autoware_cmake:
type: git
url: https://github.com/autowarefoundation/autoware_cmake.git
version: main
version: 1.0.0
core/autoware_utils:
type: git
url: https://github.com/autowarefoundation/autoware_utils.git
version: main
version: 1.0.0
core/autoware_lanelet2_extension:
type: git
url: https://github.com/autowarefoundation/autoware_lanelet2_extension.git
version: main
version: 0.5.0
core/autoware.core:
type: git
url: https://github.com/autowarefoundation/autoware.core.git
Expand Down
35 changes: 26 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ROS_DISTRO

# Install apt packages and add GitHub to known hosts for private repositories
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
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 \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
gosu \
ssh \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache \
&& mkdir -p ~/.ssh \
&& ssh-keyscan github.com >> ~/.ssh/known_hosts

Expand All @@ -20,9 +24,11 @@ WORKDIR /autoware

# Set up base environment
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module base --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc

# Create entrypoint
Expand All @@ -36,10 +42,14 @@ COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /auto
COPY ansible/ /autoware/ansible/
WORKDIR /autoware

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=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y rosdep \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Generate install package lists
COPY src/core /autoware/src/core
Expand Down Expand Up @@ -80,17 +90,20 @@ ENV CCACHE_DIR="/root/.ccache"
# cspell: ignore libcu libnv
# Set up development environment
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Install rosdep dependencies
COPY --from=rosdep-depend /rosdep-core-depend-packages.txt /tmp/rosdep-core-depend-packages.txt
# hadolint ignore=SC2002
RUN --mount=type=ssh \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& cat /tmp/rosdep-core-depend-packages.txt | xargs apt-get install -y --no-install-recommends \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

COPY src/core /autoware/src/core
RUN --mount=type=cache,target=${CCACHE_DIR} \
Expand Down Expand Up @@ -139,9 +152,11 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install development tools and artifacts
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module dev-tools --download-artifacts openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
&& apt-get autoremove -y && rm -rf "$HOME"/.cache

# Create entrypoint
COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh
Expand All @@ -159,11 +174,13 @@ ARG SETUP_ARGS
COPY --from=rosdep-depend /rosdep-exec-depend-packages.txt /tmp/rosdep-exec-depend-packages.txt
# hadolint ignore=SC2002
RUN --mount=type=ssh \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --download-artifacts --no-cuda-drivers --runtime openadkit \
&& pip uninstall -y ansible ansible-core \
&& apt-get update \
&& cat /tmp/rosdep-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& apt-get autoremove -y && rm -rf "$HOME"/.cache \
&& find /usr/lib/$LIB_DIR-linux-gnu -name "*.a" -type f -delete \
&& find / -name "*.o" -type f -delete \
&& find / -name "*.h" -type f -delete \
Expand Down

0 comments on commit 4ae9c96

Please sign in to comment.