Skip to content

Commit

Permalink
Merge branch 'main' into feat/lidar_centerpoint_tvm/remove_package
Browse files Browse the repository at this point in the history
  • Loading branch information
kminoda authored Jun 27, 2024
2 parents 7abdca7 + ada7b8c commit 3723c32
Show file tree
Hide file tree
Showing 31 changed files with 1,003 additions and 229 deletions.
480 changes: 480 additions & 0 deletions .clang-tidy-ci

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .devcontainer/base/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Autoware",
"build": {
"dockerfile": "../Dockerfile",
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware-openadk:latest-devel" }
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:latest-devel" }
},
"remoteUser": "autoware",
"runArgs": [
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/cuda/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Autoware-cuda",
"build": {
"dockerfile": "../Dockerfile",
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware-openadk:latest-devel-cuda" }
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:latest-devel-cuda" }
},
"remoteUser": "autoware",
"hostRequirements": {
Expand Down
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
* [email protected] [email protected]

.devcontainer/** [email protected] [email protected]
.github/** [email protected] [email protected]
ansible/** [email protected] [email protected]
docker/** [email protected] [email protected]
13 changes: 13 additions & 0 deletions .github/DISCUSSION_TEMPLATE/general.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
body:
- type: checkboxes
attributes:
label: Code of Conduct
options:
- label: I have read [CODE OF CONDUCT](https://github.com/autowarefoundation/autoware/blob/main/CODE_OF_CONDUCT.md) and [Support Guidelines](https://autowarefoundation.github.io/autoware-documentation/main/support/support-guidelines/#github-discussions) before creating this Discussion post.
required: true
- type: textarea
attributes:
label: Contents
description: Write your contents here
validations:
required: true
118 changes: 37 additions & 81 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ inputs:
runs:
using: composite
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install jq
- name: Install jq and vcstool
run: |
sudo apt-get -y update
sudo apt-get -y install jq
sudo apt-get -y install jq python3-pip
pip install --no-cache-dir vcstool
shell: bash

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
shell: bash

- name: Set Docker tags
Expand All @@ -50,9 +54,20 @@ runs:
echo "$EOF" >> $GITHUB_OUTPUT
shell: bash

- name: Docker meta for base
id: meta-base
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
bake-target: docker-metadata-action-base
flavor: |
latest=false
suffix=-base
- name: Docker meta for prebuilt
id: meta-prebuilt
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
Expand All @@ -63,7 +78,7 @@ runs:
- name: Docker meta for devel
id: meta-devel
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
Expand All @@ -73,9 +88,9 @@ runs:
suffix=-devel${{ inputs.tag-suffix }}
- name: Docker meta for runtime
if: ${{ github.event_name == 'workflow_dispatch' }} || ${{ (github.event_name == 'push' && github.ref_type == 'tag') }}
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_type == 'tag') }}
id: meta-runtime
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
Expand All @@ -86,99 +101,40 @@ runs:
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and Push - prebuilt and devel
if: ${{ (github.event_name == 'push' && github.ref_type == 'branch') || github.event_name == 'schedule' }}
uses: docker/bake-action@v3
- name: Build and Push to GitHub Container Registry
if: ${{ github.event_name == 'push' ||
github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }}
uses: docker/bake-action@v5
with:
push: ${{ inputs.allow-push == 'true' }}
files: |
docker/${{ inputs.bake-target }}/docker-bake.hcl
docker/docker-bake.hcl
${{ steps.meta-base.outputs.bake-file }}
${{ steps.meta-prebuilt.outputs.bake-file }}
${{ steps.meta-devel.outputs.bake-file }}
targets: |
prebuilt
devel
provenance: false
set: |
${{ inputs.build-args }}
- name: Build and Publish to GitHub Container Registry
if: ${{ ( github.event_name == 'push' && github.ref_type == 'tag' ) || ( github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }}
uses: docker/bake-action@v3
with:
push: true
files: |
docker/${{ inputs.bake-target }}/docker-bake.hcl
${{ steps.meta-devel.outputs.bake-file }}
${{ steps.meta-prebuilt.outputs.bake-file }}
${{ steps.meta-runtime.outputs.bake-file }}
provenance: false
set: |
${{ inputs.build-args }}
- name: Build and Save Artifacts
- name: Build only
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
uses: docker/bake-action@v3
uses: docker/bake-action@v5
with:
push: false
files: |
docker/${{ inputs.bake-target }}/docker-bake.hcl
${{ steps.meta-devel.outputs.bake-file }}
docker/docker-bake.hcl
${{ steps.meta-base.outputs.bake-file }}
${{ steps.meta-prebuilt.outputs.bake-file }}
${{ steps.meta-devel.outputs.bake-file }}
${{ steps.meta-runtime.outputs.bake-file }}
provenance: false
set: |
${{ inputs.build-args }}
prebuilt.output=type=docker,dest=/tmp/prebuilt.tar
devel.output=type=docker,dest=/tmp/devel.tar
runtime.output=type=docker,dest=/tmp/runtime.tar
- name: Upload Artifact - prebuilt
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
id: artifact-upload-step-prebuilt
uses: actions/upload-artifact@v4
with:
name: prebuilt-image${{ inputs.tag-suffix }}
path: /tmp/prebuilt.tar
retention-days: 7
compression-level: 6
overwrite: true
if-no-files-found: error

- name: Upload Artifact - devel
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
id: artifact-upload-step-devel
uses: actions/upload-artifact@v4
with:
name: devel-image${{ inputs.tag-suffix }}
path: /tmp/devel.tar
retention-days: 7
compression-level: 6
overwrite: true
if-no-files-found: error

- name: Upload Artifact - runtime
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
id: artifact-upload-step-runtime
uses: actions/upload-artifact@v4
with:
name: runtime-image${{ inputs.tag-suffix }}
path: /tmp/runtime.tar
retention-days: 7
compression-level: 6
overwrite: true
if-no-files-found: error

- name: Output artifact URLs
id: output-artifact-urls
run: |
echo 'prebuilt URL ${{ steps.artifact-upload-step-prebuilt.outputs.artifact-url }}'
echo 'devel URL ${{ steps.artifact-upload-step-devel.outputs.artifact-url }}'
echo 'runtime URL ${{ steps.artifact-upload-step-runtime.outputs.artifact-url }}'
shell: bash
72 changes: 72 additions & 0 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: docker-build
description: ""

inputs:
name:
description: ""
required: true
platform:
description: ""
required: true
cache-tag-suffix:
description: ""
required: true
build-args:
description: ""
required: true

runs:
using: composite
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Install vcstool
run: |
sudo apt-get -y update
sudo apt-get -y install python3-pip
pip install --no-cache-dir vcstool
shell: bash

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
shell: bash

- name: Cache
uses: actions/cache@v3
id: cache
with:
path: |
root-ccache
key: cache-${{ inputs.platform }}-${{ inputs.name }}-${{ hashFiles('autoware.repos') }}
restore-keys: |
cache-${{ inputs.platform }}-${{ inputs.name }}-
cache-${{ inputs.platform }}-
- name: Inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"root-ccache": "/root/.ccache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Run docker build
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile
context: .
push: false
build-args: ${{ inputs.build-args }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ inputs.name }}-${{ inputs.platform }}-${{ inputs.cache-tag-suffix }}
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ inputs.name }}-${{ inputs.platform }}-${{ inputs.cache-tag-suffix }},mode=max
34 changes: 16 additions & 18 deletions .github/workflows/build-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ on:
schedule:
- cron: 0 12 * * *
workflow_dispatch:
inputs:
artifacts-destination:
type: choice
description: Built images will be saved as tarball
options:
- tarball
default: tarball

jobs:
load-env:
Expand All @@ -27,11 +20,13 @@ jobs:
- cuda
include:
- name: no-cuda
platform: arm64
base_image_env: base_image
lib_dir: aarch64
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
platform: arm64
base_image_env: base_image
lib_dir: aarch64
additional-tag-suffix: -cuda
Expand All @@ -44,22 +39,25 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Build 'autoware-universe'
uses: ./.github/actions/docker-build-and-push
- name: Build 'Autoware'
uses: ./.github/actions/docker-build
with:
bake-target: autoware-openadk
name: ${{ matrix.name }}
platform: ${{ matrix.platform }}
cache-tag-suffix: main
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: false
ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
SETUP_ARGS=${{ matrix.setup-args }}
LIB_DIR=${{ matrix.lib_dir }}
- name: Show disk space
run: |
Expand Down
Loading

0 comments on commit 3723c32

Please sign in to comment.