diff --git a/.github/sync-files.yaml b/.github/sync-files.yaml index 9972c966ea..7299412a02 100644 --- a/.github/sync-files.yaml +++ b/.github/sync-files.yaml @@ -10,6 +10,7 @@ - source: .github/ISSUE_TEMPLATE/task.yaml - source: .github/pull_request_template.md - source: .github/dependabot.yaml + - source: .github/workflows/backport.yaml - source: .github/stale.yml - source: .github/workflows/comment-on-pr.yaml - source: .github/workflows/github-release.yaml diff --git a/.github/update-sync-param-files.py b/.github/update-sync-param-files.py deleted file mode 100644 index 707909cdd1..0000000000 --- a/.github/update-sync-param-files.py +++ /dev/null @@ -1,80 +0,0 @@ -import argparse -import dataclasses -from pathlib import Path -from typing import List -from typing import Optional - -import git - -""" -This module updates `sync-param-files.yaml` based on the launch parameter files in `autoware.universe`. -""" - -REPO_NAME = "autowarefoundation/autoware.universe" -REPO_URL = f"https://github.com/{REPO_NAME}.git" -CLONE_PATH = Path("/tmp/autoware.universe") - - -@dataclasses.dataclass -class FileSyncConfig: - source: str - dest: str - replace: Optional[bool] = None - delete_orphaned: Optional[bool] = None - pre_commands: Optional[str] = None - post_commands: Optional[str] = None - - -def create_tier4_launch_sync_configs(tier4_launch_package_path: Path) -> List[FileSyncConfig]: - launch_package_name = tier4_launch_package_path.name - launch_config_path = tier4_launch_package_path / "config" - - sync_configs = [] - for param_file_path in tier4_launch_package_path.glob("config/**/*.param.yaml"): - relative_param_file_path = param_file_path.relative_to(launch_config_path) - - source = param_file_path.relative_to(CLONE_PATH) - dest = Path("autoware_launch/config") / launch_package_name / relative_param_file_path - - sync_configs.append(FileSyncConfig(str(source), str(dest))) - - return sync_configs - - -def dump_sync_config(section_name: str, sync_configs: List[FileSyncConfig]) -> List[str]: - indent = 4 * " " - lines = [f"{indent}# {section_name}\n"] - for sync_config in sync_configs: - lines.append(f"{indent}- source: {sync_config.source}\n") - lines.append(f"{indent} dest: {sync_config.dest}\n") - lines.append("\n") - return lines - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("sync_param_files_path", type=Path, help="path to sync-param-files.yaml") - args = parser.parse_args() - - # Clone Autoware - if not CLONE_PATH.exists(): - git.Repo.clone_from(REPO_URL, CLONE_PATH) - - # Create sync config for tier4_*_launch - tier4_launch_package_paths = sorted( - CLONE_PATH.glob("launch/tier4_*_launch"), key=lambda p: p.name - ) - tier4_launch_sync_configs_map = { - p.name: create_tier4_launch_sync_configs(p) for p in tier4_launch_package_paths - } - - # Create sync-param-files.yaml - with open(args.sync_param_files_path, "w") as f: - f.write(f"- repository: {REPO_NAME}\n") - f.write(" files:\n") - for section_name, sync_config in tier4_launch_sync_configs_map.items(): - f.writelines(dump_sync_config(section_name, sync_config)) - - -if __name__ == "__main__": - main() diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 0000000000..d79e709888 --- /dev/null +++ b/.github/workflows/backport.yaml @@ -0,0 +1,33 @@ +name: backport +on: + pull_request_target: + types: + - closed + - labeled + +jobs: + backport: + runs-on: ubuntu-latest + # Only react to merged PRs for security reasons. + # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - uses: tibdex/backport@v2 + with: + github_token: ${{ steps.generate-token.outputs.token }} + title_template: "<%= title %> (backport #<%= number %>)" diff --git a/.github/workflows/beta-to-tier4-main-sync.yaml b/.github/workflows/beta-to-tier4-main-sync.yaml new file mode 100644 index 0000000000..79bdb6f0bd --- /dev/null +++ b/.github/workflows/beta-to-tier4-main-sync.yaml @@ -0,0 +1,34 @@ +name: beta-to-tier4-main-sync + +on: + workflow_dispatch: + inputs: + source_branch: + description: Source branch + required: true + type: string + +jobs: + sync-beta-branch: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run sync-branches + uses: autowarefoundation/autoware-github-actions/sync-branches@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + base-branch: tier4/main + sync-pr-branch: beta-to-tier4-main-sync + sync-target-repository: https://github.com/tier4/autoware_launch.git + sync-target-branch: ${{ inputs.source_branch }} + pr-title: "chore: sync beta branch ${{ inputs.source_branch }} with tier4/main" + pr-labels: | + bot + sync-beta-branch + auto-merge-method: merge diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 0af7487814..67f152cbc8 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -33,6 +33,14 @@ jobs: - name: Show disk space before the tasks run: df -h + - name: Free disk space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + dotnet: false + swap-storage: false + large-packages: false + - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 diff --git a/.github/workflows/check-build-depends.yaml b/.github/workflows/check-build-depends.yaml deleted file mode 100644 index b2d14fa751..0000000000 --- a/.github/workflows/check-build-depends.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: check-build-depends - -on: - pull_request: - paths: - - build_depends*.repos - -jobs: - check-build-depends: - runs-on: ubuntu-22.04 - container: ${{ matrix.container }} - strategy: - fail-fast: false - matrix: - rosdistro: - - galactic - - humble - include: - - rosdistro: galactic - container: ros:galactic - build-depends-repos: build_depends.repos - - rosdistro: humble - container: ros:humble - build-depends-repos: build_depends.repos - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Remove exec_depend - uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 - - - name: Get self packages - id: get-self-packages - uses: autowarefoundation/autoware-github-actions/get-self-packages@v1 - - - name: Build - uses: autowarefoundation/autoware-github-actions/colcon-build@v1 - with: - rosdistro: ${{ matrix.rosdistro }} - target-packages: ${{ steps.get-self-packages.outputs.self-packages }} - build-depends-repos: ${{ matrix.build-depends-repos }} diff --git a/.github/workflows/dispatch-release-note.yaml b/.github/workflows/dispatch-release-note.yaml new file mode 100644 index 0000000000..89356b6abd --- /dev/null +++ b/.github/workflows/dispatch-release-note.yaml @@ -0,0 +1,44 @@ +name: dispatch-release-note +on: + push: + branches: + - beta/v* + - tier4/main + tags: + - v* + workflow_dispatch: + inputs: + beta-branch-or-tag-name: + description: The name of the beta branch or tag to write release note + type: string + required: true +jobs: + dispatch-release-note: + runs-on: ubuntu-latest + name: release-repository-dispatch + steps: + - name: Set ref name + id: set-ref-name + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + REF_NAME="${{ github.event.inputs.beta-branch-or-tag-name }}" + else + REF_NAME="${{ github.ref_name }}" + fi + echo ::set-output name=ref-name::"${{ github.repository }}/'$REF_NAME'" + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Repository dispatch for release note + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ steps.generate-token.outputs.token }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/tier4/update-release-notes/dispatches" \ + -d '{"event_type":"${{ steps.set-ref-name.outputs.ref-name }}"}' diff --git a/.github/workflows/sync-awf-latest.yaml b/.github/workflows/sync-awf-latest.yaml new file mode 100644 index 0000000000..7a5f79acaa --- /dev/null +++ b/.github/workflows/sync-awf-latest.yaml @@ -0,0 +1,30 @@ +name: sync-awf-latest + +on: + schedule: + - cron: 50 */1 * * * # every 1 hour (**:50) + workflow_dispatch: + +jobs: + sync-awf-latest: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run sync-branches + uses: autowarefoundation/autoware-github-actions/sync-branches@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + base-branch: awf-latest + sync-pr-branch: sync-awf-latest + sync-target-repository: https://github.com/autowarefoundation/autoware_launch.git + sync-target-branch: main + pr-title: "chore: sync awf-latest" + pr-labels: | + bot + auto-merge-method: merge diff --git a/.github/workflows/sync-awf-upstream.yaml b/.github/workflows/sync-awf-upstream.yaml new file mode 100644 index 0000000000..3a8dd05797 --- /dev/null +++ b/.github/workflows/sync-awf-upstream.yaml @@ -0,0 +1,53 @@ +name: sync-awf-upstream + +on: + workflow_dispatch: + inputs: + target_branch: + description: Target branch + required: true + type: string + +jobs: + sync-awf-upstream: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - run: npm install @holiday-jp/holiday_jp + + - uses: actions/github-script@v6 + id: is-holiday + with: + script: | + const holiday_jp = require(`${process.env.GITHUB_WORKSPACE}/node_modules/@holiday-jp/holiday_jp`) + core.setOutput('holiday', holiday_jp.isHoliday(new Date())); + + - name: Print warning for invalid branch name + if: ${{ inputs.target_branch == 'tier4/main' }} + run: | + echo This action cannot be performed on 'tier4/main' branch + + - name: Run sync-branches + uses: autowarefoundation/autoware-github-actions/sync-branches@v1 + if: ${{ inputs.target_branch != 'tier4/main' }} + with: + token: ${{ steps.generate-token.outputs.token }} + base-branch: ${{ inputs.target_branch }} + sync-pr-branch: sync-awf-upstream + sync-target-repository: https://github.com/tier4/autoware_launch.git + sync-target-branch: awf-latest + pr-title: "chore: sync tier4/autoware_launch:awf-latest" + pr-labels: | + bot + sync-awf-upstream + auto-merge-method: merge diff --git a/.github/workflows/sync-beta-upstream.yaml b/.github/workflows/sync-beta-upstream.yaml new file mode 100644 index 0000000000..25b83306ca --- /dev/null +++ b/.github/workflows/sync-beta-upstream.yaml @@ -0,0 +1,32 @@ +# This workflow is intended for the use in the repositories created by forking tier4/autoware_launch. +name: sync-beta-upstream + +on: + schedule: + - cron: 0 20 * * * + workflow_dispatch: + +jobs: + sync-tier4-upstream: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run sync-branches + uses: autowarefoundation/autoware-github-actions/sync-branches@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + base-branch: beta/ + sync-pr-branch: sync-beta-upstream + sync-target-repository: https://github.com/tier4/autoware_launch.git + sync-target-branch: beta/ + pr-title: "chore: sync beta upstream" + pr-labels: | + bot + sync-tier4-upstream + auto-merge-method: merge diff --git a/.github/workflows/sync-tier4-upstream-up-to-tag.yaml b/.github/workflows/sync-tier4-upstream-up-to-tag.yaml new file mode 100644 index 0000000000..f85b58a2fa --- /dev/null +++ b/.github/workflows/sync-tier4-upstream-up-to-tag.yaml @@ -0,0 +1,92 @@ +# This workflow is intended for the use in the repositories created by forking tier4/autoware_launch. +name: sync-tier4-upstream-up-to-tag + +on: + workflow_dispatch: + inputs: + sync-target-tag: + description: sync target tag like v0.24.0 + required: true + type: string + default: "" + +jobs: + sync-tier4-upstream-up-to-tag: + runs-on: ubuntu-latest + env: + BASE_BRANCH: tier4/main + SYNC_TARGET_REPOSITORY: https://github.com/tier4/autoware_launch.git + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Check out repository + uses: actions/checkout@v4 + with: + ref: ${{ env.BASE_BRANCH }} + fetch-depth: 0 + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + + - name: Sync tag + run: | + git remote add sync-target ${{ env.SYNC_TARGET_REPOSITORY }} + git fetch -pPtf --all + git reset --hard "${{ inputs.sync-target-tag }}" + git remote rm sync-target + shell: bash + + - name: Generate changelog + id: generate-changelog + uses: autowarefoundation/autoware-github-actions/generate-changelog@v1 + with: + git-cliff-args: origin/${{ env.BASE_BRANCH }}..HEAD + + - name: Replace PR number to URL + id: replace-pr-number-to-url + run: | + # Output multiline strings: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string + changelog=$(echo "$CHANGELOG" | sed -r "s|\(#([0-9]+)\)|("${REPO_URL%.git}"/pull/\1)|g") + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + echo "changelog<<$EOF" >> $GITHUB_OUTPUT + echo "$changelog" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT + env: + CHANGELOG: ${{ steps.generate-changelog.outputs.changelog }} + REPO_URL: ${{ env.SYNC_TARGET_REPOSITORY }} + shell: bash + + - name: Create PR + id: create-pr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ steps.generate-token.outputs.token }} + base: ${{ env.BASE_BRANCH }} + branch: sync-tier4-upstream-${{ inputs.sync-target-tag }} + title: "chore: sync upstream up to ${{ inputs.sync-target-tag }}" + body: ${{ steps.replace-pr-number-to-url.outputs.changelog }} + labels: | + bot + sync-tier4-upstream + author: github-actions + signoff: true + delete-branch: true + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" + + - name: Enable auto-merge + if: ${{ steps.create-pr.outputs.pull-request-operation == 'created' }} + run: gh pr merge --merge --auto "${{ steps.create-pr.outputs.pull-request-number }}" + shell: bash + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} diff --git a/.github/workflows/sync-tier4-upstream.yaml b/.github/workflows/sync-tier4-upstream.yaml new file mode 100644 index 0000000000..b97a9bab28 --- /dev/null +++ b/.github/workflows/sync-tier4-upstream.yaml @@ -0,0 +1,32 @@ +# This workflow is intended for the use in the repositories created by forking tier4/autoware_launch. +name: sync-tier4-upstream + +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: + +jobs: + sync-tier4-upstream: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run sync-branches + uses: autowarefoundation/autoware-github-actions/sync-branches@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + base-branch: tier4/main + sync-pr-branch: sync-tier4-upstream + sync-target-repository: https://github.com/tier4/autoware_launch.git + sync-target-branch: tier4/main + pr-title: "chore: sync upstream" + pr-labels: | + bot + sync-tier4-upstream + auto-merge-method: merge diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 102575d7d8..0000000000 --- a/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -autowarefoundation/autoware_launch -Copyright 2021 The Autoware Foundation - -This product includes software developed at -The Autoware Foundation (https://www.autoware.org/). - -This product includes code developed by TIER IV. -Copyright 2020 TIER IV, Inc. diff --git a/autoware_launch/config/system/system_monitor/net_monitor.param.yaml b/autoware_launch/config/system/system_monitor/net_monitor.param.yaml index e97df8f7b6..e0927116ff 100644 --- a/autoware_launch/config/system/system_monitor/net_monitor.param.yaml +++ b/autoware_launch/config/system/system_monitor/net_monitor.param.yaml @@ -2,7 +2,7 @@ ros__parameters: devices: ["*"] monitor_program: "greengrass" - enable_traffic_monitor: true + enable_traffic_monitor: false crc_error_check_duration: 1 crc_error_count_threshold: 1 reassembles_failed_check_duration: 1