diff --git a/.ansible-lint b/.ansible-lint index 61bd4a2c58c..a1083e74c61 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,8 +1,11 @@ exclude_paths: - src/ + - build/ + - install/ + - log/ skip_list: - - meta-no-info # We don't publish to Ansible Galaxy. + - galaxy # We don't publish to Ansible Galaxy. - package-latest # Since this is a development environment, we allow the latest versions. warn_list: [] diff --git a/.clang-format b/.clang-format index 7762ec9dfb8..cd54eb45dde 100644 --- a/.clang-format +++ b/.clang-format @@ -1,9 +1,14 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format Language: Cpp BasedOnStyle: Google AccessModifierOffset: -2 AlignAfterOpenBracket: AlwaysBreak +AllowShortFunctionsOnASingleLine: InlineOnly BraceWrapping: AfterClass: true AfterFunction: true @@ -33,6 +38,9 @@ IncludeCategories: - Regex: .*_msgs/.* Priority: 3 CaseSensitive: true + - Regex: .*_srvs/.* + Priority: 3 + CaseSensitive: true # Other Package headers - Regex: <.*> Priority: 2 diff --git a/.clang-tidy b/.clang-tidy index f9210b66546..de12fb605c8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + Checks: " -*, boost-use-to-string, @@ -41,6 +45,7 @@ Checks: " bugprone-terminating-continue, bugprone-throw-keyword-missing, bugprone-too-small-loop-variable, + bugprone-unchecked-optional-access, bugprone-undefined-memory-manipulation, bugprone-undelegated-constructor, bugprone-unhandled-self-assignment, @@ -201,7 +206,8 @@ WarningsAsErrors: " HeaderFilterRegex: ^(?!\/usr)(?!\/opt) -AnalyzeTemporaryDtors: false +ExtraArgs: + - -std=c++17 FormatStyle: none diff --git a/.clang-tidy-ci b/.clang-tidy-ci new file mode 100644 index 00000000000..5bba4fb90f9 --- /dev/null +++ b/.clang-tidy-ci @@ -0,0 +1,20 @@ +Checks: " + -*, + bugprone-*, + -bugprone-branch-clone, + -bugprone-easily-swappable-parameters, + -bugprone-exception-escape, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-infinite-loop, + -bugprone-integer-division, + -bugprone-macro-parentheses, + -bugprone-narrowing-conversions, + -bugprone-parent-virtual-call, + -bugprone-reserved-identifier, + -bugprone-signed-char-misuse" + +WarningsAsErrors: "*" + +ExtraArgs: + - -std=c++17 + - -Wno-c11-extensions diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..3d83ababb32 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +# hadolint global ignore=DL3006 +ARG BASE_IMAGE +FROM $BASE_IMAGE + +ENV SHELL /bin/bash + +ARG USERNAME=autoware +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ + && apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME diff --git a/.devcontainer/core-devel/devcontainer.json b/.devcontainer/core-devel/devcontainer.json new file mode 100644 index 00000000000..da76c733436 --- /dev/null +++ b/.devcontainer/core-devel/devcontainer.json @@ -0,0 +1,22 @@ +{ + "name": "autoware:core-devel", + "build": { + "dockerfile": "../Dockerfile", + "args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:core-devel" } + }, + "remoteUser": "autoware", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--net=host", + "--volume=/etc/localtime:/etc/localtime:ro" + ], + "customizations": { + "vscode": { + "settings.json": { + "terminal.integrated.profiles.linux": { "bash": { "path": "/bin/bash" } } + } + } + } +} diff --git a/.devcontainer/universe-devel-cuda/devcontainer.json b/.devcontainer/universe-devel-cuda/devcontainer.json new file mode 100644 index 00000000000..3a6a1c247a1 --- /dev/null +++ b/.devcontainer/universe-devel-cuda/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "autoware:universe-devel-cuda", + "build": { + "dockerfile": "../Dockerfile", + "args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:universe-devel-cuda" } + }, + "remoteUser": "autoware", + "hostRequirements": { + "gpu": true + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--net=host", + "--volume=/etc/localtime:/etc/localtime:ro", + "--gpus", + "all" + ], + "customizations": { + "vscode": { + "settings.json": { + "terminal.integrated.profiles.linux": { "bash": { "path": "/bin/bash" } } + } + } + } +} diff --git a/.devcontainer/universe-devel/devcontainer.json b/.devcontainer/universe-devel/devcontainer.json new file mode 100644 index 00000000000..fdef3562af1 --- /dev/null +++ b/.devcontainer/universe-devel/devcontainer.json @@ -0,0 +1,22 @@ +{ + "name": "autoware:universe-devel", + "build": { + "dockerfile": "../Dockerfile", + "args": { "BASE_IMAGE": "ghcr.io/autowarefoundation/autoware:universe-devel" } + }, + "remoteUser": "autoware", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--net=host", + "--volume=/etc/localtime:/etc/localtime:ro" + ], + "customizations": { + "vscode": { + "settings.json": { + "terminal.integrated.profiles.linux": { "bash": { "path": "/bin/bash" } } + } + } + } +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..679e11b25ef --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +# Ignore git and metadata directories +.git +.github +.vscode + +# Ignore all markdown files +*.md + +# Ignore Docker files +docker +!docker/etc +!docker/scripts + +# Ignore a part of files under src +src/**/.* +src/**/*.asc +src/**/*.gif +src/**/*.md +src/**/*.pcd +src/**/*.svg + +# Ignore generated files by colcon +build +install +log diff --git a/.fdignore b/.fdignore new file mode 100644 index 00000000000..fc25c6acba9 --- /dev/null +++ b/.fdignore @@ -0,0 +1 @@ +!/src/ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..98759c5c103 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,6 @@ +* ryohsuke.mitsudome@tier4.jp mfc@autoware.org + +.devcontainer/** oguzkaganozt@gmail.com yutaka.kondo@tier4.jp +.github/** oguzkaganozt@gmail.com yutaka.kondo@tier4.jp +ansible/** oguzkaganozt@gmail.com yutaka.kondo@tier4.jp +docker/** oguzkaganozt@gmail.com yutaka.kondo@tier4.jp diff --git a/.github/DISCUSSION_TEMPLATE/general.yaml b/.github/DISCUSSION_TEMPLATE/general.yaml new file mode 100644 index 00000000000..65c1f894927 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/general.yaml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml index 12a857998a0..5c74f7c5e4d 100644 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: Bug description: Report a bug body: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 48765c24a7b..deccbf336f6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + blank_issues_enabled: false contact_links: - name: Question diff --git a/.github/ISSUE_TEMPLATE/task.yaml b/.github/ISSUE_TEMPLATE/task.yaml index cd8322f5074..58307325ce4 100644 --- a/.github/ISSUE_TEMPLATE/task.yaml +++ b/.github/ISSUE_TEMPLATE/task.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: Task description: Plan a task body: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 97b0e954524..00000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,8 +0,0 @@ -**Note**: Confirm the [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/) before submitting a pull request. - -Click the `Preview` tab and select a PR template: - -- [Standard change](?expand=1&template=standard-change.md) -- [Small change](?expand=1&template=small-change.md) - -**Do NOT send a PR with this description.** diff --git a/.github/PULL_REQUEST_TEMPLATE/small-change.md b/.github/PULL_REQUEST_TEMPLATE/small-change.md deleted file mode 100644 index 7120f5212ef..00000000000 --- a/.github/PULL_REQUEST_TEMPLATE/small-change.md +++ /dev/null @@ -1,27 +0,0 @@ -## Description - - - -## Pre-review checklist for the PR author - -The PR author **must** check the checkboxes below when creating the PR. - -- [ ] I've confirmed the [contribution guidelines]. -- [ ] The PR follows the [pull request guidelines]. - -## In-review checklist for the PR reviewers - -The PR reviewers **must** check the checkboxes below before approval. - -- [ ] The PR follows the [pull request guidelines]. - -## Post-review checklist for the PR author - -The PR author **must** check the checkboxes below before merging. - -- [ ] There are no open discussions or they are tracked via tickets. - -After all checkboxes are checked, anyone who has write access can merge the PR. - -[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/ -[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/ diff --git a/.github/PULL_REQUEST_TEMPLATE/standard-change.md b/.github/PULL_REQUEST_TEMPLATE/standard-change.md deleted file mode 100644 index 2df18b2bd01..00000000000 --- a/.github/PULL_REQUEST_TEMPLATE/standard-change.md +++ /dev/null @@ -1,42 +0,0 @@ -## Description - - - -## Related links - - - -## Tests performed - - - -## Notes for reviewers - - - -## Pre-review checklist for the PR author - -The PR author **must** check the checkboxes below when creating the PR. - -- [ ] I've confirmed the [contribution guidelines]. -- [ ] The PR follows the [pull request guidelines]. - -## In-review checklist for the PR reviewers - -The PR reviewers **must** check the checkboxes below before approval. - -- [ ] The PR follows the [pull request guidelines]. -- [ ] The PR has been properly tested. -- [ ] The PR has been reviewed by the code owners. - -## Post-review checklist for the PR author - -The PR author **must** check the checkboxes below before merging. - -- [ ] There are no open discussions or they are tracked via tickets. -- [ ] The PR is ready for merge. - -After all checkboxes are checked, anyone who has write access can merge the PR. - -[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/ -[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/ diff --git a/.github/actions/combine-multi-arch-images/action.yaml b/.github/actions/combine-multi-arch-images/action.yaml index 93b6a54ec06..874054f4ed2 100644 --- a/.github/actions/combine-multi-arch-images/action.yaml +++ b/.github/actions/combine-multi-arch-images/action.yaml @@ -18,7 +18,7 @@ runs: - name: Set image name id: set-image-name - run: echo "::set-output name=image-name::ghcr.io/${{ github.repository_owner }}/${{ inputs.package-name }}" + run: echo "image-name=ghcr.io/${{ github.repository_owner }}/${{ inputs.package-name }}" >> $GITHUB_OUTPUT shell: bash - name: Get all tags @@ -48,7 +48,7 @@ runs: all_tags=$(printf "%s\n" ${all_tags[@]}) echo -e "\n[all_tags]\n$all_tags" - echo "::set-output name=tags::$(printf "%s " $all_tags)" + echo "tags=$(printf "%s " $all_tags | sed 's/\s*$//')" >> $GITHUB_OUTPUT shell: bash - name: Get base tags @@ -62,12 +62,12 @@ runs: echo -e "\n[arm64_tags]\n$arm64_tags" echo -e "\n[base_tags]\n$base_tags" - echo "::set-output name=tags::$(printf "%s " $base_tags)" + echo "tags=$(printf "%s " $base_tags | sed 's/\s*$//')" >> $GITHUB_OUTPUT env: ALL_TAGS: ${{ steps.get-all-tags.outputs.tags }} shell: bash - - name: Create Docker manifest + - name: Create Docker manifest and delete -amd64 and -arm64 tags run: | for base_tag in $BASE_TAGS; do echo -e "\nbase_tag: $base_tag" @@ -82,24 +82,35 @@ runs: amd64_image="${{ steps.set-image-name.outputs.image-name }}:$amd64_tag" else echo "No amd64 tag found for '$base_tag'." - amd64_image="" + continue fi if [ "$arm64_tag" != "" ]; then arm64_image="${{ steps.set-image-name.outputs.image-name }}:$arm64_tag" else echo "No arm64 tag found for '$base_tag'." - arm64_image="" + continue fi echo "amd64_image: $amd64_image" echo "arm64_image: $arm64_image" - docker manifest create ${{ steps.set-image-name.outputs.image-name }}:$base_tag \ + if docker manifest create ${{ steps.set-image-name.outputs.image-name }}:$base_tag \ $amd64_image \ - $arm64_image - - docker manifest push ${{ steps.set-image-name.outputs.image-name }}:$base_tag + $arm64_image; then + + docker manifest push ${{ steps.set-image-name.outputs.image-name }}:$base_tag + + # Delete amd64_image and arm64_image + curl -X DELETE \ + -H "Authorization: Bearer ${{ github.token }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${{ inputs.package-name }}/versions/$amd64_tag + curl -X DELETE \ + -H "Authorization: Bearer ${{ github.token }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${{ inputs.package-name }}/versions/$arm64_tag + fi done env: ALL_TAGS: ${{ steps.get-all-tags.outputs.tags }} diff --git a/.github/actions/create-main-distro-alias/action.yaml b/.github/actions/create-main-distro-alias/action.yaml deleted file mode 100644 index bdfe0cf4f98..00000000000 --- a/.github/actions/create-main-distro-alias/action.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: create-main-distro-alias -description: "" - -inputs: - package-name: - description: "" - required: true - rosdistro: - description: "" - required: true - tag-name: - description: "" - required: true - -runs: - using: composite - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ github.token }} - - - name: Set image name - id: set-image-name - run: echo "::set-output name=image-name::ghcr.io/${{ github.repository_owner }}/${{ inputs.package-name }}" - shell: bash - - - name: Create Docker manifest for latest - run: | - # Check image existence - distro_image="${{ steps.set-image-name.outputs.image-name }}:${{ inputs.rosdistro }}-${{ inputs.tag-name }}" - if docker manifest inspect "$distro_image-amd64" >/dev/null 2>&1; then - amd64_image="$distro_image-amd64" - fi - if docker manifest inspect "$distro_image-arm64" >/dev/null 2>&1; then - arm64_image="$distro_image-arm64" - fi - - echo "amd64_image: $amd64_image" - echo "arm64_image: $arm64_image" - - docker manifest create --amend ${{ steps.set-image-name.outputs.image-name }}:${{ inputs.tag-name }} \ - $amd64_image \ - $arm64_image - - docker manifest push ${{ steps.set-image-name.outputs.image-name }}:${{ inputs.tag-name }} - shell: bash 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 00000000000..8a5a779904a --- /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:cuda-latest + id: meta-base-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=cuda-latest + 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-base.hcl + ${{ steps.meta-base.outputs.bake-file }} + ${{ steps.meta-base-cuda.outputs.bake-file }} + provenance: false + set: | + ${{ inputs.build-args }} diff --git a/.github/actions/docker-build-and-push-cuda/action.yaml b/.github/actions/docker-build-and-push-cuda/action.yaml new file mode 100644 index 00000000000..92e7fcf01ef --- /dev/null +++ b/.github/actions/docker-build-and-push-cuda/action.yaml @@ -0,0 +1,138 @@ +name: docker-build-and-push-cuda +description: Composite action to build and push CUDA images to registry. + +inputs: + platform: + description: Target platform. + required: true + 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: Install jq and vcstool + run: | + sudo apt-get -y update + 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: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Restore ccache + uses: actions/cache/restore@v4 + with: + path: | + root-ccache + key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }} + restore-keys: | + ccache-${{ inputs.platform }}- + + - name: Restore apt-get + uses: actions/cache/restore@v4 + with: + path: | + var-cache-apt + key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }} + restore-keys: | + apt-get-${{ inputs.platform }}- + + - name: Inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 + with: + cache-map: | + { + "root-ccache": "/root/.ccache", + "var-cache-apt": "/var/cache/apt" + } + skip-extraction: true + + - name: Get current date + id: date + run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT + shell: bash + + - name: Docker meta for autoware:universe-sensing-perception-devel-cuda + id: meta-universe-sensing-perception-devel-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-sensing-perception-devel-cuda-${{ inputs.platform }} + type=raw,value=universe-sensing-perception-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-sensing-perception-devel-cuda-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-sensing-perception-devel-cuda + flavor: | + latest=false + + - name: Docker meta for autoware:universe-sensing-perception-cuda + id: meta-universe-sensing-perception-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-sensing-perception-cuda-${{ inputs.platform }} + type=raw,value=universe-sensing-perception-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-sensing-perception-cuda-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-sensing-perception-cuda + flavor: | + latest=false + + - name: Docker meta for autoware:universe-devel-cuda + id: meta-universe-devel-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-devel-cuda-${{ inputs.platform }} + type=raw,value=universe-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-devel-cuda-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-devel-cuda + flavor: | + latest=false + + - name: Docker meta for autoware:universe-cuda + id: meta-universe-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-cuda-${{ inputs.platform }} + type=raw,value=universe-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-cuda-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-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-cuda.hcl + ${{ steps.meta-universe-sensing-perception-devel-cuda.outputs.bake-file }} + ${{ steps.meta-universe-sensing-perception-cuda.outputs.bake-file }} + ${{ steps.meta-universe-devel-cuda.outputs.bake-file }} + ${{ steps.meta-universe-cuda.outputs.bake-file }} + provenance: false + set: | + ${{ inputs.build-args }} diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index d2bc5dbba42..5feb1bcc419 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -1,106 +1,236 @@ name: docker-build-and-push -description: "" +description: Composite action to build and push non CUDA images to registry. inputs: - bake-target: - description: "" + platform: + description: Target platform. + required: true + target-image: + description: Target docker image name in the registry. required: true build-args: - description: "" - required: false - tag-prefix: - description: "" - required: false - tag-suffix: - description: "" + description: Additional build args. required: false 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 - # workflow_dispatch: latest, date - # schedule: latest, date - # tag: semver - - name: Set Docker tags - id: set-docker-tags + - name: Run vcs import run: | - tags=() - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - tags+=("latest") - tags+=("{{date 'YYYYMMDD'}}") - else - tags+=("type=schedule,pattern=latest") - tags+=("type=schedule,pattern={{date 'YYYYMMDD'}}") - tags+=("type=semver,pattern={{version}}") - fi - - # Workaround for multiline strings - # https://github.community/t/set-output-truncates-multiline-strings/16852 - tags_multiline=$(printf "%s\n" "${tags[@]}") - tags_multiline="${tags_multiline//'%'/'%25'}" - tags_multiline="${tags_multiline//$'\n'/'%0A'}" - tags_multiline="${tags_multiline//$'\r'/'%0D'}" - - echo ::set-output name=tags::$tags_multiline + mkdir src + vcs import src < autoware.repos shell: bash - - name: Docker meta for devel - id: meta-devel - uses: docker/metadata-action@v4 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Restore ccache + uses: actions/cache/restore@v4 + with: + path: | + root-ccache + key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }} + restore-keys: | + ccache-${{ inputs.platform }}- + + - name: Restore apt-get + uses: actions/cache/restore@v4 + with: + path: | + var-cache-apt + key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }} + restore-keys: | + apt-get-${{ inputs.platform }}- + + - name: Inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 + with: + cache-map: | + { + "root-ccache": "/root/.ccache", + "var-cache-apt": "/var/cache/apt" + } + skip-extraction: true + + - name: Get current date + id: date + run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT + shell: bash + + - name: Docker meta for autoware:core-devel + id: meta-core-devel + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=core-devel-${{ inputs.platform }} + type=raw,value=core-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=core-devel-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-core-devel + flavor: | + latest=false + + - name: Docker meta for autoware:universe-sensing-perception-devel + id: meta-universe-sensing-perception-devel + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-sensing-perception-devel-${{ inputs.platform }} + type=raw,value=universe-sensing-perception-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-sensing-perception-devel-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-sensing-perception-devel + flavor: | + latest=false + + - name: Docker meta for autoware:universe-sensing-perception + id: meta-universe-sensing-perception + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-sensing-perception-${{ inputs.platform }} + type=raw,value=universe-sensing-perception-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-sensing-perception-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-sensing-perception + flavor: | + latest=false + + - name: Docker meta for autoware:universe-localization-mapping-devel + id: meta-universe-localization-mapping-devel + 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-devel + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-localization-mapping-devel-${{ inputs.platform }} + type=raw,value=universe-localization-mapping-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-localization-mapping-devel-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-localization-mapping-devel flavor: | latest=false - prefix=${{ inputs.tag-prefix }} - suffix=${{ inputs.tag-suffix }} - - name: Docker meta for prebuilt - id: meta-prebuilt - uses: docker/metadata-action@v4 + - name: Docker meta for autoware:universe-localization-mapping + id: meta-universe-localization-mapping + 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-prebuilt + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-localization-mapping-${{ inputs.platform }} + type=raw,value=universe-localization-mapping-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-localization-mapping-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-localization-mapping flavor: | latest=false - prefix=${{ inputs.tag-prefix }} - suffix=-prebuilt${{ inputs.tag-suffix }} + + - name: Docker meta for autoware:universe-planning-control-devel + id: meta-universe-planning-control-devel + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-planning-control-devel-${{ inputs.platform }} + type=raw,value=universe-planning-control-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-planning-control-devel-,suffix=-${{ inputs.platform }} + 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: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-planning-control-${{ inputs.platform }} + type=raw,value=universe-planning-control-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-planning-control-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-planning-control + flavor: | + latest=false + + - name: Docker meta for autoware:universe-vehicle-system-devel + id: meta-universe-vehicle-system-devel + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-vehicle-system-devel-${{ inputs.platform }} + type=raw,value=universe-vehicle-system-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-vehicle-system-devel-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-vehicle-system-devel + flavor: | + latest=false + + - name: Docker meta for autoware:universe-vehicle-system + id: meta-universe-vehicle-system + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-vehicle-system-${{ inputs.platform }} + type=raw,value=universe-vehicle-system-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-vehicle-system-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-vehicle-system + flavor: | + latest=false + + - name: Docker meta for autoware:universe-devel + id: meta-universe-devel + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-devel-${{ inputs.platform }} + type=raw,value=universe-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-devel-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe-devel + flavor: | + latest=false + + - name: Docker meta for autoware:universe + id: meta-universe + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=universe-${{ inputs.platform }} + type=raw,value=universe-${{ steps.date.outputs.date }}-${{ inputs.platform }} + type=ref,event=tag,prefix=universe-,suffix=-${{ inputs.platform }} + bake-target: docker-metadata-action-universe + flavor: | + latest=auto - 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 }} - # For https://github.com/docker/buildx/issues/756 - - name: Merge json files - run: | - jq -s ".[0] * .[1]" \ - "${{ steps.meta-devel.outputs.bake-file }}" \ - "${{ steps.meta-prebuilt.outputs.bake-file }}" \ - > bake.json - shell: bash - - - name: Build and push - uses: docker/bake-action@v2 + - name: Build and Push to GitHub Container Registry + uses: docker/bake-action@v5 with: - # Checking event_name for https://github.com/autowarefoundation/autoware/issues/2796 - push: ${{ github.event_name == 'schedule' || github.ref_name == github.event.repository.default_branch }} + push: true files: | - docker/${{ inputs.bake-target }}/docker-bake.hcl - bake.json + docker/docker-bake.hcl + ${{ 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-vehicle-system-devel.outputs.bake-file }} + ${{ steps.meta-universe-vehicle-system.outputs.bake-file }} + ${{ steps.meta-universe-devel.outputs.bake-file }} + ${{ steps.meta-universe.outputs.bake-file }} + provenance: false set: | ${{ inputs.build-args }} diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml new file mode 100644 index 00000000000..d5bda73b4f3 --- /dev/null +++ b/.github/actions/docker-build/action.yaml @@ -0,0 +1,110 @@ +name: docker-build +description: Composite action to build images only. + +inputs: + platform: + description: Target platform. + required: true + cache-tag-suffix: + description: Suffix of the target cache tag. + required: true + additional-repos: + description: Additional target .repos file. + default: "" + required: false + build-args: + description: Additional build args. + required: false + +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: Import additional repositories + if: ${{ inputs.additional-repos != '' }} + run: | + vcs import --force src < ${{ inputs.additional-repos }} + shell: bash + + - name: Cache ccache + uses: actions/cache@v4 + if: ${{ github.ref == 'refs/heads/main' && inputs.additional-repos == '' }} + id: cache-ccache + with: + path: | + root-ccache + key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }} + restore-keys: | + ccache-${{ inputs.platform }}- + + - name: Cache apt-get + uses: actions/cache@v4 + if: ${{ github.ref == 'refs/heads/main' && inputs.additional-repos == '' }} + id: cache-apt-get + with: + path: | + var-cache-apt + key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }} + restore-keys: | + apt-get-${{ inputs.platform }}- + + - name: Restore ccache + uses: actions/cache/restore@v4 + if: ${{ github.ref != 'refs/heads/main' || inputs.additional-repos != '' }} + with: + path: | + root-ccache + key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }} + restore-keys: | + ccache-${{ inputs.platform }}- + + - name: Restore apt-get + uses: actions/cache/restore@v4 + if: ${{ github.ref != 'refs/heads/main' || inputs.additional-repos != '' }} + with: + path: | + var-cache-apt + key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }} + restore-keys: | + apt-get-${{ inputs.platform }}- + + - name: Inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 + with: + cache-map: | + { + "root-ccache": "/root/.ccache", + "var-cache-apt": "/var/cache/apt" + } + 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 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + 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.platform }}-${{ inputs.cache-tag-suffix }} diff --git a/.github/actions/free-disk-space/action.yaml b/.github/actions/free-disk-space/action.yaml index 04b0e85235d..963b656313f 100644 --- a/.github/actions/free-disk-space/action.yaml +++ b/.github/actions/free-disk-space/action.yaml @@ -12,25 +12,18 @@ runs: fi shell: bash - # https://github.community/t/bug-strange-no-space-left-on-device-ioexceptions-on-github-runners/17616 - - name: Free disk space - run: | - df -h - - sudo apt-get -y purge \ - dotnet* \ - ghc* \ - php* \ - || true - sudo apt-get -y autoremove - sudo apt-get -y autoclean - - sudo rm -rf \ - /usr/local/lib/android \ - /usr/share/dotnet/ \ - /opt/ghc + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: true - docker rmi $(docker image ls -aq) || true - - df -h - shell: bash + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: false diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 3f3bf243f63..8e2d7193aed 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,10 +1,15 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + version: 2 updates: - package-ecosystem: github-actions directory: / + # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval schedule: - interval: daily + interval: monthly open-pull-requests-limit: 1 labels: - - bot - - github-actions + - tag:bot + - type:github-actions diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..4c4081a67e4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +## Description + +## How was this PR tested? + +## Notes for reviewers + +None. + +## Effects on system behavior + +None. diff --git a/.github/stale.yml b/.github/stale.yml index 84928d1b815..ffce036c8d0 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,10 +1,14 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # Modified from https://github.com/probot/stale#usage # Number of days of inactivity before an Issue or Pull Request with the stale label is closed daysUntilClose: false # Label to use when marking as stale -staleLabel: stale +staleLabel: status:stale # Comment to post when marking as stale markComment: > diff --git a/.github/sync-files.yaml b/.github/sync-files.yaml index e69de29bb2d..e8d63cde667 100644 --- a/.github/sync-files.yaml +++ b/.github/sync-files.yaml @@ -0,0 +1,34 @@ +- repository: autowarefoundation/sync-file-templates + source-dir: sources + files: + - source: .github/ISSUE_TEMPLATE/bug.yaml + - source: .github/ISSUE_TEMPLATE/config.yml + - source: .github/ISSUE_TEMPLATE/task.yaml + - source: .github/dependabot.yaml + - source: .github/pull_request_template.md + - source: .github/stale.yml + - source: .github/workflows/cancel-previous-workflows.yaml + - source: .github/workflows/comment-on-pr.yaml + - source: .github/workflows/github-release.yaml + - source: .github/workflows/pre-commit-optional.yaml + - source: .github/workflows/pre-commit-optional-autoupdate.yaml + - source: .github/workflows/pre-commit-autoupdate.yaml + - source: .github/workflows/semantic-pull-request.yaml + - source: .github/workflows/spell-check-differential.yaml + - source: .github/workflows/spell-check-daily.yaml + - source: .github/workflows/sync-files.yaml + - source: .clang-format + - source: .clang-tidy + - source: .markdown-link-check.json + - source: .markdownlint.yaml + - source: .pre-commit-config-optional.yaml + - source: .pre-commit-config.yaml + - source: .prettierignore + - source: .prettierrc.yaml + - source: .yamllint.yaml + - source: CODE_OF_CONDUCT.md + - source: CONTRIBUTING.md + - source: CPPLINT.cfg + - source: DISCLAIMER.md + - source: LICENSE + - source: setup.cfg diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml new file mode 100644 index 00000000000..72daa21e9cd --- /dev/null +++ b/.github/workflows/autoware-base.yaml @@ -0,0 +1,40 @@ +name: autoware-base + +on: + push: + branches: + - main + paths: + - docker/Dockerfile.base + - docker/scripts/cleanup_*.sh + - .github/actions/docker-build-and-push-base/* + - .github/workflows/autoware-base.yaml + schedule: + - cron: 0 0 15 * * # every 15th of the month + workflow_dispatch: + +jobs: + load-env: + uses: ./.github/workflows/load-env.yaml + + autoware-base: + needs: load-env + runs-on: ubuntu-22.04 + steps: + - name: Check out this repository + uses: actions/checkout@v4 + + - name: Free disk space + uses: ./.github/actions/free-disk-space + + - 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: + 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 }} diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 00000000000..53e4e96cfaa --- /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-22.04 + # 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/build-humble-self-hosted.yaml b/.github/workflows/build-humble-self-hosted.yaml deleted file mode 100644 index b46cf72faab..00000000000 --- a/.github/workflows/build-humble-self-hosted.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: build-humble-self-hosted - -on: - schedule: - - cron: 0 12 * * * - workflow_dispatch: - -jobs: - build-humble-self-hosted: - runs-on: [self-hosted, linux, ARM64] - container: ubuntu:22.04 - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: humble - - - name: Run setup script - run: | - ./setup-dev-env.sh -y universe - - - name: Run vcs import - run: | - mkdir src - vcs import src < autoware.repos - - - name: Run rosdep install - run: | - sudo apt-get -y update - rosdep update - DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro humble - - - name: Build - run: | - . /opt/ros/humble/setup.sh - colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/build-humble.yaml b/.github/workflows/build-humble.yaml deleted file mode 100644 index 7820f27898f..00000000000 --- a/.github/workflows/build-humble.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: build-humble - -on: - schedule: - - cron: 0 12 * * * - workflow_dispatch: - -jobs: - build-humble: - runs-on: ubuntu-latest - container: ubuntu:22.04 - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: humble - - - name: Run setup script - run: | - ./setup-dev-env.sh -y - - - name: Set git config - uses: autowarefoundation/autoware-github-actions/set-git-config@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Run vcs import - run: | - mkdir src - vcs import src < autoware.repos - - - name: Run rosdep install - run: | - sudo apt-get -y update - rosdep update - DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro humble - - - name: Build - run: | - . /opt/ros/humble/setup.sh - colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml deleted file mode 100644 index c1c59540a04..00000000000 --- a/.github/workflows/build-main-self-hosted.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: build-main-self-hosted - -on: - schedule: - - cron: 0 12 * * * - workflow_dispatch: - -jobs: - build-main-self-hosted: - runs-on: [self-hosted, linux, ARM64] - container: ubuntu:20.04 - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: "" - - - name: Run setup script - run: | - ./setup-dev-env.sh -y universe - - - name: Run vcs import - run: | - mkdir src - vcs import src < autoware.repos - - - name: Run rosdep install - run: | - sudo apt-get -y update - rosdep update - DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro galactic - - - name: Build - run: | - . /opt/ros/galactic/setup.sh - colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml deleted file mode 100644 index 2b163ce6f5e..00000000000 --- a/.github/workflows/build-main.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: build-main - -on: - schedule: - - cron: 0 12 * * * - workflow_dispatch: - -jobs: - build-main: - runs-on: ubuntu-latest - container: ubuntu:20.04 - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: "" - - - name: Run setup script - run: | - ./setup-dev-env.sh -y - - - name: Set git config - uses: autowarefoundation/autoware-github-actions/set-git-config@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Run vcs import - run: | - mkdir src - vcs import src < autoware.repos - - - name: Run rosdep install - run: | - sudo apt-get -y update - rosdep update - DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro galactic - - - name: Build - run: | - . /opt/ros/galactic/setup.sh - colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/cancel-previous-workflows.yaml b/.github/workflows/cancel-previous-workflows.yaml index aeb34c6a03d..ee79ce0e4d4 100644 --- a/.github/workflows/cancel-previous-workflows.yaml +++ b/.github/workflows/cancel-previous-workflows.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: cancel-previous-workflows on: @@ -5,10 +9,10 @@ on: jobs: cancel-previous-workflows: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Cancel previous runs - uses: styfle/cancel-workflow-action@0.10.0 + uses: styfle/cancel-workflow-action@0.12.1 with: workflow_id: all all_but_latest: true diff --git a/.github/workflows/comment-on-pr.yaml b/.github/workflows/comment-on-pr.yaml new file mode 100644 index 00000000000..0f2ecf519db --- /dev/null +++ b/.github/workflows/comment-on-pr.yaml @@ -0,0 +1,29 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +name: comment-on-pr +on: + pull_request_target: + +jobs: + comment-on-pr: + runs-on: ubuntu-22.04 + permissions: + pull-requests: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Initial PR comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + message: | + Thank you for contributing to the Autoware project! + + 🚧 If your pull request is in progress, [switch it to draft mode](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft). + + Please ensure: + - You've checked our [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/). + - Your PR follows our [pull request guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/). + - All required CI checks pass before [marking the PR ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review). diff --git a/.github/workflows/create-prs-to-update-vcs-repositories.yaml b/.github/workflows/create-prs-to-update-vcs-repositories.yaml new file mode 100644 index 00000000000..adb5628e28a --- /dev/null +++ b/.github/workflows/create-prs-to-update-vcs-repositories.yaml @@ -0,0 +1,31 @@ +name: create-prs-to-update-vcs-repositories + +on: + schedule: + - cron: 0 0,6,12,18 * * * + workflow_dispatch: + +jobs: + create-version-update-pr: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Generate GitHub App token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Create PRs to update VCS repositories + uses: autowarefoundation/autoware-github-actions/create-prs-to-update-vcs-repositories@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + repo_name: autowarefoundation/autoware + parent_dir: . + targets: major minor patch + base_branch: main + new_branch_prefix: feat/update- + autoware_repos_file_name: autoware.repos + verbosity: 0 diff --git a/.github/workflows/dco.yaml b/.github/workflows/dco.yaml new file mode 100644 index 00000000000..e95b394ac63 --- /dev/null +++ b/.github/workflows/dco.yaml @@ -0,0 +1,21 @@ +name: DCO +# ref: https://github.com/anchore/syft/pull/2926/files +on: + pull_request: +jobs: + dco: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Setup Python 3.x + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Check DCO + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip3 install -U dco-check + dco-check --verbose --exclude-pattern 'pre-commit-ci\[bot\]@users\.noreply\.github\.com' diff --git a/.github/workflows/docker-build-and-push-arm64.yaml b/.github/workflows/docker-build-and-push-arm64.yaml new file mode 100644 index 00000000000..167c1d7ebf3 --- /dev/null +++ b/.github/workflows/docker-build-and-push-arm64.yaml @@ -0,0 +1,128 @@ +name: docker-build-and-push-arm64 + +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: [self-hosted, linux, ARM64] + steps: + # https://github.com/actions/checkout/issues/211 + - name: Change permission of workspace + run: | + sudo chown -R $USER:$USER ${{ github.workspace }} + + - 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: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + *.env + *.repos + .github/actions/docker-build-and-push*/action.yaml + .github/workflows/docker-build-and-push*.yaml + ansible-galaxy-requirements.yaml + ansible/** + docker/** + + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + + - name: Build 'Autoware' without CUDA + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/docker-build-and-push + with: + platform: arm64 + target-image: autoware + build-args: | + *.platform=linux/arm64 + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + *.args.AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + *.args.AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} + *.args.LIB_DIR=aarch64 + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max + + - name: Show disk space + if: always() + run: | + df -h + + docker-build-and-push-cuda: + needs: [load-env, docker-build-and-push] + runs-on: [self-hosted, linux, ARM64] + steps: + - 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: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + *.env + *.repos + .github/actions/docker-build-and-push*/action.yaml + .github/workflows/docker-build-and-push*.yaml + ansible-galaxy-requirements.yaml + ansible/** + docker/** + + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + + - name: Build 'Autoware' with CUDA + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/docker-build-and-push-cuda + with: + platform: arm64 + target-image: autoware + build-args: | + *.platform=linux/arm64 + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + *.args.AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + *.args.AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} + *.args.LIB_DIR=aarch64 + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max + + - name: Show disk space + if: always() + run: | + df -h diff --git a/.github/workflows/docker-build-and-push-humble-self-hosted.yaml b/.github/workflows/docker-build-and-push-humble-self-hosted.yaml deleted file mode 100644 index 193f4631af6..00000000000 --- a/.github/workflows/docker-build-and-push-humble-self-hosted.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: docker-build-and-push-humble-self-hosted - -on: - push: - tags: - - v* - schedule: - - cron: 0 0 1,15 * * - workflow_dispatch: - -jobs: - docker-build-and-push-humble-self-hosted: - runs-on: [self-hosted, linux, ARM64] - strategy: - fail-fast: false - matrix: - name: - - no-cuda - - cuda - include: - - name: no-cuda - base_image_env: base_image - setup-args: --no-nvidia - additional-tag-suffix: "" - - name: cuda - base_image_env: cuda_base_image - setup-args: --no-cuda-drivers - additional-tag-suffix: -cuda - steps: - # https://github.com/actions/checkout/issues/211 - - name: Change permission of workspace - run: | - sudo chown -R $USER:$USER ${{ github.workspace }} - - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: humble - - - name: Free disk space - uses: ./.github/actions/free-disk-space - - - name: Load env - run: | - cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - if [ "$(uname -m)" = "aarch64" ]; then - cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - fi - - - name: Build 'autoware-universe' - uses: ./.github/actions/docker-build-and-push - with: - bake-target: autoware-universe - build-args: | - *.platform=linux/arm64 - *.args.ROS_DISTRO=${{ env.rosdistro }} - *.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }} - *.args.SETUP_ARGS=${{ matrix.setup-args }} - tag-prefix: ${{ env.rosdistro }}- - tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 - - - name: Show disk space - run: | - df -h diff --git a/.github/workflows/docker-build-and-push-humble.yaml b/.github/workflows/docker-build-and-push-humble.yaml deleted file mode 100644 index 367f3a3dfbb..00000000000 --- a/.github/workflows/docker-build-and-push-humble.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: docker-build-and-push-humble - -on: - push: - tags: - - v* - schedule: - - cron: 0 0 1,15 * * - workflow_dispatch: - -jobs: - docker-build-and-push-humble: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - name: - - no-cuda - - cuda - include: - - name: no-cuda - base_image_env: base_image - setup-args: --no-nvidia - additional-tag-suffix: "" - - name: cuda - base_image_env: cuda_base_image - setup-args: --no-cuda-drivers - additional-tag-suffix: -cuda - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: humble - - - name: Free disk space - uses: ./.github/actions/free-disk-space - - - name: Load env - run: | - cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - if [ "$(uname -m)" = "aarch64" ]; then - cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - fi - - - name: Build 'autoware-universe' - uses: ./.github/actions/docker-build-and-push - with: - bake-target: autoware-universe - build-args: | - *.platform=linux/amd64 - *.args.ROS_DISTRO=${{ env.rosdistro }} - *.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }} - *.args.SETUP_ARGS=${{ matrix.setup-args }} - tag-prefix: ${{ env.rosdistro }}- - tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 - - - name: Show disk space - run: | - df -h diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml deleted file mode 100644 index cdf436e9446..00000000000 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: docker-build-and-push-main-self-hosted - -on: - push: - tags: - - v* - schedule: - - cron: 0 0 1,15 * * - workflow_dispatch: - -jobs: - docker-build-and-push-main-self-hosted: - runs-on: [self-hosted, linux, ARM64] - strategy: - fail-fast: false - matrix: - name: - - no-cuda - - cuda - include: - - name: no-cuda - base_image_env: base_image - setup-args: --no-nvidia - additional-tag-suffix: "" - - name: cuda - base_image_env: cuda_base_image - setup-args: --no-cuda-drivers - additional-tag-suffix: -cuda - steps: - # https://github.com/actions/checkout/issues/211 - - name: Change permission of workspace - run: | - sudo chown -R $USER:$USER ${{ github.workspace }} - - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: "" - - - name: Free disk space - uses: ./.github/actions/free-disk-space - - - name: Load env - run: | - cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - if [ "$(uname -m)" = "aarch64" ]; then - cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - fi - - - name: Build 'autoware-universe' - uses: ./.github/actions/docker-build-and-push - with: - bake-target: autoware-universe - build-args: | - *.platform=linux/arm64 - *.args.ROS_DISTRO=${{ env.rosdistro }} - *.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }} - *.args.SETUP_ARGS=${{ matrix.setup-args }} - tag-prefix: ${{ env.rosdistro }}- - tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 - - - name: Show disk space - run: | - df -h diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml deleted file mode 100644 index 9022d798bcc..00000000000 --- a/.github/workflows/docker-build-and-push-main.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: docker-build-and-push-main - -on: - push: - tags: - - v* - schedule: - - cron: 0 0 1,15 * * - workflow_dispatch: - -jobs: - docker-build-and-push-main: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - name: - - no-cuda - - cuda - include: - - name: no-cuda - base_image_env: base_image - setup-args: --no-nvidia - additional-tag-suffix: "" - - name: cuda - base_image_env: cuda_base_image - setup-args: --no-cuda-drivers - additional-tag-suffix: -cuda - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - ref: "" - - - name: Free disk space - uses: ./.github/actions/free-disk-space - - - name: Load env - run: | - cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - if [ "$(uname -m)" = "aarch64" ]; then - cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV - fi - - - name: Build 'autoware-universe' - uses: ./.github/actions/docker-build-and-push - with: - bake-target: autoware-universe - build-args: | - *.platform=linux/amd64 - *.args.ROS_DISTRO=${{ env.rosdistro }} - *.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }} - *.args.SETUP_ARGS=${{ matrix.setup-args }} - tag-prefix: ${{ env.rosdistro }}- - tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 - - - name: Show disk space - run: | - df -h diff --git a/.github/workflows/docker-build-and-push.yaml b/.github/workflows/docker-build-and-push.yaml new file mode 100644 index 00000000000..567678bde3e --- /dev/null +++ b/.github/workflows/docker-build-and-push.yaml @@ -0,0 +1,123 @@ +name: docker-build-and-push + +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 repository + uses: actions/checkout@v4 + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + *.env + *.repos + .github/actions/docker-build-and-push*/action.yaml + .github/workflows/docker-build-and-push*.yaml + ansible-galaxy-requirements.yaml + ansible/** + docker/** + + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + + - name: Build 'Autoware' without CUDA + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/docker-build-and-push + with: + platform: amd64 + target-image: autoware + build-args: | + *.platform=linux/amd64 + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + *.args.AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + *.args.AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} + *.args.LIB_DIR=x86_64 + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max + + - name: Show disk space + if: always() + run: | + df -h + + docker-build-and-push-cuda: + needs: [load-env, docker-build-and-push] + runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large + steps: + - 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: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + *.env + *.repos + .github/actions/docker-build-and-push*/action.yaml + .github/workflows/docker-build-and-push*.yaml + ansible-galaxy-requirements.yaml + ansible/** + docker/** + + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + + - name: Build 'Autoware' with CUDA + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/docker-build-and-push-cuda + with: + platform: amd64 + target-image: autoware + build-args: | + *.platform=linux/amd64 + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + *.args.AUTOWARE_BASE_IMAGE=${{ needs.load-env.outputs.autoware_base_image }} + *.args.AUTOWARE_BASE_CUDA_IMAGE=${{ needs.load-env.outputs.autoware_base_cuda_image }} + *.args.LIB_DIR=x86_64 + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }} + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-main + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max + + - name: Show disk space + if: always() + run: | + df -h diff --git a/.github/workflows/github-release.yaml b/.github/workflows/github-release.yaml index 19e1e9c12e5..bbe2ac512d7 100644 --- a/.github/workflows/github-release.yaml +++ b/.github/workflows/github-release.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: github-release on: @@ -15,7 +19,7 @@ on: jobs: github-release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Set tag name id: set-tag-name @@ -26,11 +30,11 @@ jobs: REF_NAME="${{ github.ref_name }}" fi - echo ::set-output name=ref-name::"$REF_NAME" - echo ::set-output name=tag-name::"${REF_NAME#beta/}" + echo "ref-name=$REF_NAME" >> $GITHUB_OUTPUT + echo "tag-name=${REF_NAME#beta/}" >> $GITHUB_OUTPUT - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ steps.set-tag-name.outputs.ref-name }} @@ -39,7 +43,7 @@ jobs: id: set-target-name run: | if [[ "${{ steps.set-tag-name.outputs.ref-name }}" =~ "beta/" ]]; then - echo ::set-output name=target-name::"${{ steps.set-tag-name.outputs.ref-name }}" + echo "target-name=${{ steps.set-tag-name.outputs.ref-name }}" >> $GITHUB_OUTPUT fi - name: Create a local tag for beta branches @@ -62,7 +66,7 @@ jobs: verb=edit fi - echo ::set-output name=verb::"$verb" + echo "verb=$verb" >> $GITHUB_OUTPUT env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/health-check-arm64.yaml b/.github/workflows/health-check-arm64.yaml new file mode 100644 index 00000000000..9508abc3b1c --- /dev/null +++ b/.github/workflows/health-check-arm64.yaml @@ -0,0 +1,47 @@ +name: health-check-arm64 + +on: + schedule: + - cron: 0 12 * * * + workflow_dispatch: + +jobs: + load-env: + uses: ./.github/workflows/load-env.yaml + + docker-build: + needs: load-env + runs-on: [self-hosted, linux, ARM64] + steps: + # https://github.com/actions/checkout/issues/211 + - name: Change permission of workspace + run: | + sudo chown -R $USER:$USER ${{ github.workspace }} + + - 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' + uses: ./.github/actions/docker-build + with: + platform: arm64 + cache-tag-suffix: main + 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 + if: always() + run: | + df -h diff --git a/.github/workflows/health-check-nightly.yaml b/.github/workflows/health-check-nightly.yaml new file mode 100644 index 00000000000..d3e3ee74c7a --- /dev/null +++ b/.github/workflows/health-check-nightly.yaml @@ -0,0 +1,60 @@ +name: health-check-nightly + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + schedule: + - cron: 0 6 * * * + 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' || + github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch' }} + uses: ./.github/workflows/load-env.yaml + + docker-build-nightly: + needs: load-env + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + steps: + - 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' + uses: ./.github/actions/docker-build + with: + platform: amd64 + cache-tag-suffix: nightly + additional-repos: autoware-nightly.repos + 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 + if: always() + run: | + df -h diff --git a/.github/workflows/health-check.yaml b/.github/workflows/health-check.yaml new file mode 100644 index 00000000000..c51d8a320e4 --- /dev/null +++ b/.github/workflows/health-check.yaml @@ -0,0 +1,59 @@ +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' || + github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch' }} + uses: ./.github/workflows/load-env.yaml + + docker-build: + needs: load-env + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + steps: + - 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' + uses: ./.github/actions/docker-build + with: + platform: amd64 + cache-tag-suffix: main + 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 + if: always() + run: | + df -h diff --git a/.github/workflows/load-env.yaml b/.github/workflows/load-env.yaml new file mode 100644 index 00000000000..48af4b3a145 --- /dev/null +++ b/.github/workflows/load-env.yaml @@ -0,0 +1,40 @@ +name: load-env + +on: + workflow_call: + outputs: + 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: + 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 + + - name: Load env + run: | + cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV + if [ "$(uname -m)" = "aarch64" ]; then + cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV + fi + + - name: Set env + id: set-env + run: | + 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 diff --git a/.github/workflows/mirror-main-branch.yaml b/.github/workflows/mirror-main-branch.yaml new file mode 100644 index 00000000000..c85f67dbc0c --- /dev/null +++ b/.github/workflows/mirror-main-branch.yaml @@ -0,0 +1,15 @@ +name: mirror-main-branch + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + mirror-main-branch: + runs-on: ubuntu-22.04 + steps: + - uses: zofrex/mirror-branch@v1 + with: + target-branch: humble diff --git a/.github/workflows/pre-commit-ansible-autoupdate.yaml b/.github/workflows/pre-commit-ansible-autoupdate.yaml new file mode 100644 index 00000000000..7e3226bfa31 --- /dev/null +++ b/.github/workflows/pre-commit-ansible-autoupdate.yaml @@ -0,0 +1,37 @@ +name: pre-commit-ansible-autoupdate + +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: + +jobs: + check-secret: + uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1 + secrets: + secret: ${{ secrets.APP_ID }} + + pre-commit-ansible-autoupdate: + needs: check-secret + if: ${{ needs.check-secret.outputs.set == 'true' }} + runs-on: ubuntu-22.04 + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run pre-commit-autoupdate + uses: autowarefoundation/autoware-github-actions/pre-commit-autoupdate@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + pre-commit-config: .pre-commit-config-ansible.yaml + pr-labels: | + tag:bot + tag:pre-commit-autoupdate + pr-branch: pre-commit-ansible-autoupdate + pr-title: "ci(pre-commit-ansible): autoupdate" + pr-commit-message: "ci(pre-commit-ansible): autoupdate" + auto-merge-method: squash diff --git a/.github/workflows/pre-commit-ansible.yaml b/.github/workflows/pre-commit-ansible.yaml index feaef88fe2e..4a01eb7fb4f 100644 --- a/.github/workflows/pre-commit-ansible.yaml +++ b/.github/workflows/pre-commit-ansible.yaml @@ -5,10 +5,15 @@ on: jobs: pre-commit-ansible: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Install Ansible Galaxy depends for ansible-lint run: | diff --git a/.github/workflows/pre-commit-autoupdate.yaml b/.github/workflows/pre-commit-autoupdate.yaml new file mode 100644 index 00000000000..60c17d9dabf --- /dev/null +++ b/.github/workflows/pre-commit-autoupdate.yaml @@ -0,0 +1,41 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +name: pre-commit-autoupdate + +on: + schedule: + - cron: 0 0 1 1,4,7,10 * # quarterly + workflow_dispatch: + +jobs: + check-secret: + uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1 + secrets: + secret: ${{ secrets.APP_ID }} + + pre-commit-autoupdate: + needs: check-secret + if: ${{ needs.check-secret.outputs.set == 'true' }} + runs-on: ubuntu-22.04 + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run pre-commit-autoupdate + uses: autowarefoundation/autoware-github-actions/pre-commit-autoupdate@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + pre-commit-config: .pre-commit-config.yaml + pr-labels: | + tag:bot + tag:pre-commit-autoupdate + pr-branch: pre-commit-autoupdate + pr-title: "ci(pre-commit): autoupdate" + pr-commit-message: "ci(pre-commit): autoupdate" + auto-merge-method: squash diff --git a/.github/workflows/pre-commit-optional-autoupdate.yaml b/.github/workflows/pre-commit-optional-autoupdate.yaml new file mode 100644 index 00000000000..6639e5ca6c6 --- /dev/null +++ b/.github/workflows/pre-commit-optional-autoupdate.yaml @@ -0,0 +1,41 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +name: pre-commit-optional-autoupdate + +on: + schedule: + - cron: 0 0 1 1,4,7,10 * # quarterly + workflow_dispatch: + +jobs: + check-secret: + uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1 + secrets: + secret: ${{ secrets.APP_ID }} + + pre-commit-optional-autoupdate: + needs: check-secret + if: ${{ needs.check-secret.outputs.set == 'true' }} + runs-on: ubuntu-22.04 + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run pre-commit-autoupdate + uses: autowarefoundation/autoware-github-actions/pre-commit-autoupdate@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + pre-commit-config: .pre-commit-config-optional.yaml + pr-labels: | + tag:bot + tag:pre-commit-autoupdate + pr-branch: pre-commit-optional-autoupdate + pr-title: "ci(pre-commit-optional): autoupdate" + pr-commit-message: "ci(pre-commit-optional): autoupdate" + auto-merge-method: squash diff --git a/.github/workflows/pre-commit-optional.yaml b/.github/workflows/pre-commit-optional.yaml index 93e05dc2c79..3d0867028f7 100644 --- a/.github/workflows/pre-commit-optional.yaml +++ b/.github/workflows/pre-commit-optional.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: pre-commit-optional on: @@ -5,12 +9,15 @@ on: jobs: pre-commit-optional: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Run pre-commit uses: autowarefoundation/autoware-github-actions/pre-commit@v1 with: pre-commit-config: .pre-commit-config-optional.yaml + base-branch: origin/${{ github.base_ref }} diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 7fd1cc90fe9..4d005e849b5 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -5,26 +5,21 @@ on: jobs: pre-commit: - if: ${{ github.event.repository.private }} - runs-on: ubuntu-latest + if: ${{ github.event.repository.private }} # Use pre-commit.ci for public repositories + runs-on: ubuntu-22.04 steps: - name: Generate token id: generate-token - uses: tibdex/github-app-token@v1 + uses: tibdex/github-app-token@v2 with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.PRIVATE_KEY }} - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} - - name: Set git config - uses: autowarefoundation/autoware-github-actions/set-git-config@v1 - with: - token: ${{ steps.generate-token.outputs.token }} - - name: Run pre-commit uses: autowarefoundation/autoware-github-actions/pre-commit@v1 with: diff --git a/.github/workflows/semantic-pull-request.yaml b/.github/workflows/semantic-pull-request.yaml index 71224c224ec..b56040b084f 100644 --- a/.github/workflows/semantic-pull-request.yaml +++ b/.github/workflows/semantic-pull-request.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: semantic-pull-request on: diff --git a/.github/workflows/setup-docker.yaml b/.github/workflows/setup-docker.yaml index b55a2df8d38..c28b9f7ca32 100644 --- a/.github/workflows/setup-docker.yaml +++ b/.github/workflows/setup-docker.yaml @@ -5,11 +5,10 @@ on: jobs: setup-docker: - runs-on: ubuntu-latest - container: ubuntu:20.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run setup script run: | diff --git a/.github/workflows/setup-universe.yaml b/.github/workflows/setup-universe.yaml index 0081abd5d63..8f4d16d50e8 100644 --- a/.github/workflows/setup-universe.yaml +++ b/.github/workflows/setup-universe.yaml @@ -5,11 +5,15 @@ on: jobs: setup-universe: - runs-on: ubuntu-latest - container: ubuntu:20.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Run setup script run: | diff --git a/.github/workflows/spell-check-daily.yaml b/.github/workflows/spell-check-daily.yaml new file mode 100644 index 00000000000..2ff647acf03 --- /dev/null +++ b/.github/workflows/spell-check-daily.yaml @@ -0,0 +1,26 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +name: spell-check-daily + +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: + +jobs: + spell-check-daily: + runs-on: ubuntu-22.04 + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Run spell-check + uses: autowarefoundation/autoware-github-actions/spell-check@v1 + with: + incremental-files-only: false + cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json + dict-packages: | + https://github.com/autowarefoundation/autoware-spell-check-dict + https://github.com/tier4/cspell-dicts diff --git a/.github/workflows/spell-check-differential.yaml b/.github/workflows/spell-check-differential.yaml index eb18ccdba38..e3af4327f21 100644 --- a/.github/workflows/spell-check-differential.yaml +++ b/.github/workflows/spell-check-differential.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: spell-check-differential on: @@ -5,12 +9,15 @@ on: jobs: spell-check-differential: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run spell-check uses: autowarefoundation/autoware-github-actions/spell-check@v1 with: - cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json + cspell-json-url: https://raw.githubusercontent.com/autowarefoundation/autoware-spell-check-dict/main/.cspell.json + dict-packages: | + https://github.com/autowarefoundation/autoware-spell-check-dict + https://github.com/tier4/cspell-dicts diff --git a/.github/workflows/sync-files.yaml b/.github/workflows/sync-files.yaml index b9dc5907a50..9224c1503ed 100644 --- a/.github/workflows/sync-files.yaml +++ b/.github/workflows/sync-files.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + name: sync-files on: @@ -14,11 +18,11 @@ jobs: sync-files: needs: check-secret if: ${{ needs.check-secret.outputs.set == 'true' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Generate token id: generate-token - uses: tibdex/github-app-token@v1 + uses: tibdex/github-app-token@v2 with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.PRIVATE_KEY }} @@ -28,6 +32,6 @@ jobs: with: token: ${{ steps.generate-token.outputs.token }} pr-labels: | - bot - sync-files + tag:bot + tag:sync-files auto-merge-method: squash diff --git a/.github/workflows/update-docker-manifest.yaml b/.github/workflows/update-docker-manifest.yaml index b92c9403b48..d37c187acfb 100644 --- a/.github/workflows/update-docker-manifest.yaml +++ b/.github/workflows/update-docker-manifest.yaml @@ -2,45 +2,17 @@ name: update-docker-manifest on: schedule: - - cron: 0 0 * * * + - cron: 0 */2 * * * workflow_dispatch: jobs: update-docker-manifest: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Combine multi arch images for 'autoware-universe' + - name: Combine multi arch images for 'Autoware' uses: ./.github/actions/combine-multi-arch-images with: - package-name: autoware-universe - - - name: Create alias from 'autoware-universe:{rosdistro}-latest' to 'autoware-universe:latest' - uses: ./.github/actions/create-main-distro-alias - with: - package-name: autoware-universe - rosdistro: galactic - tag-name: latest - - - name: Create alias from 'autoware-universe:{rosdistro}-latest-prebuilt' to 'autoware-universe:latest-prebuilt' - uses: ./.github/actions/create-main-distro-alias - with: - package-name: autoware-universe - rosdistro: galactic - tag-name: latest-prebuilt - - - name: Create alias from 'autoware-universe:{rosdistro}-latest-cuda' to 'autoware-universe:latest-cuda' - uses: ./.github/actions/create-main-distro-alias - with: - package-name: autoware-universe - rosdistro: galactic - tag-name: latest-cuda - - - name: Create alias from 'autoware-universe:{rosdistro}-latest-prebuilt-cuda' to 'autoware-universe:latest-prebuilt-cuda' - uses: ./.github/actions/create-main-distro-alias - with: - package-name: autoware-universe - rosdistro: galactic - tag-name: latest-prebuilt-cuda + package-name: autoware diff --git a/.github/workflows/update-tool-versions.yaml b/.github/workflows/update-tool-versions.yaml index 6dbeead889b..7ffa17bd25d 100644 --- a/.github/workflows/update-tool-versions.yaml +++ b/.github/workflows/update-tool-versions.yaml @@ -7,37 +7,40 @@ on: jobs: update-tool-versions: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Generate token id: generate-token - uses: tibdex/github-app-token@v1 + uses: tibdex/github-app-token@v2 with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.PRIVATE_KEY }} - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up sd - uses: kenji-miyake/setup-sd@v1 + uses: kenji-miyake/setup-sd@v2 - name: Get clang-format version id: get-clang-format-version run: | - latest_tag_name=$(gh release view --repo https://github.com/llvm/llvm-project --json tagName --jq ".tagName") - echo ::set-output name=version::$(echo "$latest_tag_name" | sd '.*-(.*)' '$1') + function get-latest-pip-version() { + pip index versions "$1" 2>/dev/null | head -n1 | sd '.*\((.*)\)' '$1' + } + + echo "version=$(get-latest-pip-version clang-format)" >> $GITHUB_OUTPUT env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update clang-format version run: | - sd '(clang_format_version): .*' '$1: ${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/defaults/main.yaml - sd '(clang_format_version)=.*' '$1=${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/README.md + sd '(pre_commit_clang_format_version): .*' '$1: ${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/defaults/main.yaml + sd '(pre_commit_clang_format_version)=.*' '$1=${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/README.md - name: Create PR id: create-pr - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.generate-token.outputs.token }} base: ${{ github.event.repository.default_branch }} @@ -46,8 +49,8 @@ jobs: commit-message: "chore: update tool versions" body: "" labels: | - bot - update-tool-versions + tag:bot + tag:update-tool-versions signoff: true delete-branch: true @@ -59,8 +62,6 @@ jobs: - name: Enable auto-merge if: ${{ steps.create-pr.outputs.pull-request-operation == 'created' }} - uses: peter-evans/enable-pull-request-automerge@v2 - with: - token: ${{ steps.generate-token.outputs.token }} - pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} - merge-method: squash + run: gh pr merge --squash --auto "${{ steps.create-pr.outputs.pull-request-number }}" + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} diff --git a/.github/workflows/vcs-import.yaml b/.github/workflows/vcs-import.yaml deleted file mode 100644 index e13491f764e..00000000000 --- a/.github/workflows/vcs-import.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: vcs-import - -on: - pull_request: - workflow_dispatch: - -jobs: - vcs-import: - runs-on: ubuntu-latest - container: ros:galactic - steps: - - name: Check out repository - uses: actions/checkout@v3 - - - name: Install pip for rosdep - run: | - sudo apt-get -y update - sudo apt-get -y install python3-pip - - - name: Register AutonomouStuff repository - uses: autowarefoundation/autoware-github-actions/register-autonomoustuff-repository@v1 - with: - rosdistro: galactic - - - name: Set git config - uses: autowarefoundation/autoware-github-actions/set-git-config@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Run vcs import - run: | - mkdir src - vcs import src < autoware.repos - - - name: Run rosdep install - run: | - sudo apt-get -y update - rosdep update - DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro galactic diff --git a/.gitignore b/.gitignore index 1dba4b816bf..024b426a3b1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,12 @@ log/ # Jetbrains .idea/ + +# rviz Screen Capture +capture/ + +# CodeChecker +.codechecker/ + +# Node.js +node_modules/ diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 00000000000..10c6f4532b7 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,5 @@ +ignored: + - DL3008 # Pin versions in apt get install. Instead of `apt-get install ` use `apt-get install =` + - DL3013 # Pin versions in pip. Instead of `pip install `, use `pip install ==` + - DL3015 # Avoid additional packages by specifying `--no-install-recommends` + - DL3009 # Delete the apt-get lists after installing something diff --git a/.markdown-link-check.json b/.markdown-link-check.json index dec3db1ad1c..c71a3e42536 100644 --- a/.markdown-link-check.json +++ b/.markdown-link-check.json @@ -4,6 +4,9 @@ { "pattern": "^http://localhost" }, + { + "pattern": "^http://127\\.0\\.0\\.1" + }, { "pattern": "^https://github.com/.*/discussions/new" } diff --git a/.markdownlint.yaml b/.markdownlint.yaml index df1f518dc0d..584154b2009 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,9 +1,16 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules. default: true MD013: false MD024: siblings_only: true +MD029: + style: ordered MD033: false MD041: false +MD045: false MD046: false MD049: false diff --git a/.pre-commit-config-ansible.yaml b/.pre-commit-config-ansible.yaml index 9fce5a08e07..971918e470f 100644 --- a/.pre-commit-config-ansible.yaml +++ b/.pre-commit-config-ansible.yaml @@ -1,5 +1,7 @@ repos: - repo: https://github.com/ansible/ansible-lint.git - rev: v5.3.2 + rev: v24.12.2 hooks: - id: ansible-lint + additional_dependencies: + - ansible diff --git a/.pre-commit-config-optional.yaml b/.pre-commit-config-optional.yaml index a805f1201c4..56000d93a8a 100644 --- a/.pre-commit-config-optional.yaml +++ b/.pre-commit-config-optional.yaml @@ -1,6 +1,10 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + repos: - repo: https://github.com/tcort/markdown-link-check - rev: v3.10.0 + rev: v3.13.6 hooks: - id: markdown-link-check - args: [--config=.markdown-link-check.json] + args: [--quiet, --config=.markdown-link-check.json] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4276b3f568d..48a97c13ef9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,24 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + +# https://pre-commit.ci/#configuration ci: - autofix_commit_msg: "ci(pre-commit): autofix" - autoupdate_commit_msg: "ci(pre-commit): autoupdate" + autofix_commit_msg: "style(pre-commit): autofix" + # we already have our own daily update mechanism, we set this to quarterly + autoupdate_schedule: quarterly + autoupdate_commit_msg: "ci(pre-commit): quarterly autoupdate" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v5.0.0 hooks: - id: check-json - id: check-merge-conflict - id: check-toml - id: check-xml - id: check-yaml + args: [--unsafe] - id: detect-private-key - id: end-of-file-fixer - id: mixed-line-ending @@ -18,35 +26,84 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.31.1 + rev: v0.43.0 hooks: - id: markdownlint args: [-c, .markdownlint.yaml, --fix] - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v4.0.0-alpha.8 hooks: - id: prettier - repo: https://github.com/adrienverge/yamllint - rev: v1.26.3 + rev: v1.35.1 hooks: - id: yamllint + - repo: https://github.com/tier4/pre-commit-hooks-ros + rev: v0.10.0 + hooks: + - id: flake8-ros + - id: prettier-xacro + - id: prettier-launch-xml + - id: prettier-package-xml + - id: ros-include-guard + - id: sort-package-xml + - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.8.0.4 + rev: v0.10.0.1 hooks: - id: shellcheck - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.5.1-1 + rev: v3.10.0-2 hooks: - id: shfmt args: [-w, -s, -i=4] + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + + - repo: https://github.com/psf/black + rev: 24.10.0 + hooks: + - id: black + args: [--line-length=100] + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v19.1.5 + hooks: + - id: clang-format + types_or: [c++, c, cuda] + + - repo: https://github.com/cpplint/cpplint + rev: 2.0.0 + hooks: + - id: cpplint + args: [--quiet] + exclude: .cu + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.30.0 + hooks: + - id: check-metaschema + files: ^.+/schema/.*schema\.json$ + + - repo: local + hooks: + - id: prettier-svg + name: prettier svg + description: Apply Prettier with plugin-xml to svg. + entry: prettier --write --list-different --ignore-unknown --print-width 200 --xml-self-closing-space false --xml-whitespace-sensitivity ignore + language: node + files: .svg$ + additional_dependencies: [prettier@2.7.1, "@prettier/plugin-xml@2.2.0"] + - repo: https://github.com/AleksaC/hadolint-py - rev: v2.10.0 + rev: v2.12.1b3 hooks: - id: hadolint - -exclude: .svg + exclude: .svg$ diff --git a/.prettierignore b/.prettierignore index a3c34d00a13..3e96aacebba 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,6 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + *.param.yaml *.rviz diff --git a/.prettierrc.yaml b/.prettierrc.yaml index e29bf327627..fe476936f7b 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + printWidth: 100 tabWidth: 2 overrides: diff --git a/.webauto-ci.yaml b/.webauto-ci.yaml index 7e1e4470a51..2d6771107f5 100644 --- a/.webauto-ci.yaml +++ b/.webauto-ci.yaml @@ -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/iv/main/amd64/v2 + 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 @@ -13,17 +81,15 @@ 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 autoware_launch_file: planning_simulator.launch.xml - architecture_type: awf/universe + architecture_type: awf/universe/20230906 vehicle_model: sample_vehicle sensor_model: sample_sensor_kit - initialize_duration: "45" + initialize_duration: "90" release: components: diff --git a/.webauto-ci/main/autoware-build/run.sh b/.webauto-ci/main/autoware-build/run.sh new file mode 100755 index 00000000000..f6d3751afad --- /dev/null +++ b/.webauto-ci/main/autoware-build/run.sh @@ -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 diff --git a/.webauto-ci/main/autoware-setup/run.sh b/.webauto-ci/main/autoware-setup/run.sh new file mode 100755 index 00000000000..a4f840c9398 --- /dev/null +++ b/.webauto-ci/main/autoware-setup/run.sh @@ -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/=.*//" >/etc/sudoers +gpasswd -a "$user" sudo diff --git a/.yamllint.yaml b/.yamllint.yaml index 2c7bd088e26..e0be62dbcb1 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + extends: default ignore: | diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c493cad4da5..8dbcfb8510a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -conduct@autoware.org. +. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CPPLINT.cfg b/CPPLINT.cfg index ba6bdf08c10..159042dba0b 100644 --- a/CPPLINT.cfg +++ b/CPPLINT.cfg @@ -1,12 +1,18 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + # Modified from https://github.com/ament/ament_lint/blob/ebd524bb9973d5ec1dc48a670ce54f958a5a0243/ament_cpplint/ament_cpplint/main.py#L64-L120 set noparent linelength=100 includeorder=standardcfirst filter=-build/c++11 # we do allow C++11 +filter=-build/c++17 # we allow filter=-build/namespaces_literals # we allow using namespace for literals filter=-runtime/references # we consider passing non-const references to be ok filter=-whitespace/braces # we wrap open curly braces for namespaces, classes and functions filter=-whitespace/indent # we don't indent keywords like public, protected and private with one space +filter=-whitespace/newline # we allow the developer to decide about newline at the end of file (it's clashing with clang-format) filter=-whitespace/parens # we allow closing parenthesis to be on the next line filter=-whitespace/semicolon # we allow the developer to decide about whitespace after a semicolon filter=-build/header_guard # we automatically fix the names of header guards using pre-commit diff --git a/README.md b/README.md index 5713f156e1a..af125d7015a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,56 @@ # Autoware - the world's leading open-source software project for autonomous driving ![Autoware_RViz](https://user-images.githubusercontent.com/63835446/158918717-58d6deaf-93fb-47f9-891d-e242b02cba7b.png) -[![Discord](https://img.shields.io/discord/953808765935816715?label=Autoware%20Discord&style=for-the-badge)](https://discord.gg/Q94UsPvReQ) + + +

+ + Autoware Universe Contributors + + Autoware Contributors +

+ + +

+ + Autoware Universe Activity + + Autoware Activity +

+ + +

+ + License +

+ + +

+ + health-check CI + + Code Coverage +

+ + +

+ + Autoware Discord + + Autoware Twitter / X + + Autoware Linkedin +

Autoware is an open-source software stack for self-driving vehicles, built on the [Robot Operating System (ROS)](https://www.ros.org/). It includes all of the necessary functions to drive an autonomous vehicles from localization and object detection to route planning and control, and was created with the aim of enabling as many individuals and organizations as possible to contribute to open innovations in autonomous driving technology. @@ -36,7 +85,7 @@ To learn more about using or developing Autoware, refer to the [Autoware documen ## Using Autoware.AI -If you wish to use Autoware.AI, the previous version of Autoware based on ROS 1, switch to [autoware-ai](https://github.com/autowarefoundation/autoware.ai/tree/autoware-ai) branch. However, be aware that Autoware.AI will reach the end-of-life by the end of 2022, and we strongly recommend transitioning to Autoware Core/Universe for future use. +If you wish to use Autoware.AI, the previous version of Autoware based on ROS 1, switch to [autoware-ai](https://github.com/autowarefoundation/autoware_ai) repository. However, be aware that Autoware.AI has reached the end-of-life as of 2022, and we strongly recommend transitioning to Autoware Core/Universe for future use. ## Contributing @@ -49,3 +98,4 @@ If you wish to use Autoware.AI, the previous version of Autoware based on ROS 1, - [Autoware Foundation homepage](https://www.autoware.org/) - [Support guidelines](https://autowarefoundation.github.io/autoware-documentation/main/support/support-guidelines/) +- [CI metrics](https://autowarefoundation.github.io/autoware-ci-metrics/) diff --git a/amd64.env b/amd64.env index dad15c2106b..f1a068d50b7 100644 --- a/amd64.env +++ b/amd64.env @@ -1,7 +1,9 @@ -rosdistro=galactic +rosdistro=humble rmw_implementation=rmw_cyclonedds_cpp -base_image=ubuntu:20.04 -cuda_base_image=nvidia/cuda:11.6.2-devel-ubuntu20.04 -cuda_version=11.6 -cudnn_version=8.4.1.50-1+cuda11.6 -tensorrt_version=8.4.2-1+cuda11.6 +base_image=ros:humble-ros-base-jammy +autoware_base_image=ghcr.io/autowarefoundation/autoware-base:latest +autoware_base_cuda_image=ghcr.io/autowarefoundation/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 +pre_commit_clang_format_version=17.0.5 diff --git a/ansible/README.md b/ansible/README.md index 3a252f1a23a..6fd630f75fa 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1 +1,31 @@ # Ansible Collection - autoware.dev_env + +This collection contains the playbooks to set up the development environment for Autoware. + +## Set up a development environment + +### Ansible installation + +```bash +# Remove apt installed ansible (In Ubuntu 22.04, ansible the version is old) +sudo apt-get purge ansible + +# Install pipx +sudo apt-get -y update +sudo apt-get -y install pipx + +# Add pipx to the system PATH +python3 -m pipx ensurepath + +# Install ansible +pipx install --include-deps --force "ansible==6.*" +``` + +### Install ansible collections + +This step should be repeated when a new playbook is added. + +```bash +cd ~/autoware # The root directory of the cloned repository +ansible-galaxy collection install -f -r "ansible-galaxy-requirements.yaml" +``` diff --git a/ansible/playbooks/core.yaml b/ansible/playbooks/core.yaml deleted file mode 100644 index 5b08cd863a7..00000000000 --- a/ansible/playbooks/core.yaml +++ /dev/null @@ -1,16 +0,0 @@ -- hosts: localhost - connection: local - pre_tasks: - - name: Print args - ansible.builtin.debug: - msg: - - rosdistro: "{{ rosdistro }}" - - rmw_implementation: "{{ rmw_implementation }}" - roles: - - role: autoware.dev_env.autoware_core - - role: autoware.dev_env.ccache - - role: autoware.dev_env.plotjuggler - - role: autoware.dev_env.pre_commit - - role: autoware.dev_env.ros2 - - role: autoware.dev_env.ros2_dev_tools - - role: autoware.dev_env.rmw_implementation diff --git a/ansible/playbooks/docker.yaml b/ansible/playbooks/docker.yaml index 7948de7ad90..5cc84043e27 100644 --- a/ansible/playbooks/docker.yaml +++ b/ansible/playbooks/docker.yaml @@ -1,6 +1,26 @@ -- hosts: localhost +- name: Set up Docker development environments for Autoware + hosts: localhost connection: local + vars_prompt: + - name: prompt_install_nvidia + prompt: |- + [Warning] Some Autoware components depend on the CUDA, cuDNN and TensorRT NVIDIA libraries which have end-user license agreements that should be reviewed before installation. + Install NVIDIA libraries? [y/N] + private: false + pre_tasks: + - name: Print args + ansible.builtin.debug: + msg: + - cuda_version: "{{ cuda_version }}" + - cudnn_version: "{{ cudnn_version }}" + - name: Show a warning if the NVIDIA libraries will not be installed + ansible.builtin.pause: + seconds: 10 + prompt: | + [Warning] Skipping installation of NVIDIA libraries. Please manually install them if you plan to use any dependent components. + when: prompt_install_nvidia != 'y' roles: + - role: autoware.dev_env.cuda + when: prompt_install_nvidia == 'y' - role: autoware.dev_env.docker_engine - - role: autoware.dev_env.nvidia_docker - - role: autoware.dev_env.rocker + - role: autoware.dev_env.nvidia_container_toolkit diff --git a/ansible/playbooks/download_artifacts.yaml b/ansible/playbooks/download_artifacts.yaml new file mode 100644 index 00000000000..17da12494d5 --- /dev/null +++ b/ansible/playbooks/download_artifacts.yaml @@ -0,0 +1,4 @@ +- name: Download Autoware artifacts + hosts: localhost + roles: + - autoware.dev_env.artifacts diff --git a/ansible/playbooks/install_rviz_theme.yaml b/ansible/playbooks/install_rviz_theme.yaml new file mode 100644 index 00000000000..a30b0900ddf --- /dev/null +++ b/ansible/playbooks/install_rviz_theme.yaml @@ -0,0 +1,4 @@ +- name: Install RViz theme + hosts: localhost + roles: + - autoware.dev_env.qt5ct_setup diff --git a/ansible/playbooks/openadkit.yaml b/ansible/playbooks/openadkit.yaml new file mode 100644 index 00000000000..dc02ee99ef5 --- /dev/null +++ b/ansible/playbooks/openadkit.yaml @@ -0,0 +1,48 @@ +- name: Set up source development environments for Autoware Universe + hosts: localhost + connection: local + pre_tasks: + - name: Verify OS + ansible.builtin.fail: + msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/. + when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '22.04' + + - name: Print args + ansible.builtin.debug: + msg: + - module: "{{ module }}" + - rosdistro: "{{ rosdistro }}" + - rmw_implementation: "{{ rmw_implementation }}" + - cuda_version: "{{ cuda_version }}" + - cudnn_version: "{{ cudnn_version }}" + - tensorrt_version: "{{ tensorrt_version }}" + roles: + # Autoware base dependencies + - role: autoware.dev_env.rmw_implementation + when: module == 'base' + - role: autoware.dev_env.gdown + when: module == 'base' + - role: autoware.dev_env.kisak_mesa + when: module == 'base' + - role: autoware.dev_env.pacmod + when: module == 'base' + - role: autoware.dev_env.build_tools + when: module == 'all' and install_devel=='y' + + # Module specific dependencies + - role: autoware.dev_env.geographiclib + when: module == 'perception-localization' or module == 'all' + - role: autoware.dev_env.cuda + when: (module == 'base' or module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' + - role: autoware.dev_env.tensorrt + when: (module == 'base' or module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' + + # Development environment + - role: autoware.dev_env.dev_tools + when: module == 'dev-tools' + - role: autoware.dev_env.ros2_dev_tools + when: module == 'dev-tools' + + # ONNX files and other artifacts + - role: autoware.dev_env.artifacts + when: prompt_download_artifacts == 'y' diff --git a/ansible/playbooks/rosdep.yaml b/ansible/playbooks/rosdep.yaml new file mode 100644 index 00000000000..c7c23a245ab --- /dev/null +++ b/ansible/playbooks/rosdep.yaml @@ -0,0 +1,10 @@ +- name: Register rosdep package repositories + hosts: localhost + connection: local + pre_tasks: + - name: Verify OS + ansible.builtin.fail: + msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/. + when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '22.04' + roles: + - role: autoware.dev_env.pacmod diff --git a/ansible/playbooks/telegraf.yaml b/ansible/playbooks/telegraf.yaml new file mode 100644 index 00000000000..a490821a23f --- /dev/null +++ b/ansible/playbooks/telegraf.yaml @@ -0,0 +1,4 @@ +- name: Set up Telegraf and InfluxDB v2 + hosts: localhost + roles: + - autoware.dev_env.telegraf diff --git a/ansible/playbooks/universe.yaml b/ansible/playbooks/universe.yaml index cc14ec7fa22..ce32248d98b 100644 --- a/ansible/playbooks/universe.yaml +++ b/ansible/playbooks/universe.yaml @@ -1,4 +1,5 @@ -- hosts: localhost +- name: Set up source development environments for Autoware Universe + hosts: localhost connection: local vars_prompt: - name: prompt_install_nvidia @@ -6,7 +7,22 @@ [Warning] Some Autoware components depend on the CUDA, cuDNN and TensorRT NVIDIA libraries which have end-user license agreements that should be reviewed before installation. Install NVIDIA libraries? [y/N] private: false + - name: prompt_download_artifacts + prompt: |- + [Warning] Should the ONNX model files and other artifacts be downloaded alongside setting up the development environment. + Download artifacts? [y/N] + private: false + - name: install_devel + prompt: |- + [Warning] Do you want to install recommended development tools for Autoware? [y/N] + private: false + default: y pre_tasks: + - name: Verify OS + ansible.builtin.fail: + msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/. + when: ansible_distribution_version != '22.04' + - name: Print args ansible.builtin.debug: msg: @@ -15,6 +31,7 @@ - cuda_version: "{{ cuda_version }}" - cudnn_version: "{{ cudnn_version }}" - tensorrt_version: "{{ tensorrt_version }}" + - name: Show a warning if the NVIDIA libraries will not be installed ansible.builtin.pause: seconds: 10 @@ -22,20 +39,29 @@ [Warning] Skipping installation of NVIDIA libraries. Please manually install them if you plan to use any dependent components. when: prompt_install_nvidia != 'y' roles: - # Core - - role: autoware.dev_env.autoware_core - - role: autoware.dev_env.ccache - - role: autoware.dev_env.plotjuggler - - role: autoware.dev_env.pre_commit + # Autoware base dependencies - role: autoware.dev_env.ros2 - role: autoware.dev_env.ros2_dev_tools - role: autoware.dev_env.rmw_implementation + - role: autoware.dev_env.gdown + - role: autoware.dev_env.build_tools - # Universe - - role: autoware.dev_env.autoware_universe + # Autoware module dependencies + - role: autoware.dev_env.geographiclib - role: autoware.dev_env.cuda when: prompt_install_nvidia == 'y' - role: autoware.dev_env.pacmod when: rosdistro != 'rolling' - role: autoware.dev_env.tensorrt when: prompt_install_nvidia == 'y' + + # Autoware devel dependencies + - role: autoware.dev_env.dev_tools + when: install_devel == 'y' + + # ONNX files and other artifacts + - role: autoware.dev_env.artifacts + when: prompt_download_artifacts == 'y' + + # Qt5ct setup (RViz theme) + - role: autoware.dev_env.qt5ct_setup diff --git a/ansible/roles/artifacts/README.md b/ansible/roles/artifacts/README.md new file mode 100644 index 00000000000..7d848a98eca --- /dev/null +++ b/ansible/roles/artifacts/README.md @@ -0,0 +1,32 @@ +# Autoware artifacts + +The Autoware perception stack uses models for inference. These models are automatically downloaded as part of the `setup-dev-env.sh` script. + +The models are hosted by Web.Auto. + +Default `data_dir` location is `~/autoware_data`. + +## Download instructions + +### Requirements + +Install ansible following the instructions in the [ansible installation guide](../../README.md#ansible-installation). + +### Download artifacts + +#### Install ansible collections + +```bash +cd ~/autoware # The root directory of the cloned repository +ansible-galaxy collection install -f -r "ansible-galaxy-requirements.yaml" +``` + +This step should be repeated when a new playbook is added. + +#### Run the playbook + +```bash +ansible-playbook autoware.dev_env.download_artifacts -e "data_dir=$HOME/autoware_data" --ask-become-pass +``` + +This will download and extract the artifacts to the specified directory and validate the checksums. diff --git a/ansible/roles/autoware_core/defaults/main.yaml b/ansible/roles/artifacts/defaults/main.yaml similarity index 100% rename from ansible/roles/autoware_core/defaults/main.yaml rename to ansible/roles/artifacts/defaults/main.yaml diff --git a/ansible/roles/autoware_core/meta/main.yaml b/ansible/roles/artifacts/meta/main.yaml similarity index 100% rename from ansible/roles/autoware_core/meta/main.yaml rename to ansible/roles/artifacts/meta/main.yaml diff --git a/ansible/roles/artifacts/tasks/main.yaml b/ansible/roles/artifacts/tasks/main.yaml new file mode 100644 index 00000000000..c4f7ede0089 --- /dev/null +++ b/ansible/roles/artifacts/tasks/main.yaml @@ -0,0 +1,404 @@ +# yabloc_pose_initializer +- name: Create yabloc_pose_initializer directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/yabloc_pose_initializer" + mode: "755" + state: directory + +- name: Download yabloc_pose_initializer/resources.tar.gz + become: true + ansible.builtin.get_url: + url: https://s3.ap-northeast-2.wasabisys.com/pinto-model-zoo/136_road-segmentation-adas-0001/resources.tar.gz + dest: "{{ data_dir }}/yabloc_pose_initializer/resources.tar.gz" + mode: "644" + checksum: sha256:1f660e15f95074bade32b1f80dbf618e9cee1f0b9f76d3f4671cb9be7f56eb3a + +- name: Extract yabloc_pose_initializer/resources.tar.gz + ansible.builtin.unarchive: + src: "{{ data_dir }}/yabloc_pose_initializer/resources.tar.gz" + dest: "{{ data_dir }}/yabloc_pose_initializer/" + +# image_projection_based_fusion +- name: Create image_projection_based_fusion directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/image_projection_based_fusion" + mode: "755" + state: directory + +- name: Download image_projection_based_fusion/pts_voxel_encoder_pointpainting.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/pointpainting/v4/pts_voxel_encoder_pointpainting.onnx + dest: "{{ data_dir }}/image_projection_based_fusion/pts_voxel_encoder_pointpainting.onnx" + mode: "644" + checksum: sha256:3ca452ea5ca9467bf782955f75704ba8466841e275e8b8acd991b9911d53249e + +- name: Download image_projection_based_fusion/pts_backbone_neck_head_pointpainting.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/pointpainting/v4/pts_backbone_neck_head_pointpainting.onnx + dest: "{{ data_dir }}/image_projection_based_fusion/pts_backbone_neck_head_pointpainting.onnx" + mode: "644" + checksum: sha256:7fe62fcebe0e0f62a000d06aa94d779feb444d933671a4a3189fe01be8c19a00 +- name: Download image_projection_based_fusion/detection_class_remapper.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/pointpainting/v4/detection_class_remapper.param.yaml + dest: "{{ data_dir }}/image_projection_based_fusion/detection_class_remapper.param.yaml" + mode: "644" + checksum: sha256:c711f8875ece9b527dfe31ffc75f8c0de2e77945ef67860a959a4e04c36772d5 +- name: Download image_projection_based_fusion/pointpainting_ml_package.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/pointpainting/v4/pointpainting_ml_package.param.yaml + dest: "{{ data_dir }}/image_projection_based_fusion/pointpainting_ml_package.param.yaml" + mode: "644" + checksum: sha256:2a72f75ca4b49c6b88c0bd2f34c634173420d76a6925e6298d9ca5e012df3f32 +# lidar_apollo_instance_segmentation +- name: Create lidar_apollo_instance_segmentation directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/lidar_apollo_instance_segmentation" + mode: "755" + state: directory + +- name: Download lidar_apollo_instance_segmentation/vlp-16.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/lidar_apollo_instance_segmentation/vlp-16.onnx + dest: "{{ data_dir }}/lidar_apollo_instance_segmentation/vlp-16.onnx" + mode: "644" + checksum: sha256:eec521ebad7553d0ea2c90472a293aecb7499ab592632f0e100481c8196eb421 + +- name: Download lidar_apollo_instance_segmentation/hdl-64.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/lidar_apollo_instance_segmentation/hdl-64.onnx + dest: "{{ data_dir }}/lidar_apollo_instance_segmentation/hdl-64.onnx" + mode: "644" + checksum: sha256:86348d8c4bced750f54288b01cc471c0d4f1ec9c693466169ef19413731e6ecc + +- name: Download lidar_apollo_instance_segmentation/vls-128.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/lidar_apollo_instance_segmentation/vls-128.onnx + dest: "{{ data_dir }}/lidar_apollo_instance_segmentation/vls-128.onnx" + mode: "644" + checksum: sha256:95ef950bb694bd6de91b7e47f5d191d557e92a7f5e2a6bdf655a8b5eed4075cc + +# lidar_centerpoint +- name: Create lidar_centerpoint directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/lidar_centerpoint" + mode: "755" + state: directory + +- name: Download lidar_centerpoint/pts_voxel_encoder_centerpoint.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_voxel_encoder_centerpoint.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_voxel_encoder_centerpoint.onnx" + mode: "644" + checksum: sha256:dc1a876580d86ee7a341d543f8ade2ede7f43bd032dc5b44155b1f0175405764 + +- name: Download lidar_centerpoint/pts_backbone_neck_head_centerpoint.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_backbone_neck_head_centerpoint.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_backbone_neck_head_centerpoint.onnx" + mode: "644" + checksum: sha256:3fe7e128955646740c41a25be0c8f141d5a94594fe79d7405fe2a859e391542e + +- name: Download lidar_centerpoint/pts_voxel_encoder_centerpoint_tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_voxel_encoder_centerpoint_tiny.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_voxel_encoder_centerpoint_tiny.onnx" + mode: "644" + checksum: sha256:2c53465715c1fd2e9dc5727ef3fca74f4cdf0538f74286b0946e219d0ca5693b + +- name: Download lidar_centerpoint/pts_backbone_neck_head_centerpoint_tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_backbone_neck_head_centerpoint_tiny.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_backbone_neck_head_centerpoint_tiny.onnx" + mode: "644" + checksum: sha256:9bb0b634f3664bd098ce7d6a3d8a9fb7cc8d9b8252b27f302c71e43316bab551 +- name: Download lidar_centerpoint/centerpoint_ml_package.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/centerpoint_ml_package.param.yaml + dest: "{{ data_dir }}/lidar_centerpoint/centerpoint_ml_package.param.yaml" + mode: "644" + checksum: sha256:54b88fa0c1bbd6d611d1ec55e483d05bed7a4c0e15877c05eb7d9cf240246ab8 +- name: Download lidar_centerpoint/centerpoint_ml_package.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/centerpoint_tiny_ml_package.param.yaml + dest: "{{ data_dir }}/lidar_centerpoint/centerpoint_tiny_ml_package.param.yaml" + mode: "644" + checksum: sha256:6a40d2282b9c36cc547add7d016f315329c875b6f571dd5c612c6892fbaaabb5 +- name: Download lidar_centerpoint/centerpoint_sigma_ml_package.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/centerpoint_sigma_ml_package.param.yaml + dest: "{{ data_dir }}/lidar_centerpoint/centerpoint_sigma_ml_package.param.yaml" + mode: "644" + checksum: sha256:9946b342a6f457b19fdfe9f02041dbd3cf0b9cefe052663e04e241ec2b6e9c76 +- name: Download lidar_centerpoint/detection_class_remapper.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/detection_class_remapper.param.yaml + dest: "{{ data_dir }}/lidar_centerpoint/detection_class_remapper.param.yaml" + mode: "644" + checksum: sha256:c711f8875ece9b527dfe31ffc75f8c0de2e77945ef67860a959a4e04c36772d5 +- name: Download lidar_centerpoint/deploy_metadata.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/deploy_metadata.yaml + dest: "{{ data_dir }}/lidar_centerpoint/deploy_metadata.yaml" + mode: "644" + checksum: sha256:152536f053c3750b60d349800e1b983b418029d6dadf087614a00c661942a178 + +# lidar_transfusion +- name: Create lidar_transfusion directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/lidar_transfusion" + mode: "755" + state: directory + +- name: Download lidar_transfusion/transfusion.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/transfusion/t4xx1_90m/v2.1/transfusion.onnx + dest: "{{ data_dir }}/lidar_transfusion/transfusion.onnx" + mode: "644" + checksum: sha256:1d8f0ee6d59ccc3cca914f9892f6ac8f0a9e35082abb91da183c00e3e2c2718a + +- name: Download lidar_transfusion/transfusion_ml_package.param.yaml + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/transfusion/t4xx1_90m/v2.1/transfusion_ml_package.param.yaml + dest: "{{ data_dir }}/lidar_transfusion/transfusion_ml_package.param.yaml" + mode: "644" + checksum: sha256:476f7727adc17a823962f2e09ba23d40f3116c50be48361d98179d054cd131b6 + +- 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/t4xx1_90m/v2.1/detection_class_remapper.param.yaml + dest: "{{ data_dir }}/lidar_transfusion/detection_class_remapper.param.yaml" + mode: "644" + checksum: sha256:c711f8875ece9b527dfe31ffc75f8c0de2e77945ef67860a959a4e04c36772d5 + +# tensorrt_yolox +- name: Create tensorrt_yolox directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/tensorrt_yolox" + mode: "755" + state: directory + +- name: Download tensorrt_yolox/yolox-tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-tiny.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-tiny.onnx" + mode: "644" + checksum: sha256:471a665f4243e654dff62578394e508db22ee29fe65d9e389dfc3b0f2dee1255 + +- name: Download tensorrt_yolox/yolox-sPlus-opt.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-sPlus-opt.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt.onnx" + mode: "644" + checksum: sha256:36b0832177b01e6b278e00c7369f1de71e616c36261cbae50f0753d41289da01 + +- name: Download tensorrt_yolox/yolox-sPlus-opt.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-sPlus-opt.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt.EntropyV2-calibration.table" + mode: "644" + checksum: sha256:b9e9d7da33342262ccaea4469b4d02b8abb32b6d7bf737f9e0883fece1b8f580 + +- name: Download tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_yolox_s/v1/yolox-sPlus-T4-960x960-pseudo-finetune.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.onnx" + mode: "644" + checksum: sha256:f5054e8a890c3be86dc1b4b89a5a36fb2279d4f6110b0159e793be062641bf65 + +- name: Download tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_yolox_s/v1/yolox-sPlus-T4-960x960-pseudo-finetune.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-T4-960x960-pseudo-finetune.EntropyV2-calibration.table" + mode: "644" + checksum: sha256:cc378d327db5616b0b3a4d077bf37100c25a50ecd22d2b542f54098da100f34c + +- name: Download tensorrt_yolox/label.txt + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/label.txt + dest: "{{ data_dir }}/tensorrt_yolox/label.txt" + mode: "644" + checksum: sha256:3540a365bfd6d8afb1b5d8df4ec47f82cb984760d3270c9b41dbbb3422d09a0c + +- name: Download tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.onnx" + mode: "644" + checksum: sha256:73b3812432cedf65cebf02ca4cb630542fc3b1671c4c0fbf7cee50fa38e416a8 + +- name: Download tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt-pseudoV2-T4-960x960-T4-seg16cls.EntropyV2-calibration.table" + mode: "644" + checksum: sha256:28cd6524d4bcdb2809592a225d28330433e58dc02c92169ea555b44c1a51a584 + +- name: Download tensorrt_yolox/semseg_color_map.csv + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/object_detection_semseg_yolox_s/v1/semseg_color_map.csv + dest: "{{ data_dir }}/tensorrt_yolox/semseg_color_map.csv" + mode: "644" + checksum: sha256:3d93ca05f31b63424d7d7246a01a2365953705a0ed3323ba5b6fddd744a4bfea + +# traffic_light_classifier +- name: Create traffic_light_classifier directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/traffic_light_classifier" + mode: "755" + state: directory + +- name: Download traffic_light_classifier/traffic_light_classifier_mobilenetv2_batch_1.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/traffic_light_classifier_mobilenetv2_batch_1.onnx + dest: "{{ data_dir }}/traffic_light_classifier/traffic_light_classifier_mobilenetv2_batch_1.onnx" + mode: "644" + checksum: sha256:455b71b3b20d3a96aa0e49f32714ba50421f668a2f9b9907c30b1346ac8a3703 + +- name: Download traffic_light_classifier/traffic_light_classifier_mobilenetv2_batch_4.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/traffic_light_classifier_mobilenetv2_batch_4.onnx + dest: "{{ data_dir }}/traffic_light_classifier/traffic_light_classifier_mobilenetv2_batch_4.onnx" + mode: "644" + checksum: sha256:41bb79a23a4ac57956adb8e9cb3904420db1b0cd032e97b670cc4f8b174ae3fe + +- name: Download traffic_light_classifier/traffic_light_classifier_mobilenetv2_batch_6.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/traffic_light_classifier_mobilenetv2_batch_6.onnx + dest: "{{ data_dir }}/traffic_light_classifier/traffic_light_classifier_mobilenetv2_batch_6.onnx" + mode: "644" + checksum: sha256:e4792eed6a46fdbd02be2f3a4f1ce91f36fa77698493caf3102e445178c0f058 + +- name: Download traffic_light_classifier/traffic_light_classifier_efficientNet_b1_batch_1.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/traffic_light_classifier_efficientNet_b1_batch_1.onnx + dest: "{{ data_dir }}/traffic_light_classifier/traffic_light_classifier_efficientNet_b1_batch_1.onnx" + mode: "644" + checksum: sha256:55ebb0d117a5e8943f8d1c6769f1d856b533079d4d871d8e923255cc992ad48a + +- name: Download traffic_light_classifier/traffic_light_classifier_efficientNet_b1_batch_4.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/traffic_light_classifier_efficientNet_b1_batch_4.onnx + dest: "{{ data_dir }}/traffic_light_classifier/traffic_light_classifier_efficientNet_b1_batch_4.onnx" + mode: "644" + checksum: sha256:684e29843e3128eadb774018730644b3ab9b0a06dc4cdaeed579c2f3fa5d5265 + +- name: Download traffic_light_classifier/traffic_light_classifier_efficientNet_b1_batch_6.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/traffic_light_classifier_efficientNet_b1_batch_6.onnx + dest: "{{ data_dir }}/traffic_light_classifier/traffic_light_classifier_efficientNet_b1_batch_6.onnx" + mode: "644" + checksum: sha256:44d94540fa8b89dfb39cd9a8523cf010ddfb10ea2f1f9b53bf3618ce7f4912ad + +- name: Download traffic_light_classifier/ped_traffic_light_classifier_mobilenetv2_batch_1.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v3/ped_traffic_light_classifier_mobilenetv2_batch_1.onnx + dest: "{{ data_dir }}/traffic_light_classifier/ped_traffic_light_classifier_mobilenetv2_batch_1.onnx" + mode: "644" + checksum: sha256:b52632fee96d1bc99922e743335ebfd49d6a0645c8a04e615f156e38661add24 + +- name: Download traffic_light_classifier/ped_traffic_light_classifier_mobilenetv2_batch_4.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v3/ped_traffic_light_classifier_mobilenetv2_batch_4.onnx + dest: "{{ data_dir }}/traffic_light_classifier/ped_traffic_light_classifier_mobilenetv2_batch_4.onnx" + mode: "644" + checksum: sha256:ef0a3052857cdc6f380da524560548b40e9e46f876cccf3cd0cb40ccddae9892 + +- name: Download traffic_light_classifier/ped_traffic_light_classifier_mobilenetv2_batch_6.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v3/ped_traffic_light_classifier_mobilenetv2_batch_6.onnx + dest: "{{ data_dir }}/traffic_light_classifier/ped_traffic_light_classifier_mobilenetv2_batch_6.onnx" + mode: "644" + checksum: sha256:b56700551254afa985916d03b74372ebc675f2d9b76ee0e39c46e88c37744a4f + +- name: Download traffic_light_classifier/lamp_labels.txt + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v2/lamp_labels.txt + dest: "{{ data_dir }}/traffic_light_classifier/lamp_labels.txt" + mode: "644" + checksum: sha256:1a5a49eeec5593963eab8d70f48b8a01bfb07e753e9688eb1510ad26e803579d + +- name: Download traffic_light_classifier/lamp_labels_ped.txt + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/traffic_light_classifier/v3/lamp_labels_ped.txt + dest: "{{ data_dir }}/traffic_light_classifier/lamp_labels_ped.txt" + mode: "644" + checksum: sha256:5427e1b7c2e33acd9565ede29e77992c38137bcf7d7074c73ebbc38080c6bcac + +# traffic_light_fine_detector +- name: Create traffic_light_fine_detector directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/traffic_light_fine_detector" + mode: "755" + state: directory + +- name: Download traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_1.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/tlr_yolox_s/v3/tlr_car_ped_yolox_s_batch_1.onnx + dest: "{{ data_dir }}/traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_1.onnx" + mode: "644" + checksum: sha256:1ad633066a1195006f4709f8fa07800dd65a74a814b3efb4c99bcc5a1a7962f6 + +- name: Download traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_4.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/tlr_yolox_s/v3/tlr_car_ped_yolox_s_batch_4.onnx + dest: "{{ data_dir }}/traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_4.onnx" + mode: "644" + checksum: sha256:cf93eb1e1a97aefc6edd0c0c4d77c7f5fc2aa1e81e3c5c9cd49d976173d03a04 + +- name: Download traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_6.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/tlr_yolox_s/v3/tlr_car_ped_yolox_s_batch_6.onnx + dest: "{{ data_dir }}/traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_6.onnx" + mode: "644" + checksum: sha256:0b05a89fb30f1f92c6ec687d48e8ceda4da6f81cbd82d8a102d168753a6cedb6 + +- name: Download traffic_light_fine_detector/tlr_labels.txt + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/tlr_yolox_s/v3/tlr_labels.txt + dest: "{{ data_dir }}/traffic_light_fine_detector/tlr_labels.txt" + mode: "644" + checksum: sha256:a2a91f5fe9c2e68e3e3647a272bb9bb25cd07631a1990a3fb15efddce7691131 diff --git a/ansible/roles/autoware_universe/meta/main.yaml b/ansible/roles/autoware_universe/meta/main.yaml deleted file mode 100644 index 626281ada2a..00000000000 --- a/ansible/roles/autoware_universe/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - role: autoware.dev_env.autoware_core diff --git a/ansible/roles/build_tools/README.md b/ansible/roles/build_tools/README.md new file mode 100644 index 00000000000..3db8fa73d2f --- /dev/null +++ b/ansible/roles/build_tools/README.md @@ -0,0 +1,19 @@ +# Build Tools + +This role installs build tools for building Autoware. + +## Tools + +- ccache + +## Inputs + +## Manual Installation + +```bash +# Update package lists +sudo apt-get update + +# Install ccache +sudo apt-get install -y ccache +``` diff --git a/ansible/roles/autoware_universe/defaults/main.yaml b/ansible/roles/build_tools/defaults/main.yaml similarity index 100% rename from ansible/roles/autoware_universe/defaults/main.yaml rename to ansible/roles/build_tools/defaults/main.yaml diff --git a/ansible/roles/ccache/defaults/main.yaml b/ansible/roles/build_tools/meta/main.yaml similarity index 100% rename from ansible/roles/ccache/defaults/main.yaml rename to ansible/roles/build_tools/meta/main.yaml diff --git a/ansible/roles/build_tools/tasks/main.yaml b/ansible/roles/build_tools/tasks/main.yaml new file mode 100644 index 00000000000..d7ef9250235 --- /dev/null +++ b/ansible/roles/build_tools/tasks/main.yaml @@ -0,0 +1,51 @@ +- name: Install ccache + become: true + ansible.builtin.apt: + name: ccache + state: latest + update_cache: true + +- name: Add CCACHE_DIR to .bashrc + ansible.builtin.lineinfile: + dest: ~/.bashrc + line: export CCACHE_DIR="/var/tmp/ccache" + state: present + create: true + mode: 0644 + +- name: Add CCACHE_DIR to .bashrc of local user + become: true + ansible.builtin.lineinfile: + dest: /etc/skel/.bashrc + line: export CCACHE_DIR="$HOME/.ccache" + state: present + create: true + mode: 0644 + +- name: Export CC to ccache + ansible.builtin.lineinfile: + dest: ~/.bashrc + line: export CC="/usr/lib/ccache/gcc" + state: present + create: true + mode: 0644 + +- name: Export CXX to ccache + ansible.builtin.lineinfile: + dest: ~/.bashrc + line: export CXX="/usr/lib/ccache/g++" + state: present + create: true + mode: 0644 + +- name: Create ccache directory + ansible.builtin.file: + path: /var/tmp/ccache + state: directory + mode: 0755 + +- name: Source .bashrc + ansible.builtin.shell: source ~/.bashrc + args: + executable: /bin/bash + changed_when: false diff --git a/ansible/roles/ccache/README.md b/ansible/roles/ccache/README.md deleted file mode 100644 index e77979ee4ea..00000000000 --- a/ansible/roles/ccache/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# ccache - -This role installs Ccache. You can access detailed information about Ccache with this [link](https://ccache.dev/). - -## Inputs - -None. - -## Manual Installation - -```bash -sudo apt update && sudo apt install ccache -``` diff --git a/ansible/roles/ccache/tasks/main.yaml b/ansible/roles/ccache/tasks/main.yaml deleted file mode 100644 index 3623238c6b6..00000000000 --- a/ansible/roles/ccache/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- name: Install ccache - become: true - ansible.builtin.apt: - name: - - ccache - state: latest - update_cache: true diff --git a/ansible/roles/cuda/README.md b/ansible/roles/cuda/README.md index f011866a045..d669c573e91 100644 --- a/ansible/roles/cuda/README.md +++ b/ansible/roles/cuda/README.md @@ -1,31 +1,48 @@ # cuda -This role installs [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) following [this page](https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network) and [this page](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions). +This role installs [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) following [this page](https://developer.nvidia.com/cuda-12-3-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network) and [this page](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions). + +This role also registers Vulkan, OpenGL, and OpenCL GPU vendors for future use. ## Inputs | Name | Required | Description | | -------------------- | -------- | -------------------------------- | | cuda_version | true | The version of CUDA Toolkit. | -| install_cuda_drivers | false | Whether to install cuda-drivers. | +| cuda_install_drivers | false | Whether to install cuda-drivers. | ## Manual Installation -Follow these instructions to download and install the CUDA Toolkit and the corresponding NVIDIA Driver for Ubuntu 20.04. +### Version compatibility + +Autoware currently uses CUDA `12.3` and from this [CUDA Application Compatibility Support Matrix](https://docs.nvidia.com/deploy/cuda-compatibility/#use-the-right-compat-package) that only the NVIDIA driver version `545` is compatible with this version of CUDA. + +#### 🛠️ For Advanced Users + +⚠️ **Proceed with caution**: Avoid removing essential system components. + +To prevent conflicts during NVIDIA installation, we recommend completely removing old NVIDIA Drivers and CUDA by following this guide: [How can I uninstall a NVIDIA driver completely?](https://askubuntu.com/a/206289/761440). -For Universe, the `cuda_version` version can also be found in: -[../../playbooks/universe.yaml](../../playbooks/universe.yaml) +- **Important**: If you remove the previous NVIDIA drivers, ensure you install the recommended versions listed below **before restarting your system**. + +Once the drivers are installed correctly, you may safely restart your system. + +### CUDA Toolkit and Driver + +Follow these instructions to download and install the CUDA Toolkit. + +From: ```bash -# Modified from: -# https://developer.nvidia.com/cuda-11-4-4-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network -wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 -sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub -sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" +wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env + +os=ubuntu2204 +wget https://developer.download.nvidia.com/compute/cuda/repos/$os/$(uname -m)/cuda-keyring_1.1-1_all.deb +sudo dpkg -i cuda-keyring_1.1-1_all.deb sudo apt-get update -cuda_version=11-4 -sudo apt install cuda-${cuda_version} --no-install-recommends +cuda_version_dashed=$(eval sed -e "s/[.]/-/g" <<< "${cuda_version}") +sudo apt-get -y install cuda-toolkit-${cuda_version_dashed} +sudo apt-get install -y cuda-drivers-545 ``` Perform the post installation actions: @@ -35,3 +52,34 @@ Perform the post installation actions: echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc ``` + +### GPU Vendors + +Register Vulkan, OpenGL, and OpenCL GPU vendors following the instructions below. + +```bash +# Create Vulkan directory +sudo mkdir -p /etc/vulkan/icd.d +sudo chmod 0755 /etc/vulkan/icd.d + +# Create OpenGL directory +sudo mkdir -p /etc/glvnd/egl_vendor.d +sudo chmod 0755 /etc/glvnd/egl_vendor.d + +# Create OpenCL directory +sudo mkdir -p /etc/OpenCL/vendors +sudo chmod 0755 /etc/OpenCL/vendors + +# Download and set permissions for Vulkan GPU vendors JSON +sudo wget https://gitlab.com/nvidia/container-images/vulkan/raw/dc389b0445c788901fda1d85be96fd1cb9410164/nvidia_icd.json -O /etc/vulkan/icd.d/nvidia_icd.json +sudo chmod 0644 /etc/vulkan/icd.d/nvidia_icd.json + +# Download and set permissions for OpenGL GPU vendors JSON +sudo wget https://gitlab.com/nvidia/container-images/opengl/raw/5191cf205d3e4bb1150091f9464499b076104354/glvnd/runtime/10_nvidia.json -O /etc/glvnd/egl_vendor.d/10_nvidia.json +sudo chmod 0644 /etc/glvnd/egl_vendor.d/10_nvidia.json + +# Register and set permissions for OpenCL GPU vendors +sudo touch /etc/OpenCL/vendors/nvidia.icd +echo "libnvidia-opencl.so.1" | sudo tee /etc/OpenCL/vendors/nvidia.icd > /dev/null +sudo chmod 0644 /etc/OpenCL/vendors/nvidia.icd +``` diff --git a/ansible/roles/cuda/defaults/main.yaml b/ansible/roles/cuda/defaults/main.yaml index 3488c01e83e..1945f8820bf 100644 --- a/ansible/roles/cuda/defaults/main.yaml +++ b/ansible/roles/cuda/defaults/main.yaml @@ -1 +1 @@ -install_cuda_drivers: true +cuda_install_drivers: true diff --git a/ansible/roles/cuda/tasks/main.yaml b/ansible/roles/cuda/tasks/main.yaml index fd427d430ae..796b105d2f5 100644 --- a/ansible/roles/cuda/tasks/main.yaml +++ b/ansible/roles/cuda/tasks/main.yaml @@ -17,29 +17,45 @@ - name: Install CUDA keyring become: true ansible.builtin.apt: - deb: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/{{ cuda_architecture.stdout }}/cuda-keyring_1.0-1_all.deb + deb: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/{{ cuda_architecture.stdout }}/cuda-keyring_1.1-1_all.deb update_cache: true - name: Get dash-case name of cuda_version ansible.builtin.shell: bash -c 'sed -e "s/\./-/g" <<< $(echo {{ cuda_version }})' - register: dash_case_cuda_version + register: cuda__dash_case_cuda_version changed_when: false +- name: Install CUDA devel libraries except for cuda-drivers + become: true + ansible.builtin.apt: + name: + - cuda-command-line-tools-{{ cuda__dash_case_cuda_version.stdout }} + - cuda-minimal-build-{{ cuda__dash_case_cuda_version.stdout }} + - libcusparse-dev-{{ cuda__dash_case_cuda_version.stdout }} + - libcublas-dev-{{ cuda__dash_case_cuda_version.stdout }} + - libcurand-dev-{{ cuda__dash_case_cuda_version.stdout }} + - cuda-nvml-dev-{{ cuda__dash_case_cuda_version.stdout }} + update_cache: true + when: install_devel == 'y' + - name: Install CUDA libraries except for cuda-drivers become: true ansible.builtin.apt: name: - - cuda-cudart-dev-{{ dash_case_cuda_version.stdout }} - - cuda-command-line-tools-{{ dash_case_cuda_version.stdout }} - - cuda-minimal-build-{{ dash_case_cuda_version.stdout }} - - cuda-libraries-dev-{{ dash_case_cuda_version.stdout }} - - cuda-nvml-dev-{{ dash_case_cuda_version.stdout }} - - cuda-nvprof-{{ dash_case_cuda_version.stdout }} - - libnpp-dev-{{ dash_case_cuda_version.stdout }} - - libcusparse-dev-{{ dash_case_cuda_version.stdout }} - - libcublas-dev-{{ dash_case_cuda_version.stdout }} - - libnccl-dev + - cuda-minimal-build-{{ cuda__dash_case_cuda_version.stdout }} + - libcusparse-{{ cuda__dash_case_cuda_version.stdout }} + - libcublas-{{ cuda__dash_case_cuda_version.stdout }} + - libcurand-{{ cuda__dash_case_cuda_version.stdout }} + update_cache: true + when: install_devel == 'N' + +- name: Install extra CUDA libraries for x86_64 + become: true + ansible.builtin.apt: + name: + - cuda-nvprof-{{ cuda__dash_case_cuda_version.stdout }} update_cache: true + when: cuda_architecture.stdout == "x86_64" - name: Install cuda-drivers become: true @@ -47,20 +63,90 @@ name: - cuda-drivers update_cache: true - when: install_cuda_drivers | bool + when: cuda_install_drivers | bool - name: Add PATH to .bashrc + become: true ansible.builtin.lineinfile: - dest: ~/.bashrc + dest: "{{ item }}" line: export PATH="/usr/local/cuda/bin:$PATH" state: present create: true mode: 0644 + loop: + - ~/.bashrc + - /etc/skel/.bashrc - name: Add LD_LIBRARY_PATH to bashrc + become: true ansible.builtin.lineinfile: - dest: ~/.bashrc + dest: "{{ item }}" line: export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH" state: present create: true mode: 0644 + loop: + - ~/.bashrc + - /etc/skel/.bashrc + +- name: Create Vulkan directory + become: true + ansible.builtin.file: + path: /etc/vulkan/icd.d + state: directory + mode: "0755" + +- name: Create OpenGL directory + become: true + ansible.builtin.file: + path: /etc/glvnd/egl_vendor.d + state: directory + mode: "0755" + +- name: Create OpenCL directory + become: true + ansible.builtin.file: + path: /etc/OpenCL/vendors + state: directory + mode: "0755" + +- name: Register Vulkan GPU vendors + become: true + ansible.builtin.get_url: + url: https://gitlab.com/nvidia/container-images/vulkan/raw/dc389b0445c788901fda1d85be96fd1cb9410164/nvidia_icd.json + dest: /etc/vulkan/icd.d/nvidia_icd.json + mode: "0644" + +- name: Set permissions for Vulkan GPU vendors + become: true + ansible.builtin.file: + path: /etc/vulkan/icd.d/nvidia_icd.json + mode: "0644" + +- name: Register OpenGL GPU vendors + become: true + ansible.builtin.get_url: + url: https://gitlab.com/nvidia/container-images/opengl/raw/5191cf205d3e4bb1150091f9464499b076104354/glvnd/runtime/10_nvidia.json + dest: /etc/glvnd/egl_vendor.d/10_nvidia.json + mode: "0644" + +- name: Set permissions for OpenGL GPU vendors + become: true + ansible.builtin.file: + path: /etc/glvnd/egl_vendor.d/10_nvidia.json + mode: "0644" + +- name: Register OpenCL GPU vendors + become: true + ansible.builtin.file: + path: /etc/OpenCL/vendors/nvidia.icd + state: touch + mode: "0644" + +- name: Set permissions for OpenCL GPU vendors + become: true + ansible.builtin.lineinfile: + path: /etc/OpenCL/vendors/nvidia.icd + line: libnvidia-opencl.so.1 + create: true + mode: "0644" diff --git a/ansible/roles/dev_tools/README.md b/ansible/roles/dev_tools/README.md new file mode 100644 index 00000000000..89d51fbdc3b --- /dev/null +++ b/ansible/roles/dev_tools/README.md @@ -0,0 +1,38 @@ +# devel + +This role installs optional development tools for Autoware. + +## Tools + +- Git LFS +- pre-commit +- clang-format +- Go +- PlotJuggler + +## Inputs + +| Name | Required | Description | +| ------------------------------- | -------- | --------------------------------------- | +| pre_commit_clang_format_version | true | The version of clang-format to install. | +| rosdistro | true | The ROS distribution. | + +## Manual Installation + +```bash +# For the environment variables +wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env + +sudo apt-get update + +sudo apt install python3-pip +sudo apt-get install -y golang +sudo apt-get install -y ros-${rosdistro}-plotjuggler-ros +sudo apt-get install -y git-lfs + +# Setup Git LFS +git lfs install + +pip3 install pre-commit +pip3 install clang-format==${pre_commit_clang_format_version} +``` diff --git a/ansible/roles/ccache/meta/main.yaml b/ansible/roles/dev_tools/defaults/main.yaml similarity index 100% rename from ansible/roles/ccache/meta/main.yaml rename to ansible/roles/dev_tools/defaults/main.yaml diff --git a/ansible/roles/nvidia_docker/defaults/main.yaml b/ansible/roles/dev_tools/meta/main.yaml similarity index 100% rename from ansible/roles/nvidia_docker/defaults/main.yaml rename to ansible/roles/dev_tools/meta/main.yaml diff --git a/ansible/roles/dev_tools/tasks/main.yaml b/ansible/roles/dev_tools/tasks/main.yaml new file mode 100644 index 00000000000..1a7d3c6511a --- /dev/null +++ b/ansible/roles/dev_tools/tasks/main.yaml @@ -0,0 +1,59 @@ +# https://github.com/git-lfs/git-lfs/wiki/Installation#debian-and-ubuntu +- name: Install Git LFS + become: true + ansible.builtin.apt: + name: git-lfs + state: latest + update_cache: true + +# ref: https://github.com/ansible/ansible-lint/issues/1780 +- name: Check if git lfs is installed # https://github.com/git-lfs/git-lfs/issues/901 + community.general.git_config: + list_all: true + scope: global + register: git_lfs__git_global_config + +- name: Setup Git LFS + ansible.builtin.command: git lfs install + when: "'filter.lfs.required' not in git_lfs__git_global_config.config_values" + changed_when: true + +- name: Install pre-commit + ansible.builtin.pip: + name: pre-commit + state: latest + executable: pip3 + +- name: Install clang-format + ansible.builtin.pip: + name: clang-format + version: "{{ pre_commit_clang_format_version }}" + executable: pip3 + +- name: Install Go + become: true + ansible.builtin.apt: + name: golang + state: latest + update_cache: true + +- name: Hold check of ros-{{ rosdistro + '-plotjuggler-ros' }} + ansible.builtin.command: apt-mark showhold + register: held_ros_packages + changed_when: false + +- name: Install plotjuggler + become: true + ansible.builtin.apt: + name: + - ros-{{ rosdistro }}-plotjuggler-ros + state: latest + update_cache: true + when: "'ros-' + rosdistro + '-plotjuggler-ros' not in held_ros_packages.stdout" + register: install_result + failed_when: false + +- name: Display warning if plotjuggler-ros package is held + ansible.builtin.debug: + msg: ROS package 'ros-{{ rosdistro }}-plotjuggler-ros' is apt-mark hold. Skipping installation. + when: not install_result.changed diff --git a/ansible/roles/docker_engine/README.md b/ansible/roles/docker_engine/README.md index a9e5c00e357..a79159cf2fa 100644 --- a/ansible/roles/docker_engine/README.md +++ b/ansible/roles/docker_engine/README.md @@ -27,7 +27,13 @@ sudo apt-get install \ lsb-release # Add Docker’s official GPG key: -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg + +# Use the following command to set up the repository: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker Engine sudo apt-get update diff --git a/ansible/roles/docker_engine/tasks/main.yaml b/ansible/roles/docker_engine/tasks/main.yaml index 7dcaff2b101..6fe822fa575 100644 --- a/ansible/roles/docker_engine/tasks/main.yaml +++ b/ansible/roles/docker_engine/tasks/main.yaml @@ -20,33 +20,41 @@ - lsb-release update_cache: true -# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +# sudo mkdir -p /etc/apt/keyrings +- name: Create the directory for keyrings + become: true + ansible.builtin.file: + state: directory + path: /etc/apt/keyrings + mode: 0755 + +# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg - name: Authorize Docker GPG key become: true ansible.builtin.apt_key: url: https://download.docker.com/linux/ubuntu/gpg - keyring: /usr/share/keyrings/docker-archive-keyring.gpg + keyring: /etc/apt/keyrings/docker.gpg - name: Save result of 'dpkg --print-architecture' ansible.builtin.command: dpkg --print-architecture - register: deb_architecture + register: docker_engine__deb_architecture changed_when: false - name: Save result of 'lsb_release -cs' ansible.builtin.command: lsb_release -cs - register: lsb_release_cs + register: docker_engine__lsb_release_cs changed_when: false - name: Save result of 'lsb_release -is' ansible.builtin.command: lsb_release -is - register: lsb_release_is + register: docker_engine__lsb_release_is changed_when: false -# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +# echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - name: Add Docker apt repository to source list become: true ansible.builtin.apt_repository: - repo: deb [arch={{ deb_architecture.stdout }} signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/{{ lsb_release_is.stdout | lower }} {{ lsb_release_cs.stdout }} stable + repo: deb [arch={{ docker_engine__deb_architecture.stdout }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/{{ docker_engine__lsb_release_is.stdout | lower }} {{ docker_engine__lsb_release_cs.stdout }} stable filename: docker state: present update_cache: true diff --git a/ansible/roles/autoware_core/README.md b/ansible/roles/gdown/README.md similarity index 59% rename from ansible/roles/autoware_core/README.md rename to ansible/roles/gdown/README.md index a834adb9e79..4d5e1e5dbab 100644 --- a/ansible/roles/autoware_core/README.md +++ b/ansible/roles/gdown/README.md @@ -1,6 +1,6 @@ -# autoware_core +# Role: gdown -This role installs development/runtime dependencies for Autoware Core. +This role installs gdown to download files from CMakeLists.txt. ## Inputs diff --git a/ansible/roles/nvidia_docker/meta/main.yaml b/ansible/roles/gdown/defaults/main.yaml similarity index 100% rename from ansible/roles/nvidia_docker/meta/main.yaml rename to ansible/roles/gdown/defaults/main.yaml diff --git a/ansible/roles/plotjuggler/defaults/main.yaml b/ansible/roles/gdown/meta/main.yaml similarity index 100% rename from ansible/roles/plotjuggler/defaults/main.yaml rename to ansible/roles/gdown/meta/main.yaml diff --git a/ansible/roles/autoware_core/tasks/main.yaml b/ansible/roles/gdown/tasks/main.yaml similarity index 100% rename from ansible/roles/autoware_core/tasks/main.yaml rename to ansible/roles/gdown/tasks/main.yaml diff --git a/ansible/roles/autoware_universe/README.md b/ansible/roles/geographiclib/README.md similarity index 64% rename from ansible/roles/autoware_universe/README.md rename to ansible/roles/geographiclib/README.md index e3ab6300083..8ab94806be3 100644 --- a/ansible/roles/autoware_universe/README.md +++ b/ansible/roles/geographiclib/README.md @@ -1,6 +1,4 @@ -# autoware_universe - -This role installs development/runtime dependencies for Autoware Universe. +# geographiclib ## Inputs diff --git a/ansible/roles/pre_commit/meta/main.yaml b/ansible/roles/geographiclib/defaults/main.yaml similarity index 100% rename from ansible/roles/pre_commit/meta/main.yaml rename to ansible/roles/geographiclib/defaults/main.yaml diff --git a/ansible/roles/rocker/defaults/main.yaml b/ansible/roles/geographiclib/meta/main.yaml similarity index 100% rename from ansible/roles/rocker/defaults/main.yaml rename to ansible/roles/geographiclib/meta/main.yaml diff --git a/ansible/roles/autoware_universe/tasks/main.yaml b/ansible/roles/geographiclib/tasks/main.yaml similarity index 100% rename from ansible/roles/autoware_universe/tasks/main.yaml rename to ansible/roles/geographiclib/tasks/main.yaml diff --git a/ansible/roles/kisak_mesa/README.md b/ansible/roles/kisak_mesa/README.md new file mode 100644 index 00000000000..e92b276647e --- /dev/null +++ b/ansible/roles/kisak_mesa/README.md @@ -0,0 +1,36 @@ +# Kisak Mesa Fix for Ubuntu 22.04 for Rviz2 (Not mandatory) + +If you are using Ubuntu 22.04 and Rviz2 (especially inside a container), you may encounter black-screen error on Rviz2: + +This role will install the Kisak Mesa fix for Ubuntu 22.04 for Rviz2. + +## Inputs + +None + +## Manual Installation + +```bash +#!/bin/bash + +# Update the package list and install software-properties-common +sudo apt-get update +sudo apt-get install -y software-properties-common + +# Add the Kisak Mesa PPA +sudo add-apt-repository -y ppa:kisak/kisak-mesa + +# Update the package list after adding the new repository +sudo apt-get update + +# Install Mesa libraries +sudo apt-get install -y \ +libegl-mesa0 \ +libegl1-mesa-dev \ +libgbm-dev \ +libgbm1 \ +libgl1-mesa-dev \ +libgl1-mesa-dri \ +libglapi-mesa \ +libglx-mesa0 +``` diff --git a/ansible/roles/rocker/meta/main.yaml b/ansible/roles/kisak_mesa/defaults/main.yaml similarity index 100% rename from ansible/roles/rocker/meta/main.yaml rename to ansible/roles/kisak_mesa/defaults/main.yaml diff --git a/ansible/roles/kisak_mesa/meta/main.yaml b/ansible/roles/kisak_mesa/meta/main.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ansible/roles/kisak_mesa/tasks/main.yaml b/ansible/roles/kisak_mesa/tasks/main.yaml new file mode 100644 index 00000000000..910c6f38b62 --- /dev/null +++ b/ansible/roles/kisak_mesa/tasks/main.yaml @@ -0,0 +1,24 @@ +- name: Install additional dependencies + become: true + ansible.builtin.apt: + name: software-properties-common + state: present + +- name: Add Kisak Mesa PPA + become: true + ansible.builtin.apt_repository: + repo: ppa:kisak/kisak-mesa + +- name: Install Mesa libraries + become: true + ansible.builtin.apt: + name: + - libegl-mesa0 + - libegl1-mesa-dev + - libgbm-dev + - libgbm1 + - libgl1-mesa-dev + - libgl1-mesa-dri + - libglapi-mesa + - libglx-mesa0 + state: present diff --git a/ansible/roles/nvidia_docker/README.md b/ansible/roles/nvidia_container_toolkit/README.md similarity index 61% rename from ansible/roles/nvidia_docker/README.md rename to ansible/roles/nvidia_container_toolkit/README.md index ade992c922b..01dd1791e63 100644 --- a/ansible/roles/nvidia_docker/README.md +++ b/ansible/roles/nvidia_container_toolkit/README.md @@ -1,6 +1,6 @@ -# nvidia_docker +# nvidia_container_toolkit -This role installs [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-docker) following the [installation guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). +This role installs [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-container-toolkit) following the [installation guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). ## Inputs @@ -13,26 +13,31 @@ Install Nvidia Container Toolkit: ```bash -# Taken from https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit +# Add NVIDIA container toolkit GPG key +sudo apt-key adv --fetch-keys https://nvidia.github.io/libnvidia-container/gpgkey +sudo gpg --no-default-keyring --keyring /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg --import /etc/apt/trusted.gpg -# Setup the package repository and the GPG key: -distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ - && curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | sudo apt-key add - \ - && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list +# Add NVIDIA container toolkit repository +echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/$(dpkg --print-architecture) /" | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list -# Install the nvidia-docker2 package (and dependencies) after updating the package listing: +# Update the package list sudo apt-get update -sudo apt-get install -y nvidia-docker2 -# Restart the Docker daemon to complete the installation after setting the default runtime: +# Install NVIDIA Container Toolkit +sudo apt-get install -y nvidia-container-toolkit + +# Add NVIDIA runtime support to docker engine +sudo nvidia-ctk runtime configure --runtime=docker + +# Restart docker daemon sudo systemctl restart docker # At this point, a working setup can be tested by running a base CUDA container: -sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi +sudo docker run --rm --gpus all nvcr.io/nvidia/cuda:12.3.1-runtime-ubuntu20.04 nvidia-smi # This should result in a console output shown below: # +-----------------------------------------------------------------------------+ -# | NVIDIA-SMI 450.51.06 Driver Version: 450.51.06 CUDA Version: 11.0 | +# | NVIDIA-SMI 545.23.08 Driver Version: 545.23.08 CUDA Version: 12.3.1 | # |-------------------------------+----------------------+----------------------+ # | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | # | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | diff --git a/ansible/roles/nvidia_container_toolkit/defaults/main.yaml b/ansible/roles/nvidia_container_toolkit/defaults/main.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ansible/roles/nvidia_container_toolkit/meta/main.yaml b/ansible/roles/nvidia_container_toolkit/meta/main.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ansible/roles/nvidia_container_toolkit/tasks/main.yaml b/ansible/roles/nvidia_container_toolkit/tasks/main.yaml new file mode 100644 index 00000000000..b1197fd21cf --- /dev/null +++ b/ansible/roles/nvidia_container_toolkit/tasks/main.yaml @@ -0,0 +1,34 @@ +- name: Add NVIDIA container toolkit GPG key + become: true + ansible.builtin.apt_key: + url: https://nvidia.github.io/libnvidia-container/gpgkey + state: present + keyring: /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg + +- name: Add NVIDIA container toolkit repository + become: true + ansible.builtin.apt_repository: + repo: deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/$(ARCH) / + state: present + filename: nvidia-container-toolkit + update_cache: true + +- name: Install NVIDIA Container Toolkit + become: true + ansible.builtin.apt: + name: + - nvidia-container-toolkit + update_cache: true + +- name: Add NVIDIA runtime support to docker engine + become: true + ansible.builtin.shell: | + nvidia-ctk runtime configure --runtime=docker + changed_when: true + +- name: Restart docker daemon + become: true + ansible.builtin.systemd: + name: docker + state: restarted + changed_when: true diff --git a/ansible/roles/nvidia_docker/tasks/main.yaml b/ansible/roles/nvidia_docker/tasks/main.yaml deleted file mode 100644 index 7193324b356..00000000000 --- a/ansible/roles/nvidia_docker/tasks/main.yaml +++ /dev/null @@ -1,30 +0,0 @@ -- name: Authorize NVIDIA Docker GPG key - become: true - ansible.builtin.apt_key: - url: https://nvidia.github.io/nvidia-docker/gpgkey - -- name: Save result of '. /etc/os-release;echo $ID$VERSION_ID' - ansible.builtin.shell: . /etc/os-release;echo $ID$VERSION_ID - register: distribution - changed_when: false - -- name: Save result of 'curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list' - ansible.builtin.uri: - url: https://nvidia.github.io/nvidia-docker/{{ distribution.stdout }}/nvidia-docker.list - return_content: true - register: nvidia_docker_list - -# curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list -- name: Add NVIDIA Docker apt repository to source list - become: true - ansible.builtin.copy: - dest: /etc/apt/sources.list.d/nvidia-docker.list - content: "{{ nvidia_docker_list.content }}" - mode: 0644 - -- name: Install NVIDIA Container Toolkit - become: true - ansible.builtin.apt: - name: - - nvidia-docker2 - update_cache: true diff --git a/ansible/roles/pacmod/README.md b/ansible/roles/pacmod/README.md index 36c4a0ccf93..37f0dfca87f 100644 --- a/ansible/roles/pacmod/README.md +++ b/ansible/roles/pacmod/README.md @@ -14,10 +14,11 @@ For Universe, the `rosdistro` variable can also be found in: [../../playbooks/universe.yaml](../../playbooks/universe.yaml) ```bash +wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env + # Taken from https://github.com/astuff/pacmod3#installation sudo apt install apt-transport-https sudo sh -c 'echo "deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/autonomoustuff-public.list' sudo apt update -rosdistro=galactic sudo apt install ros-${rosdistro}-pacmod3 ``` diff --git a/ansible/roles/pacmod/meta/main.yaml b/ansible/roles/pacmod/meta/main.yaml index 81b20fe4831..e69de29bb2d 100644 --- a/ansible/roles/pacmod/meta/main.yaml +++ b/ansible/roles/pacmod/meta/main.yaml @@ -1,2 +0,0 @@ -dependencies: - - role: autoware.dev_env.ros2 diff --git a/ansible/roles/pacmod/tasks/main.yaml b/ansible/roles/pacmod/tasks/main.yaml index d7d96c549b5..ed96c249ef4 100644 --- a/ansible/roles/pacmod/tasks/main.yaml +++ b/ansible/roles/pacmod/tasks/main.yaml @@ -6,14 +6,14 @@ - name: Save result of 'lsb_release -sc' ansible.builtin.command: lsb_release -sc - register: lsb_release + register: pacmod__lsb_release changed_when: false # echo "deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/autonomoustuff-public.list - name: Add AutonomouStuff apt repository to source list become: true ansible.builtin.apt_repository: - repo: deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ {{ lsb_release.stdout }} main + repo: deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ {{ pacmod__lsb_release.stdout }} main filename: autonomoustuff-public state: present update_cache: true diff --git a/ansible/roles/plotjuggler/README.md b/ansible/roles/plotjuggler/README.md deleted file mode 100644 index 579f22217eb..00000000000 --- a/ansible/roles/plotjuggler/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# plotjuggler - -This role installs PlotJuggler. You can access detailed information about PlotJuggler with this [link](https://www.plotjuggler.io/). - -## Inputs - -None. - -## Manual Installation - -```bash -sudo apt update && sudo apt install -y \ - ros-galactic-plotjuggler-ros -``` diff --git a/ansible/roles/plotjuggler/meta/main.yaml b/ansible/roles/plotjuggler/meta/main.yaml deleted file mode 100644 index 81b20fe4831..00000000000 --- a/ansible/roles/plotjuggler/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - role: autoware.dev_env.ros2 diff --git a/ansible/roles/plotjuggler/tasks/main.yaml b/ansible/roles/plotjuggler/tasks/main.yaml deleted file mode 100644 index 07197044a14..00000000000 --- a/ansible/roles/plotjuggler/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ -- name: Install plotjuggler - become: true - ansible.builtin.apt: - name: - - ros-{{ rosdistro }}-plotjuggler-ros - state: latest - update_cache: true diff --git a/ansible/roles/pre_commit/README.md b/ansible/roles/pre_commit/README.md deleted file mode 100644 index 97a9b2f21c9..00000000000 --- a/ansible/roles/pre_commit/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# pre_commit - -This role installs dependent tools for [pre-commit](https://pre-commit.com/). - -## Inputs - -| Name | Required | Description | -| -------------------- | -------- | --------------------------- | -| clang_format_version | false | The version of ClangFormat. | - -## Manual Installation - -The `clang_format_version` variable can also be found in: -[./defaults/main.yaml](./defaults/main.yaml) - -```bash -clang_format_version=14.0.6 -pip3 install pre-commit clang-format==${clang_format_version} - -# Install Golang (Add Go PPA for shfmt) -sudo add-apt-repository ppa:longsleep/golang-backports -sudo apt install golang -``` diff --git a/ansible/roles/pre_commit/defaults/main.yaml b/ansible/roles/pre_commit/defaults/main.yaml deleted file mode 100644 index 4e241783e11..00000000000 --- a/ansible/roles/pre_commit/defaults/main.yaml +++ /dev/null @@ -1 +0,0 @@ -clang_format_version: 14.0.6 diff --git a/ansible/roles/pre_commit/tasks/main.yaml b/ansible/roles/pre_commit/tasks/main.yaml deleted file mode 100644 index cb6f5305f5c..00000000000 --- a/ansible/roles/pre_commit/tasks/main.yaml +++ /dev/null @@ -1,24 +0,0 @@ -- name: Install pre-commit - ansible.builtin.pip: - name: pre-commit - state: latest - executable: pip3 - -- name: Install clang-format - ansible.builtin.pip: - name: clang-format - version: "{{ clang_format_version }}" - executable: pip3 - -# TODO: Remove after we move to Ubuntu 22.04 -- name: Add Go PPA for shfmt - become: true - ansible.builtin.apt_repository: - repo: ppa:longsleep/golang-backports # cspell:disable-line - -- name: Install Go - become: true - ansible.builtin.apt: - name: golang - state: latest - update_cache: true diff --git a/ansible/roles/qt5ct_setup/README.md b/ansible/roles/qt5ct_setup/README.md new file mode 100644 index 00000000000..41fc944eb4e --- /dev/null +++ b/ansible/roles/qt5ct_setup/README.md @@ -0,0 +1,60 @@ +# qt5ct_setup Ansible role + +## Overview + +The `qt5ct_setup` Ansible role automates the configuration of the `qt5ct` environment for Autoware. +It won't affect the system-wide configuration. + +## Installation + +Follow the instructions below to **install** or **update** the custom theme for `RViz2` in Autoware. + +> **Important:** Both commands must be run when you want to update the theme. + +```bash +cd ~/autoware # The root directory of the cloned repository +ansible-galaxy collection install -f -r "ansible-galaxy-requirements.yaml" +ansible-playbook autoware.dev_env.install_rviz_theme --ask-become-pass +``` + +## How to use the custom theme in RViz2 + +To apply a custom theme to RViz2, you can use the `qt5ct` platform theme. Follow these steps to ensure that the `QT_QPA_PLATFORMTHEME` environment variable is set correctly for your RViz2 instance when used with Autoware. + +### Manual setup for running RViz2 + +Before running RViz2 manually, set the `QT_QPA_PLATFORMTHEME` environment variable to `qt5ct`. +This ensures that the custom theme settings are applied. + +```bash +export QT_QPA_PLATFORMTHEME=qt5ct +``` + +Then, start RViz2 as usual. + +```bash +rviz2 +``` + +### Automatic setup in Autoware + +In Autoware, the `QT_QPA_PLATFORMTHEME` environment variable is automatically set within the main [autoware.launch.xml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/launch/autoware.launch.xml) file. +Therefore, you do not need to manually set this environment variable when launching Autoware. + +In the `autoware.launch.xml` file, RViz2 is configured with the following `` element: + +```xml + + + +``` + +This configuration automatically sets the `QT_QPA_PLATFORMTHEME` to `qt5ct` when RViz2 is launched as part of Autoware. +It also includes additional options such as respawn behavior and custom RViz2 configurations. diff --git a/ansible/roles/qt5ct_setup/defaults/main.yml b/ansible/roles/qt5ct_setup/defaults/main.yml new file mode 100644 index 00000000000..bdaab0e3e6d --- /dev/null +++ b/ansible/roles/qt5ct_setup/defaults/main.yml @@ -0,0 +1 @@ +# defaults file for qt5ct_setup diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/downarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/downarrow.svg new file mode 100644 index 00000000000..eb6b3fa15e7 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/downarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/uparrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/uparrow.svg new file mode 100644 index 00000000000..9df564b2f46 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/uparrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-end.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-end.svg new file mode 100755 index 00000000000..3d57b5a8da4 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-end.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-more.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-more.svg new file mode 100755 index 00000000000..e5aa4c609e4 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-more.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/downarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/downarrow.svg new file mode 100755 index 00000000000..eb6b3fa15e7 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/downarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/leftarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/leftarrow.svg new file mode 100755 index 00000000000..d0f92cb0cee --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/leftarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_checked.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_checked.svg new file mode 100755 index 00000000000..253a3390f8b --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_checked.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_unchecked.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_unchecked.svg new file mode 100755 index 00000000000..58f7a262cab --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_unchecked.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/rightarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/rightarrow.svg new file mode 100755 index 00000000000..3c0f7d75cb7 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/rightarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/uparrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/uparrow.svg new file mode 100755 index 00000000000..9df564b2f46 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/uparrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/vline.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/vline.svg new file mode 100755 index 00000000000..5881dc0f7da --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/vline.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/add.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/add.svg new file mode 100644 index 00000000000..71db35634be --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/add.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-closed.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-closed.svg new file mode 100755 index 00000000000..1ad9694e59c --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-closed.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-end.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-end.svg new file mode 100755 index 00000000000..7c8f5274b22 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-end.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-more.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-more.svg new file mode 100755 index 00000000000..ae87542b2da --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-more.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-open.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-open.svg new file mode 100755 index 00000000000..7faf29d632d --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/branch-open.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_disabled.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_disabled.svg new file mode 100644 index 00000000000..4d209ef8ffb --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_disabled.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_enabled.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_enabled.svg new file mode 100644 index 00000000000..19a52b880ee --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_enabled.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_hovered.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_hovered.svg new file mode 100644 index 00000000000..cdbfa0da561 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_hovered.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_pressed.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_pressed.svg new file mode 100644 index 00000000000..5470a4c58cd --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_checked_pressed.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_disabled.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_disabled.svg new file mode 100644 index 00000000000..31f5e4888aa --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_disabled.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_enabled.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_enabled.svg new file mode 100644 index 00000000000..aa801e4045a --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_enabled.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_hovered.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_hovered.svg new file mode 100644 index 00000000000..80a8df071f2 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_hovered.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_pressed.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_pressed.svg new file mode 100644 index 00000000000..14b6fec7f85 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_indeterminate_pressed.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_disabled.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_disabled.svg new file mode 100644 index 00000000000..8b3839bc244 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_disabled.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_enabled.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_enabled.svg new file mode 100644 index 00000000000..2992a9fdfac --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_enabled.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_hovered.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_hovered.svg new file mode 100644 index 00000000000..28745854522 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_hovered.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_pressed.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_pressed.svg new file mode 100644 index 00000000000..c7f3755b2d4 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/checkbox_unchecked_pressed.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/close.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/close.svg new file mode 100755 index 00000000000..9026603c977 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/downarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/downarrow.svg new file mode 100755 index 00000000000..2481bf8acc0 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/downarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/float.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/float.svg new file mode 100755 index 00000000000..ba80019b97e --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/float.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/leftarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/leftarrow.svg new file mode 100755 index 00000000000..71678e2e693 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/leftarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/minus.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/minus.svg new file mode 100644 index 00000000000..7c87293e9b3 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/minus.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/more.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/more.svg new file mode 100644 index 00000000000..5ad31e749b1 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/more.svg @@ -0,0 +1,5 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_checked.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_checked.svg new file mode 100755 index 00000000000..e5173e229fa --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_checked.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_checked_invert.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_checked_invert.svg new file mode 100755 index 00000000000..61dd75ad404 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_checked_invert.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_unchecked.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_unchecked.svg new file mode 100755 index 00000000000..8d9ce155419 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_unchecked.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_unchecked_invert.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_unchecked_invert.svg new file mode 100755 index 00000000000..22590a0bff1 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/radiobutton_unchecked_invert.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/rightarrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/rightarrow.svg new file mode 100755 index 00000000000..26bb041dc59 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/rightarrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/sizegrip.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/sizegrip.svg new file mode 100755 index 00000000000..bbc7bd248c4 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/sizegrip.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/slider.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/slider.svg new file mode 100755 index 00000000000..7caf04186da --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/slider.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/splitter-horizontal.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/splitter-horizontal.svg new file mode 100644 index 00000000000..cb95aa21dd8 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/splitter-horizontal.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/splitter-vertical.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/splitter-vertical.svg new file mode 100644 index 00000000000..d4819f465e5 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/splitter-vertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/tab_close.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/tab_close.svg new file mode 100755 index 00000000000..45aa5d57777 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/tab_close.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/toolbar-handle-horizontal.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/toolbar-handle-horizontal.svg new file mode 100755 index 00000000000..8e7e03463e6 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/toolbar-handle-horizontal.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/toolbar-handle-vertical.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/toolbar-handle-vertical.svg new file mode 100755 index 00000000000..a6c19f370d7 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/toolbar-handle-vertical.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/uparrow.svg b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/uparrow.svg new file mode 100755 index 00000000000..6eb3e13f7ad --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware-rviz-icons/primary/uparrow.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ansible/roles/qt5ct_setup/files/autoware.qss b/ansible/roles/qt5ct_setup/files/autoware.qss new file mode 100644 index 00000000000..3bd40b42527 --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/autoware.qss @@ -0,0 +1,1392 @@ +/* ------------------------------------------------------------------------ */ +/* QtMaterial - https://github.com/UN-GCPDS/qt-material +/* By Yeison Cardona - GCPDS +/* ------------------------------------------------------------------------ */ + +* { + color: #ffffff; + font-family: Roboto, sans-serif; + font-size: 13px; + line-height: 13px; + selection-color: #0f1417; +} + +*:focus { + outline: none; +} + +/* Basic widgets */ + +QWidget { + background-color: #0f1417; +} + +QGroupBox, +QFrame { + background-color: #0f1417; +} + +QGroupBox.fill_background, +QFrame.fill_background { + background-color: #0f1417; +} + +QSplitter { + background-color: transparent; + border: none; +} + +QStatusBar { + color: #ffffff; + background-color: #0f1417; + border-radius: 0px; +} + +QScrollArea, +QStackedWidget, +QWidget > QToolBox, +QToolBox > QWidget, +QTabWidget > QWidget { + border: none; +} + +QTabWidget::pane { + border: none; +} + +/* ------------------------------------------------------------------------ */ +/* Inputs */ + +QDateEdit, +QDateTimeEdit, +QSpinBox, +QDoubleSpinBox, +QComboBox, +QLineEdit { + color: #ffffff; + padding-left: 16px; + border-radius: 0px; + height: 24px; + background-color: #0f1417; +} + +QListView { + color: #ffffff; + height: 24px; + background-color: #1b2023; + selection-background-color: #303538; + selection-color: #ffffff; +} + +QPlainTextEdit { + padding: 8px 0px; + background-color: #0f1417; + border: 2px solid #0f1417; +} + +QTextEdit { + padding: 8px 0px; + background-color: #0f1417; +} + +QSpinBox, +QDoubleSpinBox { + color: #ffffff; + background-color: #292d30; + height: 24px; + border-bottom: 1px solid #DFE3E7; + selection-background-color: #84c2e6; +} + +QAbstractSpinBox { + padding: 2px; +} + +QDateEdit:disabled, +QDateTimeEdit:disabled, +QSpinBox:disabled, +QDoubleSpinBox:disabled, +QTextEdit:disabled, +QLineEdit:disabled { + color: rgba(255, 255, 255, 0.2); + background-color: rgba(35, 38, 41, 0.3); + border: 2px solid #232629; + border-width: 0 0 2px 0; + padding: 0px 16px; + border-radius: 0px; + height: 24px; +} + +/* ------------------------------------------------------------------------ */ +/* QComboBox */ + +QDateEdit, +QComboBox { + color: #ffffff; + height: 24px; + background-color: #292d30; + border-bottom: 1px solid #DFE3E7; +} + +QDateEdit:disabled, +QComboBox:disabled { + color: rgba(255, 255, 255, 0.2); + background-color: rgba(35, 38, 41, 0.3); + border-bottom: 2px solid #232629; +} + +QDateEdit::drop-down, +QComboBox::drop-down { + border: none; +} + +QDateEdit::down-arrow, +QComboBox::down-arrow { + image: url("/icons_path/active/downarrow.svg"); +} + +QDateEdit::down-arrow:focus, +QComboBox::down-arrow:focus { + image: url("/icons_path/primary/downarrow.svg"); +} + +QDateEdit::down-arrow:disabled, +QComboBox::down-arrow:disabled { + image: url("/icons_path/disabled/downarrow.svg"); +} + +QDateEdit QAbstractItemView, +QComboBox QAbstractItemView { + background-color: #0f1417; + padding: 4px; +} + +QDateEdit[frame="false"], +QComboBox[frame="false"] { + color: #ffffff; + background-color: transparent; + border: 1px solid transparent; +} + +QDateEdit[frame="false"]:disabled, +QComboBox[frame="false"]:disabled { + color: rgba(255, 255, 255, 0.2); +} + +/* ------------------------------------------------------------------------ */ +/* Spin buttons */ + +QDateTimeEdit::up-button, +QDoubleSpinBox::up-button, +QSpinBox::up-button { + subcontrol-origin: border; + subcontrol-position: top right; + width: 20px; + image: url("/icons_path/active/uparrow.svg"); + border-width: 0px; + margin-top: 5px; +} + +QTreeView QDateTimeEdit::up-button, +QTreeView QDoubleSpinBox::up-button, +QTreeView QSpinBox::up-button { + margin-top: 0px; +} + +QDateTimeEdit::up-button:disabled, +QDoubleSpinBox::up-button:disabled, +QSpinBox::up-button:disabled { + image: url("/icons_path/disabled/uparrow.svg"); +} + +QDateTimeEdit::down-button, +QDoubleSpinBox::down-button, +QSpinBox::down-button { + subcontrol-origin: border; + subcontrol-position: bottom right; + width: 20px; + image: url("/icons_path/active/downarrow.svg"); + border-width: 0px; + border-top-width: 0; + margin-bottom: 5px; +} + +QTreeView QDateTimeEdit::down-button, +QTreeView QDoubleSpinBox::down-button, +QTreeView QSpinBox::down-button { + margin-bottom: 0px; +} + +QDateTimeEdit::down-button:disabled, +QDoubleSpinBox::down-button:disabled, +QSpinBox::down-button:disabled { + image: url("/icons_path/disabled/downarrow.svg"); +} + +/* ------------------------------------------------------------------------ */ +/* QPushButton */ + +QPushButton { + text-transform: capitalize; + margin: 0px; + padding: 0px 16px; + height: 24px; + font-weight: bold; + color: #003546; + border: 2px solid rgba(255, 255, 255, 0); + border-radius: 14px; + background-color: #8bd0f0; +} + +QPushButton:checked, +QPushButton:pressed { + color: #003546; + background-color: #84c2e6; +} + +QPushButton:hover { + background-color: #84c2e6; + color: #003546; + border: 2px solid rgba(255, 255, 255, 0); +} + +QPushButton:flat { + margin: 0px; + color: #84c2e6; + border: none; + background-color: transparent; +} + +QPushButton:flat:hover { + background-color: #84c2e6; +} + +QPushButton:flat:pressed, +QPushButton:flat:checked { + background-color: #699bb8; +} + +QPushButton:disabled { + color: #6e7276; + background-color: #292d30; + border: 2px solid rgba(255, 255, 255, 0); +} + +QPushButton:flat:disabled { + color: #6e7276; + background-color: #292d30; + border: none; +} + +QPushButton:checked:disabled { + color: #6e7276; + background-color: #0f1417; + border: 2px solid rgba(255, 255, 255, 0); +} + +QToolButton:focus, +QPushButton:focus { + background-color: #84c2e6; +} + +QPushButton:checked:focus, +QPushButton:pressed:focus { + background-color: #699bb8; +} + +QPushButton:flat:focus { + border: none; + background-color: #84c2e6; +} + +/* ------------------------------------------------------------------------ */ +/* QTabBar */ + +QTabBar { + text-transform: capitalize; + font-weight: bold; +} + +QTabBar::tab { + color: #ffffff; + border-top: 2px solid rgba(255, 255, 255, 0); +} + +QTabBar::tab:bottom, +QTabBar::tab:top { + padding: 0 16px; + height: 28px; +} + +QTabBar::tab:left, +QTabBar::tab:right { + padding: 16px 0; + width: 28px; +} + +QTabBar::tab:top:selected, +QTabBar::tab:top:hover { + border-bottom: 2px solid #8bd0f0; +} + +QTabBar::tab:bottom:selected, +QTabBar::tab:bottom:hover { + border-top: 2px solid #8bd0f0; +} + +QTabBar::tab:right:selected, +QTabBar::tab:right:hover { + border-left: 2px solid #8bd0f0; +} + +QTabBar::tab:left:selected, +QTabBar::tab:left:hover { + border-right: 2px solid #8bd0f0; +} + +QTabBar::tab:hover { + color: #fff; + background-color: #303538; +} + +QTabBar::tab:selected { + color: #fff; + background-color: #292d30; +} + +/* pressed state */ +QTabBar::tab:pressed { + color: #fff; + background-color: #383b3f; +} + +QTabBar QToolButton:hover, +QTabBar QToolButton { + border: 0px; + background-color: #232629; +} + +QTabBar QToolButton::up-arrow { + image: url("/icons_path/primary/uparrow.svg"); + width: 28px; +} + +QTabBar QToolButton::down-arrow { + image: url("/icons_path/primary/downarrow.svg"); + width: 28px; +} + +QTabBar QToolButton::right-arrow { + image: url("/icons_path/disabled/rightarrow.svg"); + height: 28px; +} + +QTabBar QToolButton::left-arrow { + image: url("/icons_path/disabled/leftarrow.svg"); + height: 28px; +} + +QTabBar::close-button { + image: url("/icons_path/primary/tab_close.svg"); +} + +QTabBar::close-button:hover { + image: url("/icons_path/primary/tab_close.svg"); +} + +/* ------------------------------------------------------------------------ */ +/* QGroupBox */ + +QGroupBox { + padding: 16px; + padding-top: 36px; + text-transform: capitalize; +} + +QGroupBox::title { + color: #dfe3e7; + subcontrol-origin: margin; + subcontrol-position: top left; + padding: 16px; + background-color: transparent; + height: 36px; +} + +/* ------------------------------------------------------------------------ */ +/* QRadioButton and QCheckBox labels */ + +QRadioButton, +QCheckBox { + color: #84c2e6; + line-height: 12px; + height: 24px; + background-color: transparent; + spacing: 5px; +} + +QRadioButton:disabled, +QCheckBox:disabled { + color: #8bd0f0; +} + +/* ------------------------------------------------------------------------ */ +/* QRadioButton Indicator */ + +QRadioButton::indicator:checked { + image: url("/icons_path/primary/radiobutton_checked.svg"); +} + +QRadioButton::indicator:unchecked { + image: url("/icons_path/primary/radiobutton_unchecked.svg"); +} + +QRadioButton::indicator:checked:disabled { + image: url("/icons_path/disabled/radiobutton_checked.svg"); +} + +QRadioButton::indicator:unchecked:disabled { + image: url("/icons_path/disabled/radiobutton_unchecked.svg"); +} + +/* ------------------------------------------------------------------------ */ +/* QDockWidget */ + +QDockWidget { + color: #ffffff; + text-transform: capitalize; + border: 2px solid #232629; + titlebar-close-icon: url("/icons_path/primary/close.svg"); + titlebar-normal-icon: url("/icons_path/primary/float.svg"); + border-radius: 4px; +} + +QDockWidget::title { + text-align: left; + padding-left: 36px; + padding: 3px; + margin-top: 4px; +} + +/* ------------------------------------------------------------------------ */ +/* QMenu */ + +QMenu { + background-color: #1b2023; + margin: 10px; +} + +QMenu::item { + height: 14px; + margin: 4px; + padding: 0px; + color: #ffffff; +} + +QMenu::item:selected { + background-color: #303538; + margin-top: 0px; + margin-bottom: 0px; +} + +QMenu::item:disabled { + color: rgba(255, 255, 255, 0.3); +} + +QMenu::separator { + height: 1px; + margin: 2px; + background-color:#40484C; +} + +QMenu::right-arrow { + image: url("/icons_path/primary/rightarrow.svg"); + width: 16px; + height: 16px; +} + +QMenu::right-arrow:selected { + image: url("/icons_path/disabled/rightarrow.svg"); +} + +/* QMenu Checkboxes */ + +QMenu::indicator:non-exclusive:unchecked { + image: url("/icons_path/primary/checkbox_unchecked_enabled.svg"); +} + +QMenu::indicator:non-exclusive:unchecked:selected { + image: url("/icons_path/primary/checkbox_unchecked_hovered.svg"); +} + +QMenu::indicator:non-exclusive:checked { + image: url("/icons_path/primary/checkbox_checked_enabled.svg"); +} + +QMenu::indicator:non-exclusive:checked:selected { + image: url("/icons_path/primary/checkbox_checked_hovered.svg"); +} + +/* QMenu Radiobuttons */ + +QMenu::indicator:exclusive:unchecked { + image: url("/icons_path/primary/radiobutton_unchecked.svg"); +} + +QMenu::indicator:exclusive:unchecked:selected { + image: url("/icons_path/primary/radiobutton_unchecked_invert.svg"); +} + +QMenu::indicator:exclusive:checked { + image: url("/icons_path/primary/radiobutton_checked.svg"); +} + +QMenu::indicator:exclusive:checked:selected { + image: url("/icons_path/primary/radiobutton_checked_invert.svg"); +} + +/* ------------------------------------------------------------------------ */ +/* QMenuBar */ + +QMenuBar { + background-color: #0f1417; + color: #ffffff; + border-bottom: 2px solid rgba(255, 255, 255, 0); +} + +QMenuBar::item { + /* height: 32px; */ + padding: 4px; + background-color: transparent; + color: #ffffff; +} + +QMenuBar::item:selected, +QMenuBar::item:pressed { + color: #ffffff; + background-color: #303538; +} + +/* ------------------------------------------------------------------------ */ +/* QToolBox */ + +QToolBox::tab { + background-color: #0f1417; + color: #ffffff; + text-transform: capitalize; + border-radius: 4px; + padding-left: 15px; +} + +QToolBox::tab:selected, +QToolBox::tab:hover { + background-color: #84c2e6; +} + +/* ------------------------------------------------------------------------ */ +/* QProgressBar */ + +QProgressBar { + border-radius: 0; + background-color: #0f1417; + text-align: center; + color: transparent; +} + +QProgressBar::chunk { + background-color: #84c2e6; +} + +/* ------------------------------------------------------------------------ */ +/* QScrollBar */ + +QScrollBar { + border: 0; + background: rgba(255, 255, 255, 0.15); + border-radius: 5px; +} + +QScrollBar:horizontal { + height: 10px; +} + +QScrollBar:vertical { + width: 10px; +} + +QScrollBar::handle { + background: #8bd0f0; + border-radius: 5px; +} + +QScrollBar::handle:horizontal { + min-width: 24px; +} + +QScrollBar::handle:vertical { + min-height: 24px; +} + +QScrollBar::handle:hover { + background-color: #84c2e6; +} + +QScrollBar::handle:pressed { + background-color: #699bb8; +} + +QScrollBar::add-line:vertical, +QScrollBar::sub-line:vertical, +QScrollBar::add-line:horizontal, +QScrollBar::sub-line:horizontal { + border: 0; + background: transparent; + width: 0px; + height: 0px; +} + +QScrollBar::sub-page:horizontal, +QScrollBar::add-page:horizontal, +QScrollBar::sub-page:vertical, +QScrollBar::add-page:vertical { + background: transparent; +} + +/* ------------------------------------------------------------------------ */ +/* QScrollBar-Big */ + +QScrollBar.big:horizontal { + border: 0; + background: #232629; + height: 36px; +} + +QScrollBar.big:vertical { + border: 0; + background: #232629; + width: 36px; +} + +QScrollBar.big::handle, +QScrollBar.big::handle:vertical:hover, +QScrollBar.big::handle:horizontal:hover { + background: #84c2e6; +} + +QScrollBar.big::handle:horizontal { + min-width: 24px; +} + +QScrollBar.big::handle:vertical { + min-height: 24px; +} + +QScrollBar.big::add-line:vertical, +QScrollBar.big::sub-line:vertical, +QScrollBar.big::add-line:horizontal, +QScrollBar.big::sub-line:horizontal { + border: 0; + background: transparent; + width: 0px; + height: 0px; +} + +/* ------------------------------------------------------------------------ */ +/* QSlider */ +QSlider { + min-height: 20px; + min-width: 20px; +} + +QSlider:horizontal { + min-height: 30px; + min-width: 30px; +} + +QSlider:vertical { +} + +QSlider::groove:horizontal { + border: 1px solid #262626; + height: 4px; + background: #0f1417; + margin: 0; +} + +QSlider::groove:vertical { + width: 4px; + background: #0f1417; + margin: 12px 0; +} + +QSlider::handle:horizontal { + width: 22px; + height: 18px; + margin: -9px -9px; +} + +QSlider::handle:vertical { + background: #84c2e6; + width: 9px; + height: 9px; + min-height: 0px; + margin: -9px -18px; +} + +QSlider::add-page { + background: #5e5e5e; +} + +QSlider::sub-page { + background: #84c2e6; +} + +/* ------------------------------------------------------------------------ */ +/* QLabel */ + +QLabel { + border: none; + background: transparent; + color: #ffffff; +} + +QLabel:disabled { + color: rgba(255, 255, 255, 0.2); +} + +/* ------------------------------------------------------------------------ */ +/* VLines and HLinex */ + +QFrame[frameShape="4"] { + border-width: 1px 0 0 0; + background: none; +} + +QFrame[frameShape="5"] { + border-width: 0 1px 0 0; + background: none; +} + +QFrame[frameShape="4"], +QFrame[frameShape="5"] { + border-color: #0f1417; +} + +/* ------------------------------------------------------------------------ */ +/* QToolBar */ + +QToolBar { + background: #0f1417; + border: 0px solid; +} + +QToolBar:horizontal { + /* border-bottom: 1px solid rgba(132, 194, 230, 0.7); */ + border-top: 1px solid rgba(132, 194, 230, 0.7); +} + +QToolBar:vertical { + border-right: 1px solid rgba(132, 194, 230, 0.7); + border-left: 1px solid rgba(132, 194, 230, 0.7); +} + +QToolBar::handle:horizontal { + image: url("/icons_path/primary/toolbar-handle-horizontal.svg"); +} + +QToolBar::handle:vertical { + image: url("/icons_path/primary/toolbar-handle-vertical.svg"); +} + +QToolBar::separator:horizontal { + border-top: 1px solid rgba(132, 194, 230, 0.7); + border-bottom: 1px solid rgba(132, 194, 230, 0.7); + width: 1px; +} + +QToolBar::separator:vertical { + border-top: 1px solid rgba(132, 194, 230, 0.7); + border-bottom: 1px solid rgba(132, 194, 230, 0.7); + height: 1px; +} + +/* ------------------------------------------------------------------------ */ +/* QToolButton */ + +QToolButton { + background: #171c1f; + border: 0px; + margin: 2px; + padding: 2px; + border-radius: 15px; + color: #8bd0f0; +} + +QToolButton:hover { + background: #262931; +} + +QToolButton:pressed { + background: #2d303a; +} + +QToolButton:checked { + background: #2d303a; + border: 1px solid #8bd0f0; +} + +/* ------------------------------------------------------------------------ */ +/* General viewers */ + +QTableView { + background-color: #0f1417; + border: 1px solid #232629; + border-radius: 4px; +} + +QTreeView, +QListView { + margin: 0px; + border: 0px; +} + +QTableView::item, +QTreeView::item, +QListView::item { + padding: 2px; + min-height: 12px; + color: #ffffff; + border-color: transparent; +} + +QListView::item { + margin-left: 0px; + margin-right: 2px; + background-color: #1b2023; +} + +/* ------------------------------------------------------------------------ */ +/* Items Selection */ + +QTableView::item:selected, +QTreeView::item:selected, +QListView::item:selected { + background-color: #303538; + color: #ffffff; +} + +QTableView::item:selected:focus, +QTreeView::item:selected:focus, +QListView::item:selected:focus { + color: #ffffff; +} + +QTableView::item:disabled { + color: #bdbdbd; + background-color: #303538; +} + +/* ------------------------------------------------------------------------ */ +/* QTreeView */ + +QTreeView::branch { + background-color: transparent; +} + +QTreeView::branch:hover { + background-color: transparent; +} + +QTreeView::branch:selected { + background-color: #303538; +} + +QTreeView::branch:closed:has-children:has-siblings, +QTreeView::branch:closed:has-children:!has-siblings { + image: url("/icons_path/primary/branch-closed.svg"); + margin-left: -8px; +} + +QTreeView::branch:open:has-children:!has-siblings, +QTreeView::branch:open:has-children:has-siblings { + image: url("/icons_path/primary/branch-open.svg"); + margin-left: -8px; +} + +/* Commented in case decided to show the branch icons */ +/* +QTreeView::branch:has-siblings:!adjoins-item { + border-image: url("/icons_path/disabled/vline.svg"); +} + +QTreeView::branch:has-siblings:adjoins-item { + border-image: url("/icons_path/disabled/branch-more.svg"); +} + +QTreeView::branch:!has-children:!has-siblings:adjoins-item, +QTreeView::branch:has-children:!has-siblings:adjoins-item { + border-image: url("/icons_path/disabled/branch-end.svg"); +} */ + +QTreeView QHeaderView::section { + border: none; +} + +/* QTableView */ + +QTableCornerButton::section { + background-color: #0f1417; + border-radius: 0px; + border-right: 1px solid; + border-bottom: 1px solid; + border-color: #31363b; +} + +QHeaderView { + border: none; +} + +QHeaderView::section { + color: rgba(255, 255, 255, 0.7); + text-transform: capitalize; + background-color: #0f1417; + padding: 4px 6px; + border-radius: 0px; + border-right: 1px solid; + border-bottom: 1px solid; + border-color: #31363b; +} + +QHeaderView::section:vertical { +} + +QHeaderView::section:horizontal { +} + +/* ------------------------------------------------------------------------ */ +/* QLCDNumber */ + +QLCDNumber { + color: #84c2e6; + background-color: #699bb8; + border: 1px solid rgba(132, 194, 230, 0.3); + border-radius: 4px; +} + +/* ------------------------------------------------------------------------ */ +/* QCalendarWidget */ + +QCalendarWidget { + min-height: 300px; +} + +#qt_calendar_prevmonth { + qproperty-icon: url("/icons_path/primary/leftarrow.svg"); +} + +#qt_calendar_nextmonth { + qproperty-icon: url("/icons_path/primary/rightarrow.svg"); +} + +/* ------------------------------------------------------------------------ */ +/* Inline QLineEdit */ + +QTreeView QLineEdit, +QTableView QLineEdit, +QListView QLineEdit { + color: #ffffff; + background-color: #0f1417; + /* border: 1px solid unset; */ + border-radius: unset; + padding: unset; + padding-left: unset; + height: unset; + border-width: unset; + border-top-left-radius: unset; + border-top-right-radius: unset; +} + +/* ------------------------------------------------------------------------ */ +/* QToolTip */ + +QToolTip { + padding: 4px; + border: 1px solid #31363b; + border-radius: 4px; + color: #ffffff; + background-color: #0f1417; +} + +/* ------------------------------------------------------------------------ */ +/* QDialog */ + +/* linux */ +QDialog QToolButton, +QDialog QToolButton:hover, +QDialog QToolButton:pressed, +QDialog QToolButton:checked { + border: 0px; + height: unset; + margin: unset; + padding: unset; + border-right: unset; + border-left: unset; + background-color: #84c2e6; + color: #ffffff; + border-radius: 8px; +} + +QDialog QToolButton:disabled { + background-color: #0f1417; + color: #ffffff; +} + +/* ------------------------------------------------------------------------ */ +/* Grips */ + +QMainWindow::separator:vertical, +QSplitter::handle:horizontal { + image: url("/icons_path/primary/splitter-vertical.svg"); + background-color: rgba(255, 255, 255, 0.03); + width: 15px; +} + +QMainWindow::separator:horizontal, +QSplitter::handle:vertical { + image: url("/icons_path/primary/splitter-horizontal.svg"); + background-color: rgba(255, 255, 255, 0.03); + height: 15px; +} + +QSizeGrip { + image: url("/icons_path/primary/sizegrip.svg"); + background-color: transparent; +} + +QMenuBar QToolButton:hover, +QMenuBar QToolButton:pressed, +QMenuBar QToolButton { + border-width: 0; + border-image: url("/icons_path/primary/rightarrow.svg"); + background-color: transparent; +} + +/* ------------------------------------------------------------------------ */ +/* Focus */ + +QDateTimeEdit:focus, +QSpinBox:focus, +QDoubleSpinBox:focus, +QComboBox:focus { + color: #fff; + border-bottom: 2px solid #8bd0f0; + background-color: #303538; +} + + +QDateTimeEdit::up-button:focus, +QDoubleSpinBox::up-button:focus, +QSpinBox::up-button:focus { + image: url("/icons_path/primary/uparrow.svg"); +} + +QDateTimeEdit::down-button:focus, +QDoubleSpinBox::down-button:focus, +QSpinBox::down-button:focus { + image: url("/icons_path/primary/downarrow.svg"); +} + +/* Special cases from rviz source code */ + +QToolButton[toolTip="Add a new tool"] { + qproperty-iconSize: 16px 16px; + qproperty-icon: url("/icons_path/primary/add.svg"); + background: #171c1f; + border: 0px; + margin: 2px; + padding: 0px; + border-radius: 12px; + width: 24px; + height: 24px; +} + +QToolButton[toolTip="Add a new tool"]:hover { + background: #262931; +} + +QToolButton[toolTip="Add a new tool"]:pressed { + background: #2d303a; +} + +QToolButton[toolTip="Remove a tool from the toolbar"] { + qproperty-iconSize: 16px 16px; + qproperty-icon: url("/icons_path/primary/minus.svg"); + background: #171c1f; + border: 0px; + margin: 2px; + padding: 0px; + border-radius: 12px; + width: 24px; + height: 24px; +} + +QToolButton[toolTip="Remove a tool from the toolbar"]:hover { + background: #262931; +} + +QToolButton[toolTip="Remove a tool from the toolbar"]:pressed { + background: #2d303a; +} + +QDialog { + background-color: #1b2023; +} + +QGroupBox[title="Tool Type"] > QTextBrowser { + background-color: #1b2023; +} + +QGroupBox[title="Tool Type"] { + background-color: #1b2023; +} +QGroupBox[title="Tool Type"] > QTreeView { + background-color: #1b2023; +} + +QGroupBox[title="Panel Name"] { + background-color: #1b2023; +} + +QGroupBox[title="Panel Name"] > QLineEdit { + background-color: #1b2023; +} + +QGroupBox[title="Panel Type"] > QTextBrowser { + background-color: #1b2023; +} + +QGroupBox[title="Panel Type"] { + background-color: #1b2023; +} +QGroupBox[title="Panel Type"] > QTreeView { + background-color: #1b2023; +} + +QGroupBox[title="Create visualization"] { + background-color: #1b2023; +} + +QGroupBox[title="Create visualization"] > QTextBrowser { + background-color: #1b2023; +} +QGroupBox[title="Display Name"] { + background-color: #1b2023; +} + +QGroupBox[title="Display Name"] > QLineEdit { + background-color: #1b2023; +} + +QGroupBox[title="Create visualization"] > QTabWidget { + background-color: #1b2023; +} + +QGroupBox[title="Create visualization"] QTabWidget QTreeWidget { + background-color: #1b2023; + color: white; +} +QGroupBox[title="Create visualization"] QCheckBox { + background-color: #1b2023; + color: white; +} + +QGroupBox[title="Create visualization"] QTabWidget::pane { + background-color: #1b2023; +} + +QGroupBox[title="Create visualization"] QTabBar::tab { + background-color: #1b2023; + color: white; +} + +QGroupBox[title="Create visualization"] QTabBar::tab:selected { + background-color: #383b3f; + border-bottom: 2px solid #8bd0f0; +} + +QGroupBox[title="Create visualization"] QTabBar::tab:!selected { + background-color: #1b2023; + border-bottom: 2px solid #1b2023; +} + +QGroupBox[title="Create visualization"] QTabBar::tab:hover { + color: #fff; + background-color: #292d30; + border-bottom: 2px solid #8bd0f0; +} + +QGroupBox[title="Create visualization"] QTabBar::tab:pressed { + color: #fff; + background-color: #383b3f; + border-bottom: 2px solid #8bd0f0; +} + +QGroupBox[title="Create visualization"] QFrame { + background-color: #1b2023; + border: none; + margin: 0px; + padding: 0px; +} + +QComboBox { + padding: 2px; + margin: 0px; +} + +/* QLineEdit */ +QLineEdit { + border-top-left-radius: 0px; + border-top-right-radius: 0px; + selection-background-color: #84c2e6; + +} + +QLineEdit > QPushButton { + qproperty-icon: url("/icons_path/primary/more.svg"); + qproperty-iconSize: 16px 16px; + qproperty-text: ""; + margin: 0px; + padding: 0px; + background: transparent; + border-radius: 0px; +} + +QLineEdit > QPushButton:hover { + background: transparent; + border-radius: 0px; +} + +/* Not entirely sure if this affects anything other than the close button */ +QDockWidget QToolButton { + qproperty-icon: url("/icons_path/primary/close.svg"); + qproperty-iconSize: 16px 16px; + background: transparent; +} + +QDockWidget QToolButton:hover { + background: #262931; +} + +/* Style the list view of the QComboBox */ +QComboBox QAbstractItemView { + background-color: #1b2023; + height: 16px; +} +QComboBox { + selection-background-color: #84c2e6; + selection-color: #1b2023; +} + + +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:checked, +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:checked:selected, +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:checked:focus, +QGroupBox[title="Create visualization"] QCheckBox::indicator:checked, +QTreeView::indicator:enabled:checked, +QTreeView::indicator:enabled:checked:selected, +QTreeView::indicator:enabled:checked:focus, +QTreeView::indicator:checked { + image: url("/icons_path/primary/checkbox_checked_enabled.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:checked:selected:active, +QTreeView::indicator:checked:selected:active { + image: url("/icons_path/primary/checkbox_checked_hovered.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:checked, +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:checked:selected, +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:checked:focus, +QGroupBox[title="Create visualization"] QCheckBox::indicator:checked:disabled, +QTreeView::indicator:disabled:checked, +QTreeView::indicator:disabled:checked:selected, +QTreeView::indicator:disabled:checked:focus, +QTreeView::indicator:checked:disabled { + image: url("/icons_path/primary/checkbox_checked_disabled.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:unchecked, +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:unchecked:selected, +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:unchecked:focus, +QGroupBox[title="Create visualization"] QCheckBox::indicator:unchecked, +QTreeView::indicator:enabled:unchecked, +QTreeView::indicator:enabled:unchecked:selected, +QTreeView::indicator:enabled:unchecked:focus, +QTreeView::indicator:unchecked { + image: url("/icons_path/primary/checkbox_unchecked_enabled.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:unchecked:selected:active, +QTreeView::indicator:unchecked:selected:active { + image: url("/icons_path/primary/checkbox_unchecked_hovered.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:unchecked, +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:unchecked:selected, +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:unchecked:focus, +QGroupBox[title="Create visualization"] QCheckBox::indicator:unchecked:disabled, +QTreeView::indicator:disabled:unchecked, +QTreeView::indicator:disabled:unchecked:selected, +QTreeView::indicator:disabled:unchecked:focus, +QTreeView::indicator:unchecked:disabled { + image: url("/icons_path/primary/checkbox_unchecked_disabled.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:indeterminate, +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:indeterminate:selected, +QGroupBox[title="Create visualization"] QCheckBox::indicator:enabled:indeterminate:focus, +QGroupBox[title="Create visualization"] QCheckBox::indicator:indeterminate, +QTreeView::indicator:enabled:indeterminate, +QTreeView::indicator:enabled:indeterminate:selected, +QTreeView::indicator:enabled:indeterminate:focus, +QTreeView::indicator:indeterminate { + image: url("/icons_path/primary/checkbox_indeterminate_enabled.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:indeterminate:selected:active, +QTreeView::indicator:indeterminate:selected:active { + image: url("/icons_path/primary/checkbox_indeterminate_hovered.svg"); +} + +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:indeterminate, +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:indeterminate:selected, +QGroupBox[title="Create visualization"] QCheckBox::indicator:disabled:indeterminate:focus, +QGroupBox[title="Create visualization"] QCheckBox::indicator:indeterminate:disabled, +QTreeView::indicator:disabled:indeterminate, +QTreeView::indicator:disabled:indeterminate:selected, +QTreeView::indicator:disabled:indeterminate:focus, +QTreeView::indicator:indeterminate:disabled { + image: url("/icons_path/primary/checkbox_indeterminate_disabled.svg"); +} +QGroupBox[title="Create visualization"] QCheckBox::indicator, +QTreeView::indicator { + width: 20px; + height: 20px; +} + + +QTreeView::item:disabled { + color: #888888; +} + + +QTreeView QComboBox, +QTreeView QSpinBox, +QTreeView QDoubleSpinBox { + border: 0px; +} + +QTreeView QComboBox:focus, +QTreeView QSpinBox:focus, +QTreeView QDoubleSpinBox:focus { + border: 0px; +} diff --git a/ansible/roles/qt5ct_setup/files/qt5ct.conf b/ansible/roles/qt5ct_setup/files/qt5ct.conf new file mode 100644 index 00000000000..90c386c617f --- /dev/null +++ b/ansible/roles/qt5ct_setup/files/qt5ct.conf @@ -0,0 +1,35 @@ +[Appearance] +color_scheme_path=/usr/share/qt5ct/colors/darker.conf +custom_palette=true +icon_theme=ubuntu-mono-dark +standard_dialogs=default +style=Fusion + +[Fonts] +fixed=@Variant(\0\0\0@\0\0\0\f\0R\0o\0\x62\0o\0t\0o\xbf\xf0\0\0\0\0\0\0\0\0\0\r\x5\x1\0\x32\x10) +general=@Variant(\0\0\0@\0\0\0\f\0R\0o\0\x62\0o\0t\0o\xbf\xf0\0\0\0\0\0\0\0\0\0\r\x5\x1\0\x32\x10) + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=3 +cursor_flash_time=1000 +dialog_buttons_have_icons=1 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=autoware_stylesheet_path +toolbutton_style=0 +underline_shortcut=1 +wheel_scroll_lines=3 + +[QSSEditor] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\t\xde\0\0\x2~\0\0\f`\0\0\x4\x95\0\0\t\xde\0\0\x2\xa3\0\0\f`\0\0\x4\x95\0\0\0\0\0\0\0\0\n\0\0\0\t\xde\0\0\x2\xa3\0\0\f`\0\0\x4\x95) + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\f\x9c\0\0\x4\x19\0\0\xfz\0\0\a\x3\0\0\f\x9c\0\0\x4>\0\0\xfz\0\0\a\x3\0\0\0\0\0\0\0\0\xf\0\0\0\f\x9c\0\0\x4>\0\0\xfz\0\0\a\x3) + +[Troubleshooting] +force_raster_widgets=2 +ignored_applications=@Invalid() diff --git a/ansible/roles/qt5ct_setup/meta/main.yml b/ansible/roles/qt5ct_setup/meta/main.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ansible/roles/qt5ct_setup/tasks/main.yml b/ansible/roles/qt5ct_setup/tasks/main.yml new file mode 100644 index 00000000000..fbb6c912117 --- /dev/null +++ b/ansible/roles/qt5ct_setup/tasks/main.yml @@ -0,0 +1,81 @@ +- name: Install qt5ct + ansible.builtin.apt: + name: qt5ct + state: present + become: true + +- name: Install rsync + ansible.builtin.package: + name: rsync + state: present + become: true + +- name: Remove qt5ct from auto-start + ansible.builtin.file: + path: /etc/X11/Xsession.d/99qt5ct + state: absent + become: true + +- name: Set variable qt5ct_config_dir + ansible.builtin.set_fact: + qt5ct_config_dir: "{{ ansible_env.HOME }}/.config/qt5ct" + +- name: Ensure qt5ct_config_dir exists + ansible.builtin.file: + path: "{{ qt5ct_config_dir }}" + state: directory + mode: "0755" + +- name: Print the role_path + ansible.builtin.debug: + msg: "The role_path is: {{ role_path }}" + +- name: Set icons_path variable + ansible.builtin.set_fact: + icons_path: "{{ qt5ct_config_dir }}/autoware-rviz-icons" + +- name: Remove autoware-rviz-icons folder if it exists + ansible.builtin.file: + path: "{{ icons_path }}" + state: absent + +# Replace rsync with synchronize which is an ansible wrapper for rsync +- name: Copy autoware-rviz-icons to the qt5ct config directory + ansible.posix.synchronize: + src: "{{ role_path }}/files/autoware-rviz-icons/" + dest: "{{ icons_path }}/" + mode: push + +- name: Fix the paths in the qss file + ansible.builtin.replace: + path: "{{ role_path }}/files/autoware.qss" + regexp: /icons_path/ + replace: "{{ icons_path }}/" + +- name: Ensure qt5ct_config_dir/qss exists + ansible.builtin.file: + path: "{{ qt5ct_config_dir }}/qss" + state: directory + mode: "0755" + +- name: Copy autoware.qss to the qt5ct qss directory + ansible.builtin.copy: + src: "{{ role_path }}/files/autoware.qss" + dest: "{{ qt5ct_config_dir }}/qss/autoware.qss" + force: true + backup: true + mode: "0644" + +- name: Fix the paths in the config file + ansible.builtin.replace: + path: "{{ role_path }}/files/qt5ct.conf" + regexp: autoware_stylesheet_path + replace: "{{ qt5ct_config_dir }}/qss/autoware.qss" + +- name: Copy qt5ct.conf to the config directory + ansible.builtin.copy: + src: "{{ role_path }}/files/qt5ct.conf" + dest: "{{ ansible_env.HOME }}/.config/qt5ct/qt5ct.conf" + force: true + backup: true + mode: "0644" diff --git a/ansible/roles/rmw_implementation/README.md b/ansible/roles/rmw_implementation/README.md index 8f5849fdeaf..41af1aee5a3 100644 --- a/ansible/roles/rmw_implementation/README.md +++ b/ansible/roles/rmw_implementation/README.md @@ -1,6 +1,6 @@ # rmw_implementation -This role sets up ROS 2 RMW implementation following [this page](https://docs.ros.org/en/galactic/How-To-Guides/Working-with-multiple-RMW-implementations.html). +This role sets up ROS 2 RMW implementation following [this page](https://docs.ros.org/en/humble/How-To-Guides/Working-with-multiple-RMW-implementations.html). ## Inputs @@ -15,10 +15,10 @@ For Universe, the `rosdistro` and `rmw_implementation` variable can also be foun [../../playbooks/universe.yaml](../../playbooks/universe.yaml) ```bash -# For details: https://docs.ros.org/en/galactic/How-To-Guides/Working-with-multiple-RMW-implementations.html +wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env + +# For details: https://docs.ros.org/en/humble/How-To-Guides/Working-with-multiple-RMW-implementations.html sudo apt update -rosdistro=galactic -rmw_implementation=rmw_cyclonedds_cpp rmw_implementation_dashed=$(eval sed -e "s/_/-/g" <<< "${rmw_implementation}") sudo apt install ros-${rosdistro}-${rmw_implementation_dashed} diff --git a/ansible/roles/rmw_implementation/meta/main.yaml b/ansible/roles/rmw_implementation/meta/main.yaml index 81b20fe4831..e69de29bb2d 100644 --- a/ansible/roles/rmw_implementation/meta/main.yaml +++ b/ansible/roles/rmw_implementation/meta/main.yaml @@ -1,2 +0,0 @@ -dependencies: - - role: autoware.dev_env.ros2 diff --git a/ansible/roles/rmw_implementation/tasks/main.yaml b/ansible/roles/rmw_implementation/tasks/main.yaml index 1c5faea1d70..e7f23557a0f 100644 --- a/ansible/roles/rmw_implementation/tasks/main.yaml +++ b/ansible/roles/rmw_implementation/tasks/main.yaml @@ -1,19 +1,36 @@ - name: Get dash-case name of rmw_implementation ansible.builtin.shell: bash -c 'sed -e "s/_/-/g" <<< $(echo {{ rmw_implementation }})' - register: dash_case_rmw_implementation + register: rmw_implementation__dash_case_rmw_implementation changed_when: false -- name: Install ros-{{ rosdistro }}-{{ dash_case_rmw_implementation.stdout }} +- name: Hold check of ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }} + ansible.builtin.command: apt-mark showhold + register: held_ros_packages + changed_when: false + +- name: Install ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }} become: true ansible.builtin.apt: - name: ros-{{ rosdistro }}-{{ dash_case_rmw_implementation.stdout }} + name: ros-{{ rosdistro }}-{{ rmw_implementation__dash_case_rmw_implementation.stdout }} state: latest update_cache: true + when: "'ros-' + rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout not in held_ros_packages.stdout" + register: install_result + failed_when: false + +- name: Display warning if ROS 2 RMW package is held + ansible.builtin.debug: + msg: ROS 2 RMW package 'ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }}' is apt-mark hold. Skipping installation. + when: not install_result.changed - name: Add RMW_IMPLEMENTATION to .bashrc + become: true ansible.builtin.lineinfile: - dest: ~/.bashrc + dest: "{{ item }}" line: export RMW_IMPLEMENTATION={{ rmw_implementation }} state: present create: true mode: 0644 + loop: + - ~/.bashrc + - /etc/skel/.bashrc diff --git a/ansible/roles/rocker/README.md b/ansible/roles/rocker/README.md deleted file mode 100644 index ded68609c11..00000000000 --- a/ansible/roles/rocker/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# rocker - -This role installs [osrf/rocker](https://github.com/osrf/rocker) following the [installation guide](https://github.com/osrf/rocker/#installation). - -## Inputs - -None. - -## Manual Installation - -Install rocker: - -```bash -# Taken from: https://github.com/osrf/rocker#installation - -# Add the ROS 2 apt repository to your system. First authorize our GPG key with apt. -sudo apt update && sudo apt install curl gnupg lsb-release -sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - -# Then add the repository to your sources list. -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null - -sudo apt update -sudo apt-get install python3-rocker -``` diff --git a/ansible/roles/rocker/tasks/main.yaml b/ansible/roles/rocker/tasks/main.yaml deleted file mode 100644 index 57f1432710c..00000000000 --- a/ansible/roles/rocker/tasks/main.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -- name: Authorize ROS GPG key - become: true - ansible.builtin.get_url: - url: https://raw.githubusercontent.com/ros/rosdistro/master/ros.key - dest: /usr/share/keyrings/ros-archive-keyring.gpg - -- name: Save result of 'dpkg --print-architecture' - ansible.builtin.command: dpkg --print-architecture - register: deb_architecture - changed_when: false - -- name: Save result of 'lsb_release -cs' - ansible.builtin.command: lsb_release -cs - register: lsb_release_cs - changed_when: false - -# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null -- name: Add ROS 2 apt repository to source list - become: true - ansible.builtin.apt_repository: - repo: deb [arch={{ deb_architecture.stdout }} signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu {{ lsb_release_cs.stdout }} main - filename: ros2 - state: present - update_cache: true - -- name: Install rocker - become: true - ansible.builtin.apt: - name: - - python3-rocker - update_cache: true diff --git a/ansible/roles/ros2/README.md b/ansible/roles/ros2/README.md index 9eb5ec40bf5..07fab9500b8 100644 --- a/ansible/roles/ros2/README.md +++ b/ansible/roles/ros2/README.md @@ -1,9 +1,11 @@ # ros2 -This role installs [ROS 2](http://www.ros2.org/) following [this page](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html). +This role installs [ROS 2](http://www.ros2.org/) following [this page](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html). Additional steps may be needed depending on the `rosdistro` you choose. +To prevent the update of the ROS 2 packages, if ros-`distro`-desktop is held, the installation process for the packages will be skipped and output warning. + ```bash @@ -16,21 +18,23 @@ $ apt-cache policy | grep universe ## Inputs -| Name | Required | Description | -| ----------------- | -------- | ------------------------------------------------ | -| rosdistro | true | The ROS distro. | -| installation_type | false | The installation type (`desktop` or `ros-base`). | +| Name | Required | Description | +| ---------------------- | -------- | ------------------------------------------------ | +| rosdistro | true | The ROS distro. | +| ros2_installation_type | false | The installation type (`desktop` or `ros-base`). | ## Manual Installation -The `installation_type` variable can also be found in: +The `ros2_installation_type` variable can also be found in: [./defaults/main.yaml](./defaults/main.yaml) For Universe, the `rosdistro` variable can also be found in: [../../playbooks/universe.yaml](../../playbooks/universe.yaml) ```bash -# Taken from: https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html +wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env + +# Taken from: https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html # You will need to add the ROS 2 apt repository to your system. First, make sure that the Ubuntu Universe repository is enabled by checking the output of this command. apt-cache policy | grep universe @@ -55,9 +59,8 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-a sudo apt update # Desktop Install -rosdistro=galactic -installation_type=desktop -sudo apt install ros-${rosdistro}-${installation_type} +ros2_installation_type=desktop +sudo apt install ros-${rosdistro}-${ros2_installation_type} # Environment setup # (Optional) You can source ros2 in the ~/.bashrc file. diff --git a/ansible/roles/ros2/defaults/main.yaml b/ansible/roles/ros2/defaults/main.yaml index fca2d3a0cdd..ad22b88e874 100644 --- a/ansible/roles/ros2/defaults/main.yaml +++ b/ansible/roles/ros2/defaults/main.yaml @@ -1 +1 @@ -installation_type: desktop +ros2_installation_type: desktop diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml index 1e208cf7015..beeb4cef6b2 100644 --- a/ansible/roles/ros2/tasks/main.yaml +++ b/ansible/roles/ros2/tasks/main.yaml @@ -13,37 +13,55 @@ ansible.builtin.get_url: url: https://raw.githubusercontent.com/ros/rosdistro/master/ros.key dest: /usr/share/keyrings/ros-archive-keyring.gpg + mode: 644 - name: Save result of 'dpkg --print-architecture' ansible.builtin.command: dpkg --print-architecture - register: deb_architecture + register: ros2__deb_architecture changed_when: false - name: Save result of 'source /etc/os-release && echo $UBUNTU_CODENAME' ansible.builtin.shell: bash -c 'source /etc/os-release && echo $UBUNTU_CODENAME' - register: ubuntu_codename + register: ros2__ubuntu_codename changed_when: false # echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null - name: Add ROS 2 apt repository to source list become: true ansible.builtin.apt_repository: - repo: deb [arch={{ deb_architecture.stdout }} signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu {{ ubuntu_codename.stdout }} main + repo: deb [arch={{ ros2__deb_architecture.stdout }} signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu {{ ros2__ubuntu_codename.stdout }} main filename: ros2 state: present update_cache: true -- name: Install ros-{{ rosdistro }}-{{ installation_type }} +- name: Hold check of ros-{{ rosdistro + '-' + ros2_installation_type }} + ansible.builtin.command: apt-mark showhold + register: held_ros_packages + changed_when: false + +- name: Install ros-{{ rosdistro + '-' + ros2_installation_type }} become: true ansible.builtin.apt: - name: ros-{{ rosdistro }}-{{ installation_type }} + name: ros-{{ rosdistro }}-{{ ros2_installation_type }} state: latest update_cache: true + when: "'ros-' + rosdistro + '-' + ros2_installation_type not in held_ros_packages.stdout" + register: install_result + failed_when: false + +- name: Display warning if ROS 2 package is held + ansible.builtin.debug: + msg: ROS package 'ros-{{ rosdistro + '-' + ros2_installation_type }}' is apt-mark hold. Skipping installation. + when: not install_result.changed - name: Add PATH to .bashrc + become: true ansible.builtin.lineinfile: - dest: ~/.bashrc + dest: "{{ item }}" line: source /opt/ros/{{ rosdistro }}/setup.bash state: present create: true mode: 0644 + loop: + - ~/.bashrc + - /etc/skel/.bashrc diff --git a/ansible/roles/ros2_dev_tools/README.md b/ansible/roles/ros2_dev_tools/README.md index 1ee3e379098..1afe660799c 100644 --- a/ansible/roles/ros2_dev_tools/README.md +++ b/ansible/roles/ros2_dev_tools/README.md @@ -1,6 +1,6 @@ # ros2_dev_tools -This role installs ROS 2 development tools following [this page](https://docs.ros.org/en/galactic/Installation/Ubuntu-Development-Setup.html). +This role installs ROS 2 development tools following [this page](https://docs.ros.org/en/humble/Installation/Ubuntu-Development-Setup.html). ## Inputs @@ -9,34 +9,22 @@ None. ## Manual Installation ```bash -# Taken from https://docs.ros.org/en/galactic/Installation/Ubuntu-Development-Setup.html +# Taken from https://docs.ros.org/en/humble/Installation/Ubuntu-Development-Setup.html sudo apt update && sudo apt install -y \ - build-essential \ - cmake \ - git \ - python3-colcon-common-extensions \ - python3-flake8 \ + python3-colcon-mixin \ + python3-flake8-docstrings \ python3-pip \ python3-pytest-cov \ - python3-rosdep \ - python3-setuptools \ - python3-vcstool \ - wget - -# Install some pip packages needed for testing -python3 -m pip install -U \ - flake8-blind-except \ - flake8-builtins \ - flake8-class-newline \ - flake8-comprehensions \ - flake8-deprecated \ - flake8-docstrings \ - flake8-import-order \ - flake8-quotes \ - pytest-repeat \ - pytest-rerunfailures \ - pytest \ - setuptools + ros-dev-tools \ + python3-flake8-blind-except \ + python3-flake8-builtins \ + python3-flake8-class-newline \ + python3-flake8-comprehensions \ + python3-flake8-deprecated \ + python3-flake8-import-order \ + python3-flake8-quotes \ + python3-pytest-repeat \ + python3-pytest-rerunfailures # Initialize rosdep sudo rosdep init diff --git a/ansible/roles/ros2_dev_tools/meta/main.yaml b/ansible/roles/ros2_dev_tools/meta/main.yaml index 81b20fe4831..e69de29bb2d 100644 --- a/ansible/roles/ros2_dev_tools/meta/main.yaml +++ b/ansible/roles/ros2_dev_tools/meta/main.yaml @@ -1,2 +0,0 @@ -dependencies: - - role: autoware.dev_env.ros2 diff --git a/ansible/roles/ros2_dev_tools/tasks/main.yaml b/ansible/roles/ros2_dev_tools/tasks/main.yaml index 8c02fe3b55a..e67381179d7 100644 --- a/ansible/roles/ros2_dev_tools/tasks/main.yaml +++ b/ansible/roles/ros2_dev_tools/tasks/main.yaml @@ -2,39 +2,23 @@ become: true ansible.builtin.apt: name: - - build-essential - - cmake - - git - - python3-colcon-common-extensions - python3-colcon-mixin - - python3-flake8 + - python3-flake8-docstrings - python3-pip - python3-pytest-cov - - python3-rosdep - - python3-setuptools - - python3-vcstool - - wget + - ros-dev-tools + - python3-flake8-blind-except + - python3-flake8-builtins + - python3-flake8-class-newline + - python3-flake8-comprehensions + - python3-flake8-deprecated + - python3-flake8-import-order + - python3-flake8-quotes + - python3-pytest-repeat + - python3-pytest-rerunfailures state: latest update_cache: true -- name: Install pip packages - ansible.builtin.pip: - name: - - flake8-blind-except - - flake8-builtins - - flake8-class-newline - - flake8-comprehensions - - flake8-deprecated - - flake8-docstrings - - flake8-import-order - - flake8-quotes - - pytest-repeat - - pytest-rerunfailures - - pytest - - setuptools - state: latest - executable: pip3 - - name: Run 'sudo rosdep init' become: true ansible.builtin.command: diff --git a/ansible/roles/telegraf/README.md b/ansible/roles/telegraf/README.md new file mode 100644 index 00000000000..5355384e72a --- /dev/null +++ b/ansible/roles/telegraf/README.md @@ -0,0 +1,27 @@ +# telegraf + +This role install [InfluxDB v2](https://docs.influxdata.com/influxdb/v2/get-started/) and [Telegraf](https://docs.influxdata.com/telegraf/v1/) to collect system metrics. + +After installing telegraf and influxdb2, we need to manually make an API token and copy it to the `/etc/telegraf/telegraf.conf`. + +## Create Organization + +When accessing the InfluxDB UI for the first time, you need to create an organization and a backet. Enter as follows. + +![](./files/create-org.png) + +## Generate API token + +Next, move to the `Load Data` tab, click the `GENERATE API TOKEN button`, and generate the API token. + + + +![](./files/load-data.png) + +![](./files/generate-api-token.png) + +## Copy API token and restart Telegraf + +Paste the obtained API token into the empty string part of `token = ""` in `/etc/telegraf/telegraf.conf`. + + diff --git a/ansible/roles/telegraf/defaults/main.yaml b/ansible/roles/telegraf/defaults/main.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ansible/roles/telegraf/files/create-org.png b/ansible/roles/telegraf/files/create-org.png new file mode 100644 index 00000000000..a286a54883c Binary files /dev/null and b/ansible/roles/telegraf/files/create-org.png differ diff --git a/ansible/roles/telegraf/files/generate-api-token.png b/ansible/roles/telegraf/files/generate-api-token.png new file mode 100644 index 00000000000..4b2bb26596d Binary files /dev/null and b/ansible/roles/telegraf/files/generate-api-token.png differ diff --git a/ansible/roles/telegraf/files/get_telegraf_proccpu_json.sh b/ansible/roles/telegraf/files/get_telegraf_proccpu_json.sh new file mode 100755 index 00000000000..bd70eef20c7 --- /dev/null +++ b/ansible/roles/telegraf/files/get_telegraf_proccpu_json.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +SAMPLING_SEC=5 + +echo "{" +pidstat -u -h -l "${SAMPLING_SEC}" 1 | + tail -n +4 | + awk '{ cpu=$8; $1=$2=$3=$4=$5=$6=$7=$8=$9=""; print cpu,$0 }' | + sort -n | + while read -r cpu cmd; do + if [[ ${cpu%%.*} -le 0 ]]; then + continue + fi + cmd="${cmd// /_}" + cmd="${cmd//=/_}" + cmd="${cmd:0:50}" + echo "\"${cmd}\":${cpu}," + done +echo '"z":0' +echo "}" diff --git a/ansible/roles/telegraf/files/get_telegraf_procmem_json.sh b/ansible/roles/telegraf/files/get_telegraf_procmem_json.sh new file mode 100755 index 00000000000..dd513aa3781 --- /dev/null +++ b/ansible/roles/telegraf/files/get_telegraf_procmem_json.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "{" +ps -ax --format "rss command" | + while read -r rss cmd; do + if [[ $rss -lt 30000 ]]; then + continue + fi + cmd="${cmd// /_}" + cmd="${cmd//=/_}" + cmd="${cmd:0:50}" + echo "\"${cmd}\":${rss}," + done +echo '"z":0' +echo "}" diff --git a/ansible/roles/telegraf/files/load-data.png b/ansible/roles/telegraf/files/load-data.png new file mode 100644 index 00000000000..7094a0378ce Binary files /dev/null and b/ansible/roles/telegraf/files/load-data.png differ diff --git a/ansible/roles/telegraf/files/telegraf.conf b/ansible/roles/telegraf/files/telegraf.conf new file mode 100644 index 00000000000..9593f3f10c1 --- /dev/null +++ b/ansible/roles/telegraf/files/telegraf.conf @@ -0,0 +1,60 @@ +[global_tags] + +[agent] + interval = "10s" + round_interval = true + metric_batch_size = 1000 + metric_buffer_limit = 10000 + collection_jitter = "0s" + flush_interval = "10s" + flush_jitter = "0s" + precision = "0s" + hostname = "" + omit_hostname = false + +[[outputs.influxdb_v2]] + urls = ["http://127.0.0.1:8086"] + # Attach the access token. See also https://docs.influxdata.com/influxdb/cloud/admin/tokens/create-token/#manage-tokens-in-the-influxdb-ui + token = "" + organization = "autowarefoundation" + bucket = "autoware" + timeout = "5s" + user_agent = "telegraf" + +[[inputs.cpu]] + percpu = true + totalcpu = true + collect_cpu_time = false + report_active = false + core_tags = false + +[[inputs.disk]] + ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"] + +[[inputs.diskio]] + +[[inputs.kernel]] + +[[inputs.mem]] + +[[inputs.processes]] + +[[inputs.swap]] + +[[inputs.system]] + +[[inputs.exec]] + commands = ["/opt/autoware/bin/get_telegraf_proccpu_json.sh"] + timeout = "10s" + data_format = "json" + name_suffix = "_proccpu" + +[[inputs.exec]] + commands = ["/opt/autoware/bin/get_telegraf_procmem_json.sh"] + timeout = "5s" + data_format = "json" + name_suffix = "_procmem" + +[[inputs.net]] + +[[inputs.nvidia_smi]] diff --git a/ansible/roles/telegraf/handlers/main.yaml b/ansible/roles/telegraf/handlers/main.yaml new file mode 100644 index 00000000000..854c7d99027 --- /dev/null +++ b/ansible/roles/telegraf/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: Restart telegraf + ansible.builtin.systemd: + name: telegraf + state: restarted diff --git a/ansible/roles/telegraf/meta/main.yaml b/ansible/roles/telegraf/meta/main.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ansible/roles/telegraf/tasks/main.yaml b/ansible/roles/telegraf/tasks/main.yaml new file mode 100644 index 00000000000..e6cc9a3170e --- /dev/null +++ b/ansible/roles/telegraf/tasks/main.yaml @@ -0,0 +1,136 @@ +- name: Download influxdata-archive_compat.key + become: true + ansible.builtin.get_url: + url: https://repos.influxdata.com/influxdata-archive_compat.key + dest: /tmp/influxdata-archive_compat.key + mode: 0755 + +- name: Verify the checksum of the key file + ansible.builtin.command: sha256sum -c + args: + chdir: /tmp + stdin: 393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key + register: checksum_result + failed_when: checksum_result.rc != 0 + changed_when: false + +- name: Check if GPG key is already converted + ansible.builtin.stat: + path: /tmp/influxdata-archive_compat.gpg + register: gpg_key_stat + +- name: Convert the key to gpg format + ansible.builtin.command: + cmd: gpg --dearmor -o /tmp/influxdata-archive_compat.gpg /tmp/influxdata-archive_compat.key + become: true + when: not gpg_key_stat.stat.exists + changed_when: false + +- name: Check if GPG key is already moved + ansible.builtin.stat: + path: /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg + register: moved_key_stat + +- name: Move the gpg key to trusted.gpg.d + ansible.builtin.command: + cmd: mv /tmp/influxdata-archive_compat.gpg /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg + become: true + when: not moved_key_stat.stat.exists + changed_when: false + +- name: Add InfluxData repository + become: true + ansible.builtin.apt_repository: + repo: deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main + state: present + filename: influxdata.list + +- name: Update apt cache + become: true + ansible.builtin.apt: + update_cache: true + cache_valid_time: 3600 + +- name: Install InfluxDB v2 + become: true + ansible.builtin.apt: + name: influxdb2 + state: present + +- name: Install InfluxDB v2 CLI + become: true + ansible.builtin.apt: + name: influxdb2-cli + state: present + +- name: Install Telegraf + become: true + ansible.builtin.apt: + name: telegraf + state: present + +- name: Create telegraf_binary directory + ansible.builtin.file: + path: /opt/autoware/bin + state: directory + mode: 0755 + become: true + +- name: Copy get_telegraf_proccpu_json.sh to /opt/autoware/bin + become: true + ansible.builtin.copy: + src: "{{ role_path }}/files/get_telegraf_proccpu_json.sh" + dest: /opt/autoware/bin/get_telegraf_proccpu_json.sh + owner: root + group: root + mode: 0755 + +- name: Copy get_telegraf_procmem_json.sh to /opt/autoware/bin + become: true + ansible.builtin.copy: + src: "{{ role_path }}/files/get_telegraf_procmem_json.sh" + dest: /opt/autoware/bin/get_telegraf_procmem_json.sh + owner: root + group: root + mode: 0755 + +- name: Copy telegraf.conf to /opt/autoware/bin + become: true + ansible.builtin.copy: + src: "{{ role_path }}/files/telegraf.conf" + dest: /etc/telegraf/telegraf.conf + owner: root + group: root + mode: 0644 + backup: true + notify: + - Restart telegraf + +- name: Ensure telegraf is running and enabled + become: true + ansible.builtin.systemd: + name: telegraf + enabled: true + state: started + +- name: Ensure InfluxDB service is running + become: true + ansible.builtin.service: + name: influxdb + state: started + enabled: true + +- name: Check if InfluxDB is already set up + become: true + ansible.builtin.command: + cmd: influx setup --bucket-status + register: influx_setup_status + ignore_errors: true + changed_when: false + +- name: Set up influxDB v2 + become: true + ansible.builtin.command: + cmd: influx setup -f --name default --username autoware --password autoware --token autowaretoken --org autowarefoundation --bucket autoware --retention 0 + when: influx_setup_status.rc != 0 + changed_when: false diff --git a/ansible/roles/tensorrt/README.md b/ansible/roles/tensorrt/README.md index 16f8dd2db21..2a6c7d39232 100644 --- a/ansible/roles/tensorrt/README.md +++ b/ansible/roles/tensorrt/README.md @@ -1,6 +1,6 @@ # tensorrt -This role installs TensorRT and cuDNN following [this page](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing). +This role installs TensorRT and cuDNN following [the official NVIDIA TensorRT Installation Guide](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing). ## Inputs @@ -11,17 +11,35 @@ This role installs TensorRT and cuDNN following [this page](https://docs.nvidia. ## Manual Installation -For Universe, the `cudnn_version` and `tensorrt_version` variable can also be found in: -[../../playbooks/universe.yaml](../../playbooks/universe.yaml) - ```bash -# Taken from: https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing - -cudnn_version="8.2.4.15-1+cuda11.4" -sudo apt-get install libcudnn8=${cudnn_version} libcudnn8-dev=${cudnn_version} -sudo apt-mark hold libcudnn8 libcudnn8-dev - -tensorrt_version="8.2.4-1+cuda11.4" -sudo apt-get install libnvinfer8=${tensorrt_version} libnvonnxparsers8=${tensorrt_version} libnvparsers8=${tensorrt_version} libnvinfer-plugin8=${tensorrt_version} libnvinfer-dev=${tensorrt_version} libnvonnxparsers-dev=${tensorrt_version} libnvparsers-dev=${tensorrt_version} libnvinfer-plugin-dev=${tensorrt_version} -sudo apt-mark hold libnvinfer8 libnvonnxparsers8 libnvparsers8 libnvinfer-plugin8 libnvinfer-dev libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev +# For the environment variables +wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env + +sudo apt-get install -y \ +libcudnn8=${cudnn_version} \ +libnvinfer8=${tensorrt_version} \ +libnvinfer-plugin8=${tensorrt_version} \ +libnvparsers8=${tensorrt_version} \ +libnvonnxparsers8=${tensorrt_version} \ +libcudnn8-dev=${cudnn_version} \ +libnvinfer-dev=${tensorrt_version} \ +libnvinfer-plugin-dev=${tensorrt_version} \ +libnvinfer-headers-dev=${tensorrt_version} \ +libnvinfer-headers-plugin-dev=${tensorrt_version} \ +libnvparsers-dev=${tensorrt_version} \ +libnvonnxparsers-dev=${tensorrt_version} + +sudo apt-mark hold \ +libcudnn8 \ +libnvinfer8 \ +libnvinfer-plugin8 \ +libnvparsers8 \ +libnvonnxparsers8 \ +libcudnn8-dev \ +libnvinfer-dev \ +libnvinfer-plugin-dev \ +libnvparsers-dev \ +libnvonnxparsers-dev \ +libnvinfer-headers-dev \ +libnvinfer-headers-plugin-dev ``` diff --git a/ansible/roles/tensorrt/tasks/main.yaml b/ansible/roles/tensorrt/tasks/main.yaml index 898425f2c48..816ba7dad4b 100644 --- a/ansible/roles/tensorrt/tasks/main.yaml +++ b/ansible/roles/tensorrt/tasks/main.yaml @@ -3,18 +3,29 @@ ansible.builtin.apt: name: - libcudnn8={{ cudnn_version }} - - libcudnn8-dev={{ cudnn_version }} - libnvinfer8={{ tensorrt_version }} - libnvinfer-plugin8={{ tensorrt_version }} - libnvparsers8={{ tensorrt_version }} - libnvonnxparsers8={{ tensorrt_version }} + allow_change_held_packages: true + allow_downgrade: true + update_cache: true + +- name: Install cuDNN and TensorRT Dev + become: true + ansible.builtin.apt: + name: + - libcudnn8-dev={{ cudnn_version }} - libnvinfer-dev={{ tensorrt_version }} - libnvinfer-plugin-dev={{ tensorrt_version }} + - libnvinfer-headers-dev={{ tensorrt_version }} + - libnvinfer-headers-plugin-dev={{ tensorrt_version }} - libnvparsers-dev={{ tensorrt_version }} - libnvonnxparsers-dev={{ tensorrt_version }} allow_change_held_packages: true allow_downgrade: true update_cache: true + when: install_devel == 'y' # apt-mark hold - name: Prevent CUDA-related packages from upgrading @@ -24,12 +35,22 @@ selection: hold with_items: - libcudnn8 - - libcudnn8-dev - libnvinfer8 - libnvinfer-plugin8 - libnvparsers8 - libnvonnxparsers8 + +- name: Prevent CUDA-related Dev packages from upgrading + become: true + ansible.builtin.dpkg_selections: + name: "{{ item }}" + selection: hold + with_items: + - libcudnn8-dev - libnvinfer-dev - libnvinfer-plugin-dev + - libnvinfer-headers-dev + - libnvinfer-headers-plugin-dev - libnvparsers-dev - libnvonnxparsers-dev + when: install_devel == 'y' diff --git a/arm64.env b/arm64.env index f9aba790b05..efd9db194da 100644 --- a/arm64.env +++ b/arm64.env @@ -1 +1,3 @@ # Override amd64's settings +cudnn_version=8.9.6.50-1+cuda12.2 +tensorrt_version=8.6.2.2-1+cuda12.0 diff --git a/autoware-nightly.repos b/autoware-nightly.repos new file mode 100644 index 00000000000..49da4fee814 --- /dev/null +++ b/autoware-nightly.repos @@ -0,0 +1,41 @@ +repositories: + core/autoware_adapi_msgs: + type: git + url: https://github.com/autowarefoundation/autoware_adapi_msgs.git + version: main + core/autoware.core: + type: git + url: https://github.com/autowarefoundation/autoware.core.git + version: main + universe/autoware.universe: + type: git + url: https://github.com/autowarefoundation/autoware.universe.git + version: main + launcher/autoware_launch: + type: git + url: https://github.com/autowarefoundation/autoware_launch.git + version: main + sensor_kit/sample_sensor_kit_launch: + type: git + url: https://github.com/autowarefoundation/sample_sensor_kit_launch.git + version: main + sensor_kit/external/awsim_sensor_kit_launch: # TODO: Integrate into sample_sensor_kit_launch + type: git + url: https://github.com/tier4/awsim_sensor_kit_launch.git + version: main + sensor_kit/awsim_labs_sensor_kit_launch: + type: git + url: https://github.com/autowarefoundation/awsim_labs_sensor_kit_launch.git + version: main + sensor_kit/single_lidar_sensor_kit_launch: + type: git + url: https://github.com/autowarefoundation/single_lidar_sensor_kit_launch.git + version: main + vehicle/sample_vehicle_launch: + type: git + url: https://github.com/autowarefoundation/sample_vehicle_launch.git + version: main + vehicle/awsim_labs_vehicle_launch: + type: git + url: https://github.com/autowarefoundation/awsim_labs_vehicle_launch.git + version: main diff --git a/autoware.repos b/autoware.repos index cb81fc43927..3d75d5cfcd4 100644 --- a/autoware.repos +++ b/autoware.repos @@ -3,25 +3,38 @@ repositories: core/autoware_msgs: type: git url: https://github.com/autowarefoundation/autoware_msgs.git - version: main - core/autoware_common: + version: 1.3.0 + # TODO (isamu-takagi): Use a released version when autoware.universe uses a released version. + core/autoware_adapi_msgs: type: git - url: https://github.com/autowarefoundation/autoware_common.git - version: main + url: https://github.com/autowarefoundation/autoware_adapi_msgs.git + version: beta/1.7.0 + core/autoware_internal_msgs: + type: git + url: https://github.com/autowarefoundation/autoware_internal_msgs.git + version: 1.2.0 + core/autoware_cmake: + type: git + url: https://github.com/autowarefoundation/autoware_cmake.git + version: 1.0.0 + core/autoware_utils: + type: git + url: https://github.com/autowarefoundation/autoware_utils.git + version: 1.0.0 + core/autoware_lanelet2_extension: + type: git + url: https://github.com/autowarefoundation/autoware_lanelet2_extension.git + version: 0.6.2 core/autoware.core: type: git url: https://github.com/autowarefoundation/autoware.core.git - version: main - core/external/autoware_auto_msgs: # TODO(mfc): Remove when autoware_msgs is merged - type: git - url: https://github.com/tier4/autoware_auto_msgs.git - version: tier4/main + version: 0.0.0 # universe universe/autoware.universe: type: git url: https://github.com/autowarefoundation/autoware.universe.git - version: main - universe/external/tier4_ad_api_adaptor: # TODO(TIER IV): Improve design/code and transfer to AWF + version: 0.39.0 + universe/external/tier4_ad_api_adaptor: # TODO(TIER IV): Migrate to AD API and remove this repository entry. type: git url: https://github.com/tier4/tier4_ad_api_adaptor.git version: tier4/universe @@ -29,31 +42,40 @@ repositories: type: git url: https://github.com/tier4/tier4_autoware_msgs.git version: tier4/universe - universe/external/grid_map: - type: git - url: https://github.com/ANYbotics/grid_map.git - version: ba2f9cb6e62f7ee9c5bac7401391a211e442e459 + # Fix the version not to merge https://github.com/MORAI-Autonomous/MORAI-ROS2_morai_msgs/pull/9 universe/external/morai_msgs: type: git url: https://github.com/MORAI-Autonomous/MORAI-ROS2_morai_msgs.git - version: main + version: e2e75fc1603a9798773e467a679edf68b448e705 universe/external/muSSP: type: git url: https://github.com/tier4/muSSP.git version: tier4/main - universe/external/ndt_omp: - type: git - url: https://github.com/tier4/ndt_omp.git - version: tier4/main universe/external/pointcloud_to_laserscan: type: git url: https://github.com/tier4/pointcloud_to_laserscan.git version: tier4/main + universe/external/eagleye: + type: git + url: https://github.com/MapIV/eagleye.git + version: autoware-main + universe/external/rtklib_ros_bridge: + type: git + url: https://github.com/MapIV/rtklib_ros_bridge.git + version: ros2-v0.1.0 + universe/external/llh_converter: + type: git + url: https://github.com/MapIV/llh_converter.git + version: ros2 + universe/external/glog: # TODO(Horibe): to use isGoogleInitialized() API in v0.6.0. Remove when the rosdep glog version is updated to v0.6.0 (already updated in Ubuntu 24.04) + type: git + url: https://github.com/tier4/glog.git + version: v0.6.0_t4-ros # launcher launcher/autoware_launch: type: git url: https://github.com/autowarefoundation/autoware_launch.git - version: main + version: 0.39.0 # sensor_component sensor_component/external/sensor_component_description: type: git @@ -63,20 +85,46 @@ repositories: type: git url: https://github.com/tier4/tamagawa_imu_driver.git version: ros2 - sensor_component/external/velodyne_vls: + sensor_component/external/nebula: type: git - url: https://github.com/tier4/velodyne_vls.git - version: tier4/universe + url: https://github.com/tier4/nebula.git + version: v0.2.1 + # Fork of transport_drivers that enables reduction of copy operations + sensor_component/transport_drivers: + type: git + url: https://github.com/autowarefoundation/transport_drivers + version: main + # Continental compatible version of ROS 2 socket CAN + sensor_component/ros2_socketcan: + type: git + url: https://github.com/autowarefoundation/ros2_socketcan + version: main # sensor_kit sensor_kit/sample_sensor_kit_launch: type: git url: https://github.com/autowarefoundation/sample_sensor_kit_launch.git + version: 0.39.0 + sensor_kit/external/awsim_sensor_kit_launch: # TODO: Integrate into sample_sensor_kit_launch + type: git + url: https://github.com/tier4/awsim_sensor_kit_launch.git + version: 0.39.0 + sensor_kit/awsim_labs_sensor_kit_launch: + type: git + url: https://github.com/autowarefoundation/awsim_labs_sensor_kit_launch.git + version: main + sensor_kit/single_lidar_sensor_kit_launch: + type: git + url: https://github.com/autowarefoundation/single_lidar_sensor_kit_launch.git version: main # vehicle vehicle/sample_vehicle_launch: type: git url: https://github.com/autowarefoundation/sample_vehicle_launch.git version: main + vehicle/awsim_labs_vehicle_launch: + type: git + url: https://github.com/autowarefoundation/awsim_labs_vehicle_launch.git + version: main vehicle/external/pacmod_interface: type: git url: https://github.com/tier4/pacmod_interface.git diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000000..8857e43bc9e --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,543 @@ +ARG BASE_IMAGE +ARG AUTOWARE_BASE_IMAGE +ARG AUTOWARE_BASE_CUDA_IMAGE + +# hadolint ignore=DL3006 +FROM $BASE_IMAGE AS rosdep-depend +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +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/resolve_rosdep_keys.sh /autoware/resolve_rosdep_keys.sh +RUN chmod +x /autoware/resolve_rosdep_keys.sh +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 \ + ./setup-dev-env.sh -y rosdep \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh + +# Generate install package lists +COPY src/core /autoware/src/core +RUN rosdep update && /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-core-depend-packages.txt \ + && cat /rosdep-core-depend-packages.txt + +COPY src/universe/external /autoware/src/universe/external +COPY src/universe/autoware.universe/common /autoware/src/universe/autoware.universe/common +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-common-depend-packages.txt \ + && cat /rosdep-universe-common-depend-packages.txt + +FROM rosdep-depend AS rosdep-universe-sensing-perception-depend +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +COPY src/universe/autoware.universe/perception /autoware/src/universe/autoware.universe/perception +COPY src/universe/autoware.universe/sensing /autoware/src/universe/autoware.universe/sensing +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-sensing-perception-depend-packages.txt \ + && cat /rosdep-universe-sensing-perception-depend-packages.txt +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-sensing-perception-exec-depend-packages.txt \ + && cat /rosdep-universe-sensing-perception-exec-depend-packages.txt + +FROM rosdep-depend AS rosdep-universe-localization-mapping-depend +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +COPY src/universe/autoware.universe/localization /autoware/src/universe/autoware.universe/localization +COPY src/universe/autoware.universe/map /autoware/src/universe/autoware.universe/map +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-localization-mapping-depend-packages.txt \ + && cat /rosdep-universe-localization-mapping-depend-packages.txt +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-localization-mapping-exec-depend-packages.txt \ + && cat /rosdep-universe-localization-mapping-exec-depend-packages.txt + +FROM rosdep-depend AS rosdep-universe-planning-control-depend +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +COPY src/universe/autoware.universe/control /autoware/src/universe/autoware.universe/control +COPY src/universe/autoware.universe/planning /autoware/src/universe/autoware.universe/planning +# TODO(youtalk): Remove COPYs when https://github.com/autowarefoundation/autoware.universe/issues/8805 is resolved +COPY src/universe/autoware.universe/map/autoware_map_loader /autoware/src/universe/autoware.universe/map/autoware_map_loader +COPY src/universe/autoware.universe/map/autoware_map_projection_loader /autoware/src/universe/autoware.universe/map/autoware_map_projection_loader +COPY src/universe/autoware.universe/sensing/autoware_pcl_extensions /autoware/src/universe/autoware.universe/sensing/autoware_pcl_extensions +COPY src/universe/autoware.universe/sensing/autoware_pointcloud_preprocessor /autoware/src/universe/autoware.universe/sensing/autoware_pointcloud_preprocessor +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-planning-control-depend-packages.txt \ + && cat /rosdep-universe-planning-control-depend-packages.txt +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-planning-control-exec-depend-packages.txt \ + && cat /rosdep-universe-planning-control-exec-depend-packages.txt + +FROM rosdep-depend AS rosdep-universe-vehicle-system-depend +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +COPY src/universe/autoware.universe/vehicle /autoware/src/universe/autoware.universe/vehicle +COPY src/universe/autoware.universe/system /autoware/src/universe/autoware.universe/system +COPY src/universe/autoware.universe/map/autoware_map_height_fitter /autoware/src/universe/autoware.universe/map/autoware_map_height_fitter +COPY src/universe/autoware.universe/localization/autoware_pose2twist /autoware/src/universe/autoware.universe/localization/autoware_pose2twist +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-vehicle-system-depend-packages.txt \ + && cat /rosdep-universe-vehicle-system-depend-packages.txt +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-vehicle-system-exec-depend-packages.txt \ + && cat /rosdep-universe-vehicle-system-exec-depend-packages.txt + +FROM rosdep-depend AS rosdep-universe-depend +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +COPY src/launcher /autoware/src/launcher +COPY src/param /autoware/src/param +COPY src/sensor_component /autoware/src/sensor_component +COPY src/sensor_kit /autoware/src/sensor_kit +COPY src/universe /autoware/src/universe +COPY src/vehicle /autoware/src/vehicle +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-universe-depend-packages.txt \ + && cat /rosdep-universe-depend-packages.txt + +RUN /autoware/resolve_rosdep_keys.sh /autoware/src ${ROS_DISTRO} \ + > /rosdep-exec-depend-packages.txt \ + && cat /rosdep-exec-depend-packages.txt + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS core-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +COPY docker/scripts/build_and_clean.sh /autoware/build_and_clean.sh +RUN chmod +x /autoware/build_and_clean.sh + +# Set up development environment and tools +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers openadkit \ + && ./setup-dev-env.sh -y --module dev-tools openadkit \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh + +# Install rosdep dependencies +COPY --from=rosdep-depend /rosdep-core-depend-packages.txt /tmp/rosdep-core-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-core-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-depend,source=/autoware/src/core,target=/autoware/src/core \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM core-devel AS universe-common-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-depend /rosdep-universe-common-depend-packages.txt /tmp/rosdep-universe-common-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-common-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-depend,source=/autoware/src/universe/autoware.universe/common,target=/autoware/src/universe/autoware.universe/common \ + --mount=type=bind,from=rosdep-depend,source=/autoware/src/universe/external,target=/autoware/src/universe/external \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel AS universe-common-devel-cuda +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Set up CUDA development environment +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + ./setup-dev-env.sh -y --module all --no-cuda-drivers openadkit \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh true + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel AS universe-sensing-perception-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-universe-sensing-perception-depend /rosdep-universe-sensing-perception-depend-packages.txt /tmp/rosdep-universe-sensing-perception-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-sensing-perception-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception,target=/autoware/src/universe/autoware.universe/perception \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/sensing,target=/autoware/src/universe/autoware.universe/sensing \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel-cuda AS universe-sensing-perception-devel-cuda +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-universe-sensing-perception-depend /rosdep-universe-sensing-perception-depend-packages.txt /tmp/rosdep-universe-sensing-perception-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-sensing-perception-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +COPY --from=universe-sensing-perception-devel /opt/autoware /opt/autoware + +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception,target=/autoware/src/universe/autoware.universe/perception \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/sensing,target=/autoware/src/universe/autoware.universe/sensing \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware "--packages-above-and-dependencies autoware_tensorrt_common" + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel AS universe-localization-mapping-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-universe-localization-mapping-depend /rosdep-universe-localization-mapping-depend-packages.txt /tmp/rosdep-universe-localization-mapping-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-localization-mapping-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-universe-localization-mapping-depend,source=/autoware/src/universe/autoware.universe/localization,target=/autoware/src/universe/autoware.universe/localization \ + --mount=type=bind,from=rosdep-universe-localization-mapping-depend,source=/autoware/src/universe/autoware.universe/map,target=/autoware/src/universe/autoware.universe/map \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +FROM universe-common-devel AS universe-planning-control-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-universe-planning-control-depend /rosdep-universe-planning-control-depend-packages.txt /tmp/rosdep-universe-planning-control-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-planning-control-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-universe-planning-control-depend,source=/autoware/src/universe/autoware.universe/control,target=/autoware/src/universe/autoware.universe/control \ + --mount=type=bind,from=rosdep-universe-planning-control-depend,source=/autoware/src/universe/autoware.universe/planning,target=/autoware/src/universe/autoware.universe/planning \ + # TODO(youtalk): Remove --mount options when https://github.com/autowarefoundation/autoware.universe/issues/8805 is resolved + --mount=type=bind,from=rosdep-universe-planning-control-depend,source=/autoware/src/universe/autoware.universe/map/autoware_map_loader,target=/autoware/src/universe/autoware.universe/map/autoware_map_loader \ + --mount=type=bind,from=rosdep-universe-planning-control-depend,source=/autoware/src/universe/autoware.universe/map/autoware_map_projection_loader,target=/autoware/src/universe/autoware.universe/map/autoware_map_projection_loader \ + --mount=type=bind,from=rosdep-universe-planning-control-depend,source=/autoware/src/universe/autoware.universe/sensing/autoware_pcl_extensions,target=/autoware/src/universe/autoware.universe/sensing/autoware_pcl_extensions \ + --mount=type=bind,from=rosdep-universe-planning-control-depend,source=/autoware/src/universe/autoware.universe/sensing/autoware_pointcloud_preprocessor,target=/autoware/src/universe/autoware.universe/sensing/autoware_pointcloud_preprocessor \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel AS universe-vehicle-system-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-universe-vehicle-system-depend /rosdep-universe-vehicle-system-depend-packages.txt /tmp/rosdep-universe-vehicle-system-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-vehicle-system-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-universe-vehicle-system-depend,source=/autoware/src/universe/autoware.universe/vehicle,target=/autoware/src/universe/autoware.universe/vehicle \ + --mount=type=bind,from=rosdep-universe-vehicle-system-depend,source=/autoware/src/universe/autoware.universe/system,target=/autoware/src/universe/autoware.universe/system \ + --mount=type=bind,from=rosdep-universe-vehicle-system-depend,source=/autoware/src/universe/autoware.universe/map/autoware_map_height_fitter,target=/autoware/src/universe/autoware.universe/map/autoware_map_height_fitter \ + --mount=type=bind,from=rosdep-universe-vehicle-system-depend,source=/autoware/src/universe/autoware.universe/localization/autoware_pose2twist,target=/autoware/src/universe/autoware.universe/localization/autoware_pose2twist \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel AS universe-devel +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ENV CCACHE_DIR="/root/.ccache" + +# Install rosdep dependencies +COPY --from=rosdep-universe-depend /rosdep-universe-depend-packages.txt /tmp/rosdep-universe-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +COPY --from=universe-sensing-perception-devel /opt/autoware /opt/autoware +COPY --from=universe-localization-mapping-devel /opt/autoware /opt/autoware +COPY --from=universe-planning-control-devel /opt/autoware /opt/autoware +COPY --from=universe-vehicle-system-devel /opt/autoware /opt/autoware +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=${CCACHE_DIR} \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/launcher,target=/autoware/src/launcher \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/param,target=/autoware/src/param \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/sensor_component,target=/autoware/src/sensor_component \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/sensor_kit,target=/autoware/src/sensor_kit \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/universe/autoware.universe/evaluator,target=/autoware/src/universe/autoware.universe/evaluator \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/universe/autoware.universe/launch,target=/autoware/src/universe/autoware.universe/launch \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/universe/autoware.universe/simulator,target=/autoware/src/universe/autoware.universe/simulator \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/universe/autoware.universe/tools,target=/autoware/src/universe/autoware.universe/tools \ + --mount=type=bind,from=rosdep-universe-depend,source=/autoware/src/vehicle,target=/autoware/src/vehicle \ + source /opt/ros/"$ROS_DISTRO"/setup.bash \ + && source /opt/autoware/setup.bash \ + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +FROM universe-common-devel-cuda AS universe-devel-cuda +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Install rosdep dependencies +COPY --from=rosdep-universe-depend /rosdep-universe-depend-packages.txt /tmp/rosdep-universe-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update \ + && cat /tmp/rosdep-universe-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_apt.sh + +COPY --from=universe-sensing-perception-devel-cuda /opt/autoware /opt/autoware +COPY --from=universe-devel /opt/autoware /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-sensing-perception +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ARG LIB_DIR + +# Set up runtime environment +COPY --from=rosdep-universe-sensing-perception-depend /rosdep-universe-sensing-perception-exec-depend-packages.txt /tmp/rosdep-universe-sensing-perception-exec-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && apt-get update \ + && cat /tmp/rosdep-universe-sensing-perception-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-sensing-perception-devel /opt/autoware /opt/autoware + +# Copy bash aliases +COPY docker/etc/.bash_aliases /root/.bash_aliases +RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# 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 + +# Set up runtime environment +COPY --from=rosdep-universe-sensing-perception-depend /rosdep-universe-sensing-perception-exec-depend-packages.txt /tmp/rosdep-universe-sensing-perception-exec-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && apt-get update \ + && cat /tmp/rosdep-universe-sensing-perception-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-sensing-perception-devel-cuda /opt/autoware /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-localization-mapping +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ARG LIB_DIR + +# Set up runtime environment +COPY --from=rosdep-universe-localization-mapping-depend /rosdep-universe-localization-mapping-exec-depend-packages.txt /tmp/rosdep-universe-localization-mapping-exec-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && apt-get update \ + && cat /tmp/rosdep-universe-localization-mapping-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-localization-mapping-devel /opt/autoware /opt/autoware + +# Copy bash aliases +COPY docker/etc/.bash_aliases /root/.bash_aliases +RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-planning-control +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ARG LIB_DIR + +# Set up runtime environment +COPY --from=rosdep-universe-planning-control-depend /rosdep-universe-planning-control-exec-depend-packages.txt /tmp/rosdep-universe-planning-control-exec-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && apt-get update \ + && cat /tmp/rosdep-universe-planning-control-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-planning-control-devel /opt/autoware /opt/autoware + +# Copy bash aliases +COPY docker/etc/.bash_aliases /root/.bash_aliases +RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe-vehicle-system +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ARG LIB_DIR + +# Set up runtime environment +COPY --from=rosdep-universe-vehicle-system-depend /rosdep-universe-vehicle-system-exec-depend-packages.txt /tmp/rosdep-universe-vehicle-system-exec-depend-packages.txt +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module all --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && apt-get update \ + && cat /tmp/rosdep-universe-vehicle-system-exec-depend-packages.txt | xargs apt-get install -y --no-install-recommends \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-vehicle-system-devel /opt/autoware /opt/autoware + +# Copy bash aliases +COPY docker/etc/.bash_aliases /root/.bash_aliases +RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_IMAGE AS universe +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ARG LIB_DIR + +# Set up runtime environment +COPY --from=rosdep-universe-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 \ + ./setup-dev-env.sh -y --module all --no-nvidia --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 \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-devel /opt/autoware /opt/autoware + +# Copy bash aliases +COPY docker/etc/.bash_aliases /root/.bash_aliases +RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] + +# hadolint ignore=DL3006 +FROM $AUTOWARE_BASE_CUDA_IMAGE AS universe-cuda +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO +ARG LIB_DIR + +# Set up runtime environment +COPY --from=rosdep-universe-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 \ + ./setup-dev-env.sh -y --module all --no-nvidia --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 \ + && /autoware/cleanup_system.sh $LIB_DIR $ROS_DISTRO + +COPY --from=universe-devel-cuda /opt/autoware /opt/autoware + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base new file mode 100644 index 00000000000..516870c7bb5 --- /dev/null +++ b/docker/Dockerfile.base @@ -0,0 +1,49 @@ +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 diff --git a/docker/Dockerfile.svg b/docker/Dockerfile.svg new file mode 100644 index 00000000000..a9465e1a552 --- /dev/null +++ b/docker/Dockerfile.svg @@ -0,0 +1,692 @@ + + + + + + + G + + + cluster_legend + + + + + key + FROM ... + COPY --from=...  + RUN --mount=(.*)from=...  + + + + key2 + + + + + + + key:e->key2:w + + + + + + key:e->key2:w + + + + + + key:e->key2:w + + + + + + external_image_0 + + $BASE_IMAGE + + + + stage_0 + + base + + + + external_image_0->stage_0 + + + + + + stage_2 + + rosdep-depend + + + + external_image_0->stage_2 + + + + + + stage_1 + + base-cuda + + + + stage_0->stage_1 + + + + + + stage_8 + + core-devel + + + + stage_0->stage_8 + + + + + + stage_18 + + universe-sensing-perception + + + + stage_0->stage_18 + + + + + + + stage_20 + + universe-localization-mapping + + + + stage_0->stage_20 + + + + + stage_21 + + universe-planning-control + + + + stage_0->stage_21 + + + + + + stage_22 + + universe-vehicle-system + + + + stage_0->stage_22 + + + + + + stage_23 + + universe + + + + stage_0->stage_23 + + + + + + + stage_2->stage_8 + + + + + + stage_3 + + rosdep-universe-sensing-perception-depend + + + + stage_2->stage_3 + + + + + + stage_4 + + rosdep-universe-localization-mapping-depend + + + + stage_2->stage_4 + + + + + + stage_5 + + rosdep-universe-planning-control-depend + + + + stage_2->stage_5 + + + + + + stage_6 + + rosdep-universe-vehicle-system-depend + + + + stage_2->stage_6 + + + + + + stage_7 + + rosdep-universe-depend + + + + stage_2->stage_7 + + + + + + + stage_9 + + universe-common-devel + + + + stage_2->stage_9 + + + + + + stage_19 + + universe-sensing-perception-cuda + + + + stage_1->stage_19 + + + + + + stage_24 + + universe-cuda + + + + stage_1->stage_24 + + + + + + stage_8->stage_9 + + + + + + stage_3->stage_18 + + + + + + stage_3->stage_19 + + + + + + stage_11 + + universe-sensing-perception-devel + + + + stage_3->stage_11 + + + + + + stage_12 + + universe-sensing-perception-devel-cuda + + + + stage_3->stage_12 + + + + + + + stage_4->stage_20 + + + + + + + stage_13 + + universe-localization-mapping-devel + + + + stage_4->stage_13 + + + + + + stage_5->stage_21 + + + + + + stage_14 + + universe-planning-control-devel + + + + stage_5->stage_14 + + + + + + stage_6->stage_22 + + + + + + + stage_15 + + universe-vehicle-system-devel + + + + stage_6->stage_15 + + + + + + stage_7->stage_23 + + + + + + stage_7->stage_24 + + + + + + + stage_16 + + universe-devel + + + + stage_7->stage_16 + + + + + + stage_17 + + universe-devel-cuda + + + + stage_7->stage_17 + + + + + + stage_9->stage_11 + + + + + + stage_9->stage_13 + + + + + + stage_9->stage_14 + + + + + + stage_9->stage_15 + + + + + + stage_9->stage_16 + + + + + + stage_10 + + universe-common-devel-cuda + + + + stage_9->stage_10 + + + + + + stage_11->stage_18 + + + + + + stage_11->stage_12 + + + + + + stage_11->stage_16 + + + + + + stage_12->stage_19 + + + + + + stage_12->stage_17 + + + + + + stage_13->stage_20 + + + + + + stage_13->stage_16 + + + + + + stage_14->stage_21 + + + + + + stage_14->stage_16 + + + + + + stage_15->stage_22 + + + + + + stage_15->stage_16 + + + + + + stage_16->stage_23 + + + + + + stage_16->stage_17 + + + + + + stage_17->stage_24 + + + + + + stage_10->stage_12 + + + + + + stage_10->stage_17 + + + + + diff --git a/docker/README.md b/docker/README.md index f9186843b22..2dc13c925bf 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,164 +1,172 @@ -# Docker images for Autoware +# Open AD Kit: containerized workloads for Autoware -We have two types of Docker image: `development` and `prebuilt`. +[Open AD Kit](https://autoware.org/open-ad-kit/) offers containers for Autoware to simplify the development and deployment of Autoware and its dependencies. This directory contains scripts to build and run the containers. -1. The `development` image enables you to develop Autoware without setting up the local development environment. -2. The `prebuilt` image contains executables and enables you to try out Autoware quickly. - - Note that the prebuilt image is not designed for deployment on a real vehicle! +Detailed instructions on how to use the containers can be found in the [Open AD Kit documentation](https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/docker-installation/). -**Note**: Before proceeding, confirm and agree with the [NVIDIA Deep Learning Container license](https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license). By pulling and using the Autoware Universe images, you accept the terms and conditions of the license. +## Development containers -## Prerequisites +When using Open AD Kit as a development container, it is easy to use Autoware's all-in-one development container image, `ghcr.io/autowarefoundation/autoware:universe-devel-cuda`. +If you do not need the CUDA drivers, you can also use the smaller image `ghcr.io/autowarefoundation/autoware:universe-devel`. -- [Docker](https://docs.docker.com/engine/install/ubuntu/) -- [rocker](https://github.com/osrf/rocker) - - We use `rocker` to enable GUI applications such as `rviz` and `rqt` on Docker Containers. - - Refer to [here](http://wiki.ros.org/docker/Tutorials/GUI) for more details. +```shell +$ git clone git@github.com:autowarefoundation/autoware.git +$ cd autoware +$ vcs import src < autoware.repos +$ docker run -it --rm \ + –v $PWD/src/universe/autoware.universe/XXX/autoware_YYY:/autoware/src/autoware_YYY \ + ghcr.io/autowarefoundation/autoware:universe-devel-cuda +$ colcon build --mixin debug compile-commands +$ source install/setup.bash +$ ros2 run --prefix "gdb -ex run --args" autoware_YYY ZZZ +``` -The [setup script](../setup-dev-env.sh) will install these dependencies through the following roles. +For example, if you want to make modifications to [`autoware.universe/perception/autoware_bytetrack`](https://github.com/autowarefoundation/autoware.universe/tree/main/perception/autoware_bytetrack), you can execute the following commands to perform the volume mount and debug build and execution of only the `autoware_bytetrack`. + +Note that `gdb` is not currently installed in the development containers, but it would be installed in the near future. + +```shell +$ docker run -it --rm \ + -v $PWD/src/universe/autoware.universe/perception/autoware_bytetrack:/autoware/src/autoware_bytetrack \ + ghcr.io/autowarefoundation/autoware:universe-devel-cuda +$ root@a566e785c4d2:/autoware# colcon build --mixin debug compile-commands +Starting >>> autoware_bytetrack +[Processing: autoware_bytetrack] +Finished <<< autoware_bytetrack [37.9s] + +Summary: 1 package finished [38.1s] +$ root@a566e785c4d2:/autoware# source install/setup.bash +$ root@a566e785c4d2:/autoware# apt update && apt install gdb +$ root@a566e785c4d2:/autoware# ros2 run --prefix "gdb -ex run --args" autoware_bytetrack bytetrack_node_exe +GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1 +... +[Thread debugging using libthread_db enabled] +... +[New Thread 0x7ff6f3fff640 (LWP 1205)] +Init ByteTrack! +``` -- [Docker](../ansible/roles/docker_engine/README.md) -- [rocker](../ansible/roles/rocker/README.md) +## Runtime containers -## Usage +In the execution container, there is the all-in-one runtime container for Autoware, `ghcr.io/autowarefoundation/autoware:universe-cuda`, and the multi-containerized `ghcr.io/autowarefoundation/autoware:universe-***-cuda` for each component of Autoware Universe. -### Development image +The all-in-one execution container also has the autoware_launch package installed, allowing it to be started in the same way as a locally built Autoware. -```bash -docker run --rm -it \ - -v {path_to_your_workspace}:/autoware \ - ghcr.io/autowarefoundation/autoware-universe:latest +```shell +git clone git@github.com:autowarefoundation/autoware.git +cd autoware +docker run -it --rm ghcr.io/autowarefoundation/autoware:universe-cuda +ros2 launch autoware_launch planning_simulator.launch.xml map_path:=... ``` -To run with `rocker`: +For example, if you want to run the runtime container that only includes the `sensing/perception` components, you can execute it as follows. -If you use `rocker<=0.2.9`, add an option of `--env NVIDIA_DRIVER_CAPABILITIES=""` or `--env NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics` to avoid the CUDA environment error. For more details, see [this issue](https://github.com/autowarefoundation/autoware/issues/2452). - -```bash -rocker --nvidia --x11 --user \ - --volume {path_to_your_workspace} \ - -- ghcr.io/autowarefoundation/autoware-universe:latest +```shell +docker run -it --rm ghcr.io/autowarefoundation/autoware:universe-sensing-perception-cuda +ros2 launch autoware_pointcloud_preprocessor preprocessor.launch.xml ``` -If you locate your workspace under your home directory, you can use the `--home` option instead: +## Multi-stage Dockerfile structure -```bash -rocker --nvidia --x11 --user --home \ - -- ghcr.io/autowarefoundation/autoware-universe:latest -``` +![](./Dockerfile.svg) -To use a customized `.bashrc` for the container: +The suffix `-devel` (e.g. `universe-devel`) is intended for use as a [development container](https://containers.dev). On the other hand, those without the `-devel` suffix (e.g. `universe`) are intended to be used as a runtime container. -```bash -rocker --nvidia --x11 --user --home \ - --volume $HOME/.bashrc.container:$HOME/.bashrc \ - -- ghcr.io/autowarefoundation/autoware-universe:latest -``` +### `$BASE_IMAGE` -### Prebuilt image +This is a base image of this Dockerfile. [`ros:humble-ros-base-jammy`](https://hub.docker.com/_/ros/tags?page=&page_size=&ordering=&name=humble-ros-base-jammy) will be given. -```bash -docker run --rm -it \ - ghcr.io/autowarefoundation/autoware-universe:latest-prebuilt -``` +### `base` -To run with `rocker`: +This stage performs only the basic setup required for all Autoware images. -```bash -rocker --nvidia --x11 --user \ - --volume {path_to_your_workspace} \ - -- ghcr.io/autowarefoundation/autoware-universe:latest-prebuilt -``` +### `rosdep-depend` -If you intend to use pre-existing data such as maps or Rosbags, modify the `--volume` options shown below. +The ROS dependency package list files will be generated. +These files will be used in the subsequent stages: -```bash -rocker --nvidia --x11 --user \ - --volume {path_to_your_workspace} \ - --volume {path_to_your_map_data} \ - --volume {path_to_your_log_data} \ - -- ghcr.io/autowarefoundation/autoware-universe:latest-prebuilt -``` +- `core-devel` +- `universe-common` +- `universe-COMPONENT-devel` (e.g. `universe-sensing-perception-devel`) +- `universe-COMPONENT` (e.g. `universe-sensing-perception`) +- `universe-devel` +- `universe` -## Building Docker images on your local machine +By generating only the package list files and copying them to the subsequent stages, the dependency packages will not be reinstalled during the container build process unless the dependency packages change. -If you want to build these images locally for development purposes, run the following command: +### `core-devel` -```bash -cd autoware/ -./docker/build.sh -``` +This stage installs the dependency packages based on `/rosdep-core-depend-packages.txt` and build the packages under the `core` directory of `autoware.repos`. -To build without CUDA, use the `--no-cuda` option: +### `universe-common-devel` -```bash -./docker/build.sh --no-cuda -``` +This stage installs the dependency packages based on `/rosdep-universe-common-depend-packages.txt` and build the packages under the following directories of `autoware.repos`. -To specify the platform, use the `--platform` option: +- `universe/external` +- `universe/autoware.universe/common` -```bash -./docker/build.sh --platform linux/amd64 -./docker/build.sh --platform linux/arm64 -``` +### `universe-sensing-perception-devel` -## Tips +This stage installs the dependency packages based on `/rosdep-universe-sensing-perception-depend-packages.txt` and build the packages under the following directories of `autoware.repos`. -### Precautions for not using `rocker` +- `universe/autoware.universe/perception` +- `universe/autoware.universe/sensing` -If either image is run without `rocker`, then `root` privileges will be used. -This can affect your local environment as below: +### `universe-sensing-perception` -```sh-session -$ docker run --rm -it -v {path_to_your_workspace}:/autoware ghcr.io/autowarefoundation/autoware-universe:latest -# colcon build -# exit -$ rm build/COLCON_IGNORE -rm: remove write-protected regular empty file 'build/COLCON_IGNORE'? y -rm: cannot remove 'build/COLCON_IGNORE': Permission denied -``` +This stage is a Autoware Universe Sensing/Perception runtime container. It only includes the dependencies given by `/rosdep-universe-sensing-perception-exec-depend-packages.txt` and the binaries built in the `universe-sensing-perception-devel` stage. + +### `universe-localization-mapping-devel` + +This stage installs the dependency packages based on `/rosdep-universe-localization-mapping-depend-packages.txt` and build the packages under the following directories of `autoware.repos`. + +- `universe/autoware.universe/localization` +- `universe/autoware.universe/map` + +### `universe-localization-mapping` + +This stage is a Autoware Universe Localization/Mapping runtime container. It only includes the dependencies given by `/rosdep-universe-localization-mapping-exec-depend-packages.txt` and the binaries built in the `universe-localization-mapping-devel` stage. + +### `universe-planning-control-devel` + +This stage installs the dependency packages based on `/rosdep-universe-planning-control-depend-packages.txt` and build the packages under the following directories of `autoware.repos`. + +- `universe/autoware.universe/control` +- `universe/autoware.universe/planning` + +### `universe-planning-control` + +This stage is a Autoware Universe Planning/Control runtime container. It only includes the dependencies given by `/rosdep-universe-planning-control-exec-depend-packages.txt` and the binaries built in the `universe-planning-control-devel` stage. + +### `universe-vehicle-system-devel` + +This stage installs the dependency packages based on `/rosdep-universe-vehicle-system-depend-packages.txt` and build the packages under the following directories of `autoware.repos`. + +- `universe/autoware.universe/vehicle` +- `universe/autoware.universe/system` + +### `universe-vehicle-system` + +This stage is a Autoware Universe Vehicle/System runtime container. It only includes the dependencies given by `/rosdep-universe-vehicle-system-exec-depend-packages.txt` and the binaries built in the `universe-vehicle-system-devel` stage. + +### `universe-devel` + +This stage installs the dependency packages based on `/rosdep-universe-depend-packages.txt` and build the remaining packages of `autoware.repos`: + +- `launcher` +- `param` +- `sensor_component` +- `sensor_kit` +- `universe/autoware.universe/evaluator` +- `universe/autoware.universe/launch` +- `universe/autoware.universe/simulator` +- `universe/autoware.universe/system` +- `universe/autoware.universe/tools` +- `universe/autoware.universe/vehicle` +- `vehicle` + +This stage provides an all-in-one development container to Autoware developers. By running the host's source code with volume mounting, it allows for easy building and debugging of Autoware. + +### `universe` -To prevent this error occurring when rocker is not used, there are two suggested methods: - -1. Prepare a dedicated workspace for the docker image. -2. Use Visual Studio Code's [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. - - To use the extension, the following settings can be used to create a user account in a similar way to `rocker. - Refer to [this document](https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user) for more details. - - ```jsonc - // .devcontainer/devcontainer.json - { - "name": "Autoware", - "build": { - "dockerfile": "Dockerfile" - }, - "remoteUser": "autoware", - "settings": { - "terminal.integrated.defaultProfile.linux": "bash" - } - } - ``` - - ```docker - # .devcontainer/Dockerfile - FROM ghcr.io/autowarefoundation/autoware-universe:latest - - ARG USERNAME=autoware - ARG USER_UID=1000 - ARG USER_GID=$USER_UID - - RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ - && apt-get update \ - && apt-get install -y sudo \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ - && chmod 0440 /etc/sudoers.d/$USERNAME - ``` - -### Using Docker images other than `latest` - -There are also images versioned based on the `date` or `release tag`. -Use them when you need a fixed version of the image. - -The list of versions can be found [here](https://github.com/autowarefoundation/autoware/packages). +This stage is an Autoware Universe runtime container. It only includes the dependencies given by `/rosdep-exec-depend-packages.txt`, the binaries built in the `universe-devel` stage, and artifacts. diff --git a/docker/autoware-universe/Dockerfile b/docker/autoware-universe/Dockerfile deleted file mode 100644 index 8a7ad19ce05..00000000000 --- a/docker/autoware-universe/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -ARG BASE_IMAGE -# hadolint ignore=DL3006 -FROM $BASE_IMAGE as devel -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -ARG ROS_DISTRO -ARG SETUP_ARGS - -## Install apt packages -# hadolint ignore=DL3008 -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ - git \ - ssh \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -## Copy files -COPY autoware.repos setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /autoware/ -COPY ansible/ /autoware/ansible/ -WORKDIR /autoware -RUN ls /autoware - -## Add GitHub to known hosts for private repositories -RUN mkdir -p ~/.ssh \ - && ssh-keyscan github.com >> ~/.ssh/known_hosts - -## Set up development environment -RUN --mount=type=ssh \ - ./setup-dev-env.sh -y $SETUP_ARGS universe \ - && pip uninstall -y ansible ansible-core \ - && mkdir src \ - && vcs import src < autoware.repos \ - && rosdep update \ - && DEBIAN_FRONTEND=noninteractive rosdep install -y --ignore-src --from-paths src --rosdistro "$ROS_DISTRO" \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -## Clean up unnecessary files -RUN rm -rf \ - "$HOME"/.cache \ - /etc/apt/sources.list.d/cuda*.list \ - /etc/apt/sources.list.d/docker.list \ - /etc/apt/sources.list.d/nvidia-docker.list - -## Register Vulkan GPU vendors -ADD "https://gitlab.com/nvidia/container-images/vulkan/raw/dc389b0445c788901fda1d85be96fd1cb9410164/nvidia_icd.json" /etc/vulkan/icd.d/nvidia_icd.json -RUN chmod 644 /etc/vulkan/icd.d/nvidia_icd.json -ADD "https://gitlab.com/nvidia/container-images/opengl/raw/5191cf205d3e4bb1150091f9464499b076104354/glvnd/runtime/10_nvidia.json" /etc/glvnd/egl_vendor.d/10_nvidia.json -RUN chmod 644 /etc/glvnd/egl_vendor.d/10_nvidia.json - -## Create entrypoint -# hadolint ignore=DL3059 -RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc -CMD ["/bin/bash"] - -FROM devel as prebuilt -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -## Build and change permission for runtime data conversion -RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \ - && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \ - && find /autoware/install -type d -exec chmod 777 {} \; - -## Create entrypoint -RUN echo "source /autoware/install/setup.bash" > /etc/bash.bashrc -CMD ["/bin/bash"] diff --git a/docker/autoware-universe/docker-bake.hcl b/docker/autoware-universe/docker-bake.hcl deleted file mode 100644 index fa5b3dff25f..00000000000 --- a/docker/autoware-universe/docker-bake.hcl +++ /dev/null @@ -1,19 +0,0 @@ -group "default" { - targets = ["devel", "prebuilt"] -} - -// For docker/metadata-action -target "docker-metadata-action-devel" {} -target "docker-metadata-action-prebuilt" {} - -target "devel" { - inherits = ["docker-metadata-action-devel"] - dockerfile = "docker/autoware-universe/Dockerfile" - target = "devel" -} - -target "prebuilt" { - inherits = ["docker-metadata-action-prebuilt"] - dockerfile = "docker/autoware-universe/Dockerfile" - target = "prebuilt" -} diff --git a/docker/build.sh b/docker/build.sh index ed72fabc446..b962137b79c 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -2,63 +2,155 @@ set -e +# Function to print help message +print_help() { + echo "Usage: build.sh [OPTIONS]" + echo "Options:" + echo " --help Display this help message" + echo " -h Display this help message" + echo " --no-cuda Disable CUDA support" + echo " --platform Specify the platform (default: current platform)" + echo " --devel-only Build devel image only" + echo "" + echo "Note: The --platform option should be one of 'linux/amd64' or 'linux/arm64'." +} + SCRIPT_DIR=$(readlink -f "$(dirname "$0")") -WORKSPACE_ROOT="$SCRIPT_DIR/../" +WORKSPACE_ROOT="$SCRIPT_DIR/.." # Parse arguments -args=() -while [ "$1" != "" ]; do - case "$1" in - --no-cuda) - option_no_cuda=true - ;; - --platform) - option_platform="$2" +parse_arguments() { + while [ "$1" != "" ]; do + case "$1" in + --help | -h) + print_help + exit 1 + ;; + --no-cuda) + option_no_cuda=true + ;; + --platform) + option_platform="$2" + shift + ;; + --devel-only) + option_devel_only=true + ;; + *) + echo "Unknown option: $1" + print_help + exit 1 + ;; + esac shift - ;; - *) - args+=("$1") - ;; - esac - shift -done + done +} # Set CUDA options -if [ "$option_no_cuda" = "true" ]; then - setup_args="--no-nvidia" - image_name_suffix="" -else - setup_args="--no-cuda-drivers" - image_name_suffix="-cuda" -fi +set_cuda_options() { + if [ "$option_no_cuda" = "true" ]; then + setup_args="--no-nvidia" + image_name_suffix="" + else + image_name_suffix="-cuda" + fi +} + +# Set build options +set_build_options() { + if [ "$option_devel_only" = "true" ]; then + targets=("universe-devel") + else + targets=() + fi +} # Set platform -if [ -n "$option_platform" ]; then - platform="$option_platform" -else - platform="linux/amd64" - if [ "$(uname -m)" = "aarch64" ]; then - platform="linux/arm64" +set_platform() { + if [ -n "$option_platform" ]; then + platform="$option_platform" + else + platform="linux/amd64" + if [ "$(uname -m)" = "aarch64" ]; then + platform="linux/arm64" + fi + fi +} + +# Set arch lib dir +set_arch_lib_dir() { + if [ "$platform" = "linux/arm64" ]; then + lib_dir="aarch64" + elif [ "$platform" = "linux/amd64" ]; then + lib_dir="x86_64" + else + echo "Unsupported platform: $platform" + exit 1 fi -fi +} # Load env -source "$WORKSPACE_ROOT/amd64.env" -if [ "$platform" = "linux/arm64" ]; then - source "$WORKSPACE_ROOT/arm64.env" -fi +load_env() { + source "$WORKSPACE_ROOT/amd64.env" + if [ "$platform" = "linux/arm64" ]; then + source "$WORKSPACE_ROOT/arm64.env" + fi +} + +# Clone repositories +clone_repositories() { + cd "$WORKSPACE_ROOT" + if [ ! -d "src" ]; then + mkdir -p src + vcs import src > UID $USER_ID, GID: $GROUP_ID" + + # Create group and user with GID/UID + groupadd -g "$GROUP_ID" "$GROUP_NAME" + useradd -u "$USER_ID" -g "$GROUP_ID" -s /bin/bash -m -d /home/"$USER_NAME" "$USER_NAME" + + # Add sudo privileges to the user + echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers + + # Source ROS2 + # hadolint ignore=SC1090 + source "/opt/ros/$ROS_DISTRO/setup.bash" + source /opt/autoware/setup.bash + + # Execute the command as the user + exec /usr/sbin/gosu "$USER_NAME" "$@" +fi diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 00000000000..a1c920906b6 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,188 @@ +#!/usr/bin/env bash +# shellcheck disable=SC2086,SC2124 + +set -e + +# Define terminal colors +RED='\033[0;31m' +GREEN='\033[0;32m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +SCRIPT_DIR=$(readlink -f "$(dirname "$0")") +WORKSPACE_ROOT="$SCRIPT_DIR/.." +source "$WORKSPACE_ROOT/amd64.env" +if [ "$(uname -m)" = "aarch64" ]; then + source "$WORKSPACE_ROOT/arm64.env" +fi + +# Default values +option_no_nvidia=false +option_devel=false +option_headless=false +MAP_PATH="" +WORKSPACE_PATH="" +USER_ID="" +WORKSPACE="" +DEFAULT_LAUNCH_CMD="ros2 launch autoware_launch autoware.launch.xml map_path:=/autoware_map vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit" + +# Function to print help message +print_help() { + echo -e "\n------------------------------------------------------------" + echo -e "${RED}Note:${NC} The --map-path option is mandatory for the runtime. For development environment with shell access, use --devel option." + echo -e " Default launch command: ${GREEN}${DEFAULT_LAUNCH_CMD}${NC}" + echo -e "------------------------------------------------------------" + echo -e "${RED}Usage:${NC} run.sh [OPTIONS] [LAUNCH_CMD](optional)" + echo -e "Options:" + echo -e " ${GREEN}--help/-h${NC} Display this help message" + echo -e " ${GREEN}--map-path${NC} Specify to mount map files into /autoware_map (mandatory for runtime)" + echo -e " ${GREEN}--devel${NC} Launch the latest Autoware development environment with shell access" + echo -e " ${GREEN}--workspace${NC} (--devel only)Specify the directory to mount into /workspace, by default it uses current directory (pwd)" + echo -e " ${GREEN}--no-nvidia${NC} Disable NVIDIA GPU support" + echo -e " ${GREEN}--headless${NC} Run Autoware in headless mode (default: false)" + echo "" +} + +# Parse arguments +parse_arguments() { + while [ "$1" != "" ]; do + case "$1" in + --help | -h) + print_help + exit 1 + ;; + --no-nvidia) + option_no_nvidia=true + ;; + --devel) + option_devel=true + ;; + --headless) + option_headless=true + ;; + --workspace) + WORKSPACE_PATH="$2" + shift + ;; + --map-path) + MAP_PATH="$2" + shift + ;; + --*) + echo "Unknown option: $1" + print_help + exit 1 + ;; + -*) + echo "Unknown option: $1" + print_help + exit 1 + ;; + *) + LAUNCH_CMD="$@" + break + ;; + esac + shift + done +} + +# Set the docker image and workspace variables +set_variables() { + if [ "$option_devel" = "true" ]; then + # Set image based on option + IMAGE="ghcr.io/autowarefoundation/autoware:universe-devel" + + # Set workspace path, if not provided use the current directory + if [ "$WORKSPACE_PATH" = "" ]; then + WORKSPACE_PATH=$(pwd) + fi + WORKSPACE="-v ${WORKSPACE_PATH}:/workspace" + + # Set user ID and group ID to match the local user + USER_ID="-e LOCAL_UID=$(id -u) -e LOCAL_GID=$(id -g) -e LOCAL_USER=$(id -un) -e LOCAL_GROUP=$(id -gn)" + + # Set map path + if [ "$MAP_PATH" != "" ]; then + MAP="-v ${MAP_PATH}:/autoware_map:ro" + fi + + # Set launch command + if [ "$LAUNCH_CMD" = "" ]; then + LAUNCH_CMD="/bin/bash" + fi + else + # Set image based on option + IMAGE="ghcr.io/autowarefoundation/autoware:universe" + + # Set map path + if [ "$MAP_PATH" = "" ]; then + echo -e "\n------------------------------------------------------------" + echo -e "${RED}Note:${NC} The --map-path option is mandatory for the universe(runtime image). For development environment with shell access, use --devel option." + echo -e "------------------------------------------------------------" + exit 1 + else + MAP="-v ${MAP_PATH}:/autoware_map:ro" + fi + + # Set default launch command if not provided + if [ "$LAUNCH_CMD" = "" ]; then + LAUNCH_CMD=${DEFAULT_LAUNCH_CMD} + fi + fi +} + +# Set GPU flag based on option +set_gpu_flag() { + if [ "$option_no_nvidia" = "true" ]; then + GPU_FLAG="" + else + GPU_FLAG="--gpus all" + IMAGE=${IMAGE}-cuda + fi +} + +# Set X display variables +set_x_display() { + MOUNT_X="" + if [ "$option_headless" = "false" ]; then + MOUNT_X="-e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix" + xhost + >/dev/null + fi +} + +# Main script execution +main() { + # Parse arguments + parse_arguments "$@" + set_variables + set_gpu_flag + set_x_display + + if [ "$option_devel" = "true" ]; then + echo -e "${GREEN}-----------------------------------------------------------------${NC}" + echo -e "${BLUE}Launching Autoware development environment${NC}" + else + echo -e "${GREEN}-----------------------------------------------------------------${NC}" + echo -e "${GREEN}Launching Autoware${NC}" + fi + echo -e "${GREEN}IMAGE:${NC} ${IMAGE}" + if [ "$option_devel" = "true" ]; then + echo -e "${GREEN}WORKSPACE PATH(mounted):${NC} ${WORKSPACE_PATH}:/workspace" + fi + if [ "$MAP_PATH" != "" ]; then + echo -e "${GREEN}MAP PATH(mounted):${NC} ${MAP_PATH}:/autoware_map" + fi + echo -e "${GREEN}LAUNCH CMD:${NC} ${LAUNCH_CMD}" + echo -e "${GREEN}-----------------------------------------------------------------${NC}" + + # Launch the container + set -x + docker run -it --rm --net=host ${GPU_FLAG} ${USER_ID} ${MOUNT_X} \ + -e XAUTHORITY=${XAUTHORITY} -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR -e NVIDIA_DRIVER_CAPABILITIES=all -v /etc/localtime:/etc/localtime:ro \ + ${WORKSPACE} ${MAP} ${IMAGE} \ + ${LAUNCH_CMD} +} + +# Execute the main script +main "$@" diff --git a/docker/scripts/build_and_clean.sh b/docker/scripts/build_and_clean.sh new file mode 100755 index 00000000000..e9d5ec6168f --- /dev/null +++ b/docker/scripts/build_and_clean.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +function build_and_clean() { + local ccache_dir=$1 + local install_base=$2 + local colcon_build_args=$3 + + # shellcheck disable=SC2086 + du -sh "$ccache_dir" && ccache -s && + colcon build --cmake-args \ + " -Wno-dev" \ + " --no-warn-unused-cli" \ + --merge-install \ + --install-base "$install_base" \ + --mixin release compile-commands ccache \ + $colcon_build_args && + du -sh "$ccache_dir" && ccache -s && + rm -rf /autoware/build /autoware/log +} + +build_and_clean "$@" diff --git a/docker/scripts/cleanup_apt.sh b/docker/scripts/cleanup_apt.sh new file mode 100755 index 00000000000..ad03c1f39e3 --- /dev/null +++ b/docker/scripts/cleanup_apt.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +function cleanup_apt() { + local apt_clean=$1 + apt-get autoremove -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache + if [[ $apt_clean == true ]]; then + apt-get clean + fi +} + +cleanup_apt "$@" diff --git a/docker/scripts/cleanup_system.sh b/docker/scripts/cleanup_system.sh new file mode 100755 index 00000000000..0833be2b3a4 --- /dev/null +++ b/docker/scripts/cleanup_system.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +function cleanup_system() { + local lib_dir=$1 + local ros_distro=$2 + + find /usr/lib/"$lib_dir"-linux-gnu -name "*.a" -type f -delete && + find / -name "*.o" -type f -delete && + find / -name "*.h" -type f -delete && + find / -name "*.hpp" -type f -delete && + rm -rf /autoware/ansible /autoware/ansible-galaxy-requirements.yaml /autoware/setup-dev-env.sh /autoware/*.env \ + /root/.local/pipx /opt/ros/"$ros_distro"/include /opt/autoware/include /etc/apt/sources.list.d/cuda*.list \ + /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \ + /usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm* +} + +./cleanup_apt.sh +cleanup_system "$@" diff --git a/docker/scripts/resolve_rosdep_keys.sh b/docker/scripts/resolve_rosdep_keys.sh new file mode 100755 index 00000000000..1615e9f68fe --- /dev/null +++ b/docker/scripts/resolve_rosdep_keys.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +function resolve_rosdep_keys() { + local src_path=$1 + local ros_distro=$2 + + rosdep keys --ignore-src --from-paths "$src_path" | + xargs rosdep resolve --rosdistro "$ros_distro" | + grep -v '^#' | + sed 's/ \+/\n/g' | + sort +} + +resolve_rosdep_keys "$@" diff --git a/setup-dev-env.sh b/setup-dev-env.sh index 510ab6d6f14..5c8c141b6e9 100755 --- a/setup-dev-env.sh +++ b/setup-dev-env.sh @@ -1,16 +1,40 @@ #!/usr/bin/env bash # Set up development environment for Autoware Core/Universe. -# Usage: setup-dev-env.sh [-y] [-v] [--no-nvidia] +# Usage: setup-dev-env.sh [-y] [-v] [--no-nvidia] # Note: -y option is only for CI. set -e +# Function to print help message +print_help() { + echo "Usage: setup-dev-env.sh [OPTIONS]" + echo "Options:" + echo " --help Display this help message" + echo " -h Display this help message" + echo " -y Use non-interactive mode" + echo " -v Enable debug outputs" + echo " --no-nvidia Disable installation of the NVIDIA-related roles ('cuda' and 'tensorrt')" + echo " --no-cuda-drivers Disable installation of 'cuda-drivers' in the role 'cuda'" + echo " --runtime Disable installation dev package of role 'cuda' and 'tensorrt'" + echo " --data-dir Set data directory (default: $HOME/autoware_data)" + echo " --download-artifacts" + echo " Download artifacts" + echo " --module Specify the module (default: all)" + echo "" +} + SCRIPT_DIR=$(readlink -f "$(dirname "$0")") # Parse arguments args=() +option_data_dir="$HOME/autoware_data" + while [ "$1" != "" ]; do case "$1" in + --help | -h) + print_help + exit 1 + ;; -y) # Use non-interactive mode. option_yes=true @@ -27,6 +51,23 @@ while [ "$1" != "" ]; do # Disable installation of 'cuda-drivers' in the role 'cuda'. option_no_cuda_drivers=true ;; + --runtime) + # Disable installation dev package of role 'cuda' and 'tensorrt'. + option_runtime=true + ;; + --data-dir) + # Set data directory + option_data_dir="$2" + shift + ;; + --download-artifacts) + # Set download artifacts option + option_download_artifacts=true + ;; + --module) + option_module="$2" + shift + ;; *) args+=("$1") ;; @@ -74,7 +115,35 @@ fi # Check installation of CUDA Drivers if [ "$option_no_cuda_drivers" = "true" ]; then - ansible_args+=("--extra-vars" "install_cuda_drivers=false") + ansible_args+=("--extra-vars" "cuda_install_drivers=false") +fi + +# Check installation of dev package +if [ "$option_runtime" = "true" ]; then + ansible_args+=("--extra-vars" "ros2_installation_type=ros-base") # ROS installation type, default "desktop" + ansible_args+=("--extra-vars" "install_devel=N") +else + ansible_args+=("--extra-vars" "install_devel=y") +fi + +# Check downloading artifacts +if [ "$target_playbook" = "autoware.dev_env.openadkit" ]; then + if [ "$option_download_artifacts" = "true" ]; then + echo -e "\e[36mArtifacts will be downloaded to $option_data_dir\e[m" + ansible_args+=("--extra-vars" "prompt_download_artifacts=y") + else + ansible_args+=("--extra-vars" "prompt_download_artifacts=N") + fi +elif [ "$option_yes" = "true" ] || [ "$option_download_artifacts" = "true" ]; then + echo -e "\e[36mArtifacts will be downloaded to $option_data_dir\e[m" + ansible_args+=("--extra-vars" "prompt_download_artifacts=y") +fi + +ansible_args+=("--extra-vars" "data_dir=$option_data_dir") + +# Check module option +if [ "$option_module" != "" ]; then + ansible_args+=("--extra-vars" "module=$option_module") fi # Load env @@ -102,22 +171,21 @@ if ! (command -v git >/dev/null 2>&1); then fi # Install pip for ansible -if ! (command -v pip3 >/dev/null 2>&1); then +if ! (python3 -m pip --version >/dev/null 2>&1); then sudo apt-get -y update - sudo apt-get -y install python3-pip + sudo apt-get -y install python3-pip python3-venv fi -# Install ansible -ansible_version=$(pip3 list | grep -oP "^ansible\s+\K([0-9]+)" || true) -if [ "$ansible_version" != "6" ]; then - sudo apt-get -y purge ansible - pip3 install -U "ansible==6.*" - # Workaround for https://github.com/autowarefoundation/autoware/issues/2849 - pip3 install -U "pyOpenSSL>=22.0.0" +# Install pipx for ansible +if ! (python3 -m pipx --version >/dev/null 2>&1); then + sudo apt-get -y update + python3 -m pip install --user pipx fi -# For Python packages installed with user privileges -export PATH="$HOME/.local/bin:$PATH" +# Install ansible +python3 -m pipx ensurepath +export PATH="${PIPX_BIN_DIR:=$HOME/.local/bin}:$PATH" +pipx install --include-deps --force "ansible==6.*" # Install ansible collections echo -e "\e[36m"ansible-galaxy collection install -f -r "$SCRIPT_DIR/ansible-galaxy-requirements.yaml" "\e[m" diff --git a/setup.cfg b/setup.cfg index 5214751c7ba..4d7d5e5b959 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,7 @@ +# This file is automatically synced from: +# https://github.com/autowarefoundation/sync-file-templates +# To make changes, update the source repository and follow the guidelines in its README. + [flake8] # Modified from https://github.com/ament/ament_lint/blob/ebd524bb9973d5ec1dc48a670ce54f958a5a0243/ament_flake8/ament_flake8/configuration/ament_flake8.ini extend-ignore = B902,C816,D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404,I202,CNL100,E203,E501,Q000 diff --git a/simulator.repos b/simulator.repos index dd3551eb56b..2940aa4f72f 100644 --- a/simulator.repos +++ b/simulator.repos @@ -2,4 +2,4 @@ repositories: simulator/scenario_simulator: type: git url: https://github.com/tier4/scenario_simulator_v2.git - version: master + version: 7.3.1 diff --git a/tools.repos b/tools.repos new file mode 100644 index 00000000000..f2d1a47d9fa --- /dev/null +++ b/tools.repos @@ -0,0 +1,5 @@ +repositories: + tools: + type: git + url: https://github.com/autowarefoundation/autoware_tools.git + version: main