From 96c5e1a35aac064e803075a25c5a269073fc6fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Tue, 20 Aug 2024 13:12:18 +0300 Subject: [PATCH 1/6] ci: use aws codebuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .../workflows/build-and-test-daily-arm64.yaml | 10 ++++++++- .../build-and-test-differential-arm64.yaml | 10 ++++++++- .../build-and-test-differential.yaml | 22 ++++++++++--------- .github/workflows/build-and-test.yaml | 10 ++++++++- .../pointcloud_preprocessor/filter.hpp | 2 ++ 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-test-daily-arm64.yaml b/.github/workflows/build-and-test-daily-arm64.yaml index 0d71e13a9ff58..8b4c2e135e761 100644 --- a/.github/workflows/build-and-test-daily-arm64.yaml +++ b/.github/workflows/build-and-test-daily-arm64.yaml @@ -5,9 +5,13 @@ on: - cron: 0 0 * * * workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: build-and-test-daily-arm64: - runs-on: [self-hosted, linux, ARM64] + runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large container: ${{ matrix.container }}${{ matrix.container-suffix }} strategy: fail-fast: false @@ -30,6 +34,9 @@ jobs: - name: Show disk space before the tasks run: df -h + - name: Show machine specs + run: lscpu && free -h + - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -55,6 +62,7 @@ jobs: target-packages: ${{ steps.get-self-packages.outputs.self-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }} + build-pre-command: taskset --cpu-list 0-6 - name: Test if: ${{ steps.get-self-packages.outputs.self-packages != '' }} diff --git a/.github/workflows/build-and-test-differential-arm64.yaml b/.github/workflows/build-and-test-differential-arm64.yaml index 73aead76a25f4..9e121aa028867 100644 --- a/.github/workflows/build-and-test-differential-arm64.yaml +++ b/.github/workflows/build-and-test-differential-arm64.yaml @@ -8,6 +8,10 @@ on: - reopened - labeled +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: make-sure-label-is-present: uses: autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1 @@ -17,7 +21,7 @@ jobs: build-and-test-differential-arm64: needs: make-sure-label-is-present if: ${{ needs.make-sure-label-is-present.outputs.result == 'true' }} - runs-on: [self-hosted, linux, ARM64] + runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large container: ${{ matrix.container }}${{ matrix.container-suffix }} strategy: fail-fast: false @@ -44,6 +48,9 @@ jobs: - name: Show disk space before the tasks run: df -h + - name: Show machine specs + run: lscpu && free -h + - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -69,6 +76,7 @@ jobs: target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }} + build-pre-command: taskset --cpu-list 0-6 - name: Test id: test diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index d41e6cf481b76..c88cf4672c528 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -8,6 +8,10 @@ on: - reopened - labeled +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + env: CC: /usr/lib/ccache/gcc CXX: /usr/lib/ccache/g++ @@ -36,9 +40,11 @@ jobs: container: ghcr.io/autowarefoundation/autoware:latest-autoware-universe build-depends-repos: build_depends.repos - container-suffix: -cuda - runner: [self-hosted, linux, X64, cpu] + runner: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large + build-pre-command: taskset --cpu-list 0-6 - container-suffix: "" runner: ubuntu-latest + build-pre-command: "" steps: - name: Set PR fetch depth run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" @@ -52,6 +58,9 @@ jobs: - name: Show disk space before the tasks run: df -h + - name: Show machine specs + run: lscpu && free -h + - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -74,14 +83,6 @@ jobs: restore-keys: | ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}- - # Limit ccache size only for CUDA builds to avoid running out of disk space - - name: Limit ccache size - if: ${{ matrix.container-suffix == '-cuda' }} - run: | - rm -f "${CCACHE_DIR}/ccache.conf" - echo -e "# Set maximum cache size\nmax_size = 1MB" >> "${CCACHE_DIR}/ccache.conf" - shell: bash - - name: Show ccache stats before build run: du -sh ${CCACHE_DIR} && ccache -s shell: bash @@ -98,12 +99,13 @@ jobs: - name: Build if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} - uses: autowarefoundation/autoware-github-actions/colcon-build@v1 + uses: autowarefoundation/autoware-github-actions/colcon-build@refactor/rename-nice-command with: rosdistro: ${{ matrix.rosdistro }} target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }} + build-pre-command: ${{ matrix.build-pre-command }} - name: Show ccache stats after build run: du -sh ${CCACHE_DIR} && ccache -s diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 716d6b8df5fbc..367a0b3356c4f 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -6,13 +6,17 @@ on: - main workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + env: CC: /usr/lib/ccache/gcc CXX: /usr/lib/ccache/g++ jobs: build-and-test: - runs-on: [self-hosted, linux, X64, gpu] + runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-medium container: ${{ matrix.container }}${{ matrix.container-suffix }} strategy: fail-fast: false @@ -34,6 +38,9 @@ jobs: - name: Show disk space before the tasks run: df -h + - name: Show machine specs + run: lscpu && free -h + - name: Remove exec_depend uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 @@ -84,6 +91,7 @@ jobs: target-packages: ${{ steps.get-self-packages.outputs.self-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }} + build-pre-command: taskset --cpu-list 0-2 - name: Show ccache stats after build run: du -sh ${CCACHE_DIR} && ccache -s diff --git a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp index 789f377e7ec95..4023cc75317c4 100644 --- a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp +++ b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp @@ -85,6 +85,8 @@ #include #include +// TODO(xmfcx): remove this line before merging... + namespace autoware::pointcloud_preprocessor { namespace sync_policies = message_filters::sync_policies; From 4aa70ff7c0593773073e7ed41540c1a45f7bc390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Tue, 20 Aug 2024 13:16:52 +0300 Subject: [PATCH 2/6] fix tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .github/workflows/build-and-test-differential.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index c88cf4672c528..78c21477c2588 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -99,7 +99,7 @@ jobs: - name: Build if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} - uses: autowarefoundation/autoware-github-actions/colcon-build@refactor/rename-nice-command + uses: autowarefoundation/autoware-github-actions/colcon-build@v1 with: rosdistro: ${{ matrix.rosdistro }} target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} From 840991fa3fa53e6e49f86d12cf2f9ae3d2fbc6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Tue, 20 Aug 2024 15:51:11 +0300 Subject: [PATCH 3/6] switch build-and-test to large machine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .github/workflows/build-and-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 367a0b3356c4f..df49e5d418bc9 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -16,7 +16,7 @@ env: jobs: build-and-test: - runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-medium + runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large container: ${{ matrix.container }}${{ matrix.container-suffix }} strategy: fail-fast: false @@ -91,7 +91,7 @@ jobs: target-packages: ${{ steps.get-self-packages.outputs.self-packages }} build-depends-repos: ${{ matrix.build-depends-repos }} cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }} - build-pre-command: taskset --cpu-list 0-2 + build-pre-command: taskset --cpu-list 0-6 - name: Show ccache stats after build run: du -sh ${CCACHE_DIR} && ccache -s From 5c54dc72c574a000a08c47ee410e8d207e685031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Tue, 20 Aug 2024 15:51:35 +0300 Subject: [PATCH 4/6] remove unused change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .../include/autoware/pointcloud_preprocessor/filter.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp index 4023cc75317c4..789f377e7ec95 100644 --- a/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp +++ b/sensing/autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/filter.hpp @@ -85,8 +85,6 @@ #include #include -// TODO(xmfcx): remove this line before merging... - namespace autoware::pointcloud_preprocessor { namespace sync_policies = message_filters::sync_policies; From 37f86489d6ce75acddb75b8f0ecf235f525a8d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Tue, 20 Aug 2024 18:07:05 +0300 Subject: [PATCH 5/6] docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .github/README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/README.md diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 0000000000000..b942d4119d292 --- /dev/null +++ b/.github/README.md @@ -0,0 +1,55 @@ +# Overall CI Infrastructure + +## Machine Types + +### Standard GitHub-hosted runners + +- [Documentation](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories) + +These runners are utilized by the majority of the workflows. +They are free to use for public repositories, with a concurrency limit of 20 jobs per organization. + +**Listed specs:** + +| vCPU | RAM | Storage (SSD) | +|------|-------|---------------| +| 4 | 16 GB | 14 GB | + +**Note:** While the official documentation lists 14 GB of storage, the actual available storage is approximately 73 GB. + +### AWS CodeBuild runners + +- [AWS CodeBuild Documentation](https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html) + +These runners are employed for workflows that require more resources and are funded by the Autoware Foundation budget. + +**Relevant machine types:** + +| Instance Type | Memory | vCPUs | Price per Minute | +|-----------------|--------|-------|------------------| +| arm1.large | 16 GiB | 8 | $0.015 | +| general1.medium | 7 GB | 4 | $0.01 | +| general1.large | 15 GB | 8 | $0.02 | +| general1.xlarge | 72 GiB | 36 | $0.0798 | +| gpu1.small | 15 GB | 4 | $0.05 | + +**Sources:** + +- [Compute images supported with the CodeBuild-hosted GitHub Actions runner](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-action-runners-update-yaml.images.html) +- [AWS CodeBuild pricing](https://aws.amazon.com/codebuild/pricing/) + +## Key workflows and their runners + +| Workflow | Trigger | Runner | +|------------------------------------|-----------------------|----------------| +| build-and-test (cuda) | merge to main | general1.large | +| build-and-test-daily | daily on main | github-std | +| build-and-test-daily-arm64 | daily on main | arm1.large | +| build-and-test-differential | PR update | github-std | +| build-and-test-differential (cuda) | PR update | general1.large | +| build-and-test-differential-arm64 | PR update (arm label) | arm1.large | + +## Additional notes + +- We use [`taskset`](https://manpages.ubuntu.com/manpages/jammy/man1/taskset.1.html) from GNU Coreutils to limit the number of cores utilized by build processes. This is done to prevent overloading the self-hosted runners. + - The number of cores is limited to `vCPU count - 1`. From 1bc7da69cd0cf2145a2421d23d40a3c5b116acbd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:12:02 +0000 Subject: [PATCH 6/6] style(pre-commit): autofix --- .github/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/README.md b/.github/README.md index b942d4119d292..0a73a98d7e575 100644 --- a/.github/README.md +++ b/.github/README.md @@ -12,7 +12,7 @@ They are free to use for public repositories, with a concurrency limit of 20 job **Listed specs:** | vCPU | RAM | Storage (SSD) | -|------|-------|---------------| +| ---- | ----- | ------------- | | 4 | 16 GB | 14 GB | **Note:** While the official documentation lists 14 GB of storage, the actual available storage is approximately 73 GB. @@ -26,7 +26,7 @@ These runners are employed for workflows that require more resources and are fun **Relevant machine types:** | Instance Type | Memory | vCPUs | Price per Minute | -|-----------------|--------|-------|------------------| +| --------------- | ------ | ----- | ---------------- | | arm1.large | 16 GiB | 8 | $0.015 | | general1.medium | 7 GB | 4 | $0.01 | | general1.large | 15 GB | 8 | $0.02 | @@ -41,7 +41,7 @@ These runners are employed for workflows that require more resources and are fun ## Key workflows and their runners | Workflow | Trigger | Runner | -|------------------------------------|-----------------------|----------------| +| ---------------------------------- | --------------------- | -------------- | | build-and-test (cuda) | merge to main | general1.large | | build-and-test-daily | daily on main | github-std | | build-and-test-daily-arm64 | daily on main | arm1.large |