Skip to content

Commit

Permalink
Merge pull request #112 from youtalk/upstream-to-origin
Browse files Browse the repository at this point in the history
feat: upstream to origin
  • Loading branch information
youtalk authored Sep 18, 2024
2 parents 1650897 + b03dece commit e9a06d1
Show file tree
Hide file tree
Showing 27 changed files with 927 additions and 220 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/base/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Autoware",
"name": "autoware:universe-devel",
"build": {
"dockerfile": "../Dockerfile",
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:latest-devel" }
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:universe-devel" }
},
"remoteUser": "autoware",
"runArgs": [
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/cuda/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Autoware-cuda",
"name": "autoware:universe-devel-cuda",
"build": {
"dockerfile": "../Dockerfile",
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:latest-devel-cuda" }
"args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:universe-devel-cuda" }
},
"remoteUser": "autoware",
"hostRequirements": {
Expand Down
107 changes: 74 additions & 33 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ inputs:
build-args:
description: ""
required: false
tag-prefix:
description: ""
required: false
tag-suffix:
description: ""
required: false
Expand Down Expand Up @@ -73,90 +70,130 @@ runs:
}
skip-extraction: true

- name: Set Docker tags
id: set-docker-tags
run: |
tags=()
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref_type }}" == "tag" ]; then
tags+=("$(echo "${{ github.ref }}" | sed -E 's/.*([vV][0-9]+\.[0-9]+\.[0-9]+).*/\1/')")
fi
tags+=("{{date 'YYYYMMDD'}}")
tags+=("latest")
tags+=("latest-${{ inputs.tag-prefix }}")
# Output multiline strings: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "tags<<$EOF" >> $GITHUB_OUTPUT
echo "$(printf "%s\n" "${tags[@]}")" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Docker meta for autoware:base
id: meta-base
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
tags: |
type=raw,value=base${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=base${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-base
flavor: |
latest=false
suffix=-base${{ inputs.tag-suffix }}
- name: Docker meta for autoware:core-devel
id: meta-core-devel
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
tags: |
type=raw,value=core-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=core-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-core-devel
flavor: |
latest=false
suffix=-core-devel${{ inputs.tag-suffix }}
- name: Docker meta for autoware:universe-sensing-perception-devel
id: meta-universe-sensing-perception-devel
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
tags: |
type=raw,value=universe-sensing-perception-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-sensing-perception-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-sensing-perception-devel
flavor: |
latest=false
suffix=-universe-sensing-perception-devel${{ inputs.tag-suffix }}
- name: Docker meta for autoware:universe-sensing-perception
id: meta-universe-sensing-perception
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
tags: |
type=raw,value=universe-sensing-perception${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-sensing-perception${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-sensing-perception
flavor: |
latest=false
suffix=-universe-sensing-perception${{ inputs.tag-suffix }}
- name: Docker meta for autoware:universe-localization-mapping-devel
id: meta-universe-localization-mapping-devel
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: |
type=raw,value=universe-localization-mapping-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-localization-mapping-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-localization-mapping-devel
flavor: |
latest=false
- name: Docker meta for autoware:universe-localization-mapping
id: meta-universe-localization-mapping
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: |
type=raw,value=universe-localization-mapping${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-localization-mapping${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-localization-mapping
flavor: |
latest=false
- name: Docker meta for autoware:universe-planning-control-devel
id: meta-universe-planning-control-devel
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: |
type=raw,value=universe-planning-control-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-planning-control-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-planning-control-devel
flavor: |
latest=false
- name: Docker meta for autoware:universe-planning-control
id: meta-universe-planning-control
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: |
type=raw,value=universe-planning-control${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-planning-control${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-planning-control
flavor: |
latest=false
- name: Docker meta for autoware:universe-devel
id: meta-universe-devel
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
tags: |
type=raw,value=universe-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe-devel${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe-devel
flavor: |
latest=false
suffix=-universe-devel${{ inputs.tag-suffix }}
- name: Docker meta for autoware:universe
id: meta-universe
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: |
type=raw,value=universe${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}
type=raw,value=universe${{ inputs.tag-suffix && '-' }}${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-universe
flavor: |
latest=auto
suffix=-universe${{ inputs.tag-suffix }}
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -174,6 +211,10 @@ runs:
${{ steps.meta-core-devel.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception-devel.outputs.bake-file }}
${{ steps.meta-universe-sensing-perception.outputs.bake-file }}
${{ steps.meta-universe-localization-mapping-devel.outputs.bake-file }}
${{ steps.meta-universe-localization-mapping.outputs.bake-file }}
${{ steps.meta-universe-planning-control-devel.outputs.bake-file }}
${{ steps.meta-universe-planning-control.outputs.bake-file }}
${{ steps.meta-universe-devel.outputs.bake-file }}
${{ steps.meta-universe.outputs.bake-file }}
provenance: false
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker-build-and-push-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
platform: arm64
base_image_env: base_image
lib_dir: aarch64
additional-tag-suffix: -cuda
additional-tag-suffix: cuda
steps:
- name: Check if PR author is the specific user
id: author-check
Expand Down Expand Up @@ -87,7 +87,6 @@ jobs:
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.head_ref }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
platform: amd64
base_image_env: base_image
lib_dir: x86_64
additional-tag-suffix: -cuda
additional-tag-suffix: cuda
steps:
- name: Check if PR author is the specific user
id: author-check
Expand Down Expand Up @@ -87,7 +87,6 @@ jobs:
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.head_ref }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
Expand Down
74 changes: 70 additions & 4 deletions .webauto-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,77 @@
# The configuration file for Web.Auto CI/CD tool.
# https://docs.web.auto/user-manuals/evaluator/configuration/reference/introduction

version: 2

artifacts:
- name: main
metadata:
play-ondemand.ci.web.auto/buildspec: Autoware-Humble_v0.29.0
build:
type: tier4/universe/main/amd64/v1
type: custom
runtime:
type: standard1/amd64/large
source:
vcstool:
repositories_files:
- autoware.repos
- simulator.repos
import_path: src
environment_variables:
AUTOWARE_PATH: /opt/autoware
DEBIAN_FRONTEND: noninteractive
LANG: C.UTF-8
phases:
- name: environment-setup
user: root
exec: ./.webauto-ci/main/environment-setup/run.sh
caches:
- name: apt-lists
mountpoint: /var/lib/apt/lists
- name: apt-archives
mountpoint: /var/cache/apt/archives
build_result_reuse:
key_files:
- .webauto-ci/main/environment-setup/**/*
- name: autoware-setup
user: autoware
exec: ./.webauto-ci/main/autoware-setup/run.sh
caches:
- name: apt-lists
mountpoint: /var/lib/apt/lists
- name: apt-archives
mountpoint: /var/cache/apt/archives
build_result_reuse:
key_files:
- .webauto-ci/main/autoware-setup/**/*
- ansible/**/*
- ansible-galaxy-requirements.yaml
- amd64.env
incremental_build:
enabled: true
- name: autoware-build
user: autoware
exec: ./.webauto-ci/main/autoware-build/run.sh
environment_variables:
PARALLEL_WORKERS: "32"
CCACHE_DIR: /tmp/build/cache/ccache
caches:
- name: apt-lists
mountpoint: /var/lib/apt/lists
- name: apt-archives
mountpoint: /var/cache/apt/archives
- name: ccache
mountpoint: /tmp/build/cache/ccache
build_result_reuse:
key_files:
- .webauto-ci/main/autoware-build/**/*
- src/**/*
base_container_image:
from: ubuntu:22.04
output_container_image:
from: autoware-build
workdir: /opt/autoware
user: autoware

simulations:
- name: lexus_planning_sim
Expand All @@ -13,9 +81,7 @@ simulations:
type: container
artifact: main
runtime:
type: simulator/standard1/amd64/medium
cpu: 8
memory: 16384
type: standard1/amd64/medium
parameters:
launch_autoware: "true"
autoware_launch_package: autoware_launch
Expand Down
44 changes: 44 additions & 0 deletions .webauto-ci/main/autoware-build/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash -e

: "${WEBAUTO_CI_SOURCE_PATH:?is not set}"
: "${WEBAUTO_CI_DEBUG_BUILD:?is not set}"

: "${AUTOWARE_PATH:?is not set}"
: "${CCACHE_DIR:=}"
: "${CCACHE_SIZE:=1G}"
: "${PARALLEL_WORKERS:=4}"

sudo mkdir "$AUTOWARE_PATH"
sudo chown "$(whoami)": "$AUTOWARE_PATH"
cd "$WEBAUTO_CI_SOURCE_PATH"
cp -r src .webauto-ci.* "$AUTOWARE_PATH"
cd "$AUTOWARE_PATH"

if [ -n "$CCACHE_DIR" ]; then
mkdir -p "$CCACHE_DIR"
export USE_CCACHE=1
export CCACHE_DIR="$CCACHE_DIR"
export CC="/usr/lib/ccache/gcc"
export CXX="/usr/lib/ccache/g++"
ccache -M "$CCACHE_SIZE"
fi

sudo -E apt-get -y update

# shellcheck disable=SC2012
ROS_DISTRO=$(ls -1 /opt/ros | head -1)
# shellcheck disable=SC1090
source "/opt/ros/$ROS_DISTRO/setup.bash"
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro "$ROS_DISTRO"

[[ $WEBAUTO_CI_DEBUG_BUILD == "true" ]] && build_type="RelWithDebInfo" || build_type="Release"

colcon build \
--cmake-args -DCMAKE_BUILD_TYPE="$build_type" -DBUILD_TESTING=off -Wno-dev --no-warn-unused-cli \
--symlink-install \
--catkin-skip-building-tests \
--executor parallel \
--parallel-workers "$PARALLEL_WORKERS"

sudo -E apt-get -y autoremove
20 changes: 20 additions & 0 deletions .webauto-ci/main/autoware-setup/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e

ansible_args=()
ansible_args+=("--extra-vars" "prompt_install_nvidia=y")
ansible_args+=("--extra-vars" "prompt_download_artifacts=y")
ansible_args+=("--extra-vars" "data_dir=$HOME/autoware_data")
ansible_args+=("--extra-vars" "ros2_installation_type=ros-base")
ansible_args+=("--extra-vars" "install_devel=false")

# read amd64 env file and expand ansible arguments
source 'amd64.env'
while read -r env_name; do
ansible_args+=("--extra-vars" "${env_name}=${!env_name}")
done < <(sed "s/=.*//" <amd64.env)

ansible-galaxy collection install -f -r "ansible-galaxy-requirements.yaml"
ansible-playbook "ansible/playbooks/universe.yaml" \
"${ansible_args[@]}" \
-e WORKSPACE_ROOT="$(pwd)" \
--skip-tags vcs
Loading

0 comments on commit e9a06d1

Please sign in to comment.