From 58bf8a9cb2e46b7a44f9a070076ceacb5e3f1ed9 Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Tue, 21 May 2024 15:32:37 +0300 Subject: [PATCH 01/11] remove build-main actions Signed-off-by: Oguz Ozturk --- .github/workflows/build-main-self-hosted.yaml | 64 ------------------- .github/workflows/build-main.yaml | 59 ----------------- ...aml => docker-build-main-self-hosted.yaml} | 0 ...-push-main.yaml => docker-build-main.yaml} | 0 4 files changed, 123 deletions(-) delete mode 100644 .github/workflows/build-main-self-hosted.yaml delete mode 100644 .github/workflows/build-main.yaml rename .github/workflows/{docker-build-and-push-main-self-hosted.yaml => docker-build-main-self-hosted.yaml} (100%) rename .github/workflows/{docker-build-and-push-main.yaml => docker-build-main.yaml} (100%) diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml deleted file mode 100644 index a93cc134485..00000000000 --- a/.github/workflows/build-main-self-hosted.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: build-main-self-hosted - -on: - schedule: - - cron: 0 12 * * * - workflow_dispatch: - -jobs: - load-env: - uses: ./.github/workflows/load-env.yaml - - build-main-self-hosted: - needs: load-env - runs-on: [self-hosted, linux, ARM64] - strategy: - fail-fast: false - matrix: - name: - - no-cuda - - cuda - include: - - name: no-cuda - platform: arm64 - base_image_env: base_image - lib_dir: aarch64 - setup-args: --no-nvidia - additional-tag-suffix: "" - - name: cuda - platform: arm64 - base_image_env: base_image - lib_dir: aarch64 - additional-tag-suffix: -cuda - 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: - name: ${{ matrix.name }} - platform: ${{ matrix.platform }} - cache-tag-suffix: main - build-args: | - ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} - BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} - SETUP_ARGS=${{ matrix.setup-args }} - LIB_DIR=${{ matrix.lib_dir }} - - - name: Show disk space - run: | - df -h diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml deleted file mode 100644 index 249402092e7..00000000000 --- a/.github/workflows/build-main.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: build-main - -on: - schedule: - - cron: 0 12 * * * - workflow_dispatch: - -jobs: - load-env: - uses: ./.github/workflows/load-env.yaml - - build-main: - needs: load-env - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - name: - - no-cuda - - cuda - include: - - name: no-cuda - platform: amd64 - base_image_env: base_image - lib_dir: x86_64 - setup-args: --no-nvidia - additional-tag-suffix: "" - - name: cuda - platform: amd64 - base_image_env: base_image - lib_dir: x86_64 - additional-tag-suffix: -cuda - 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: - name: ${{ matrix.name }} - platform: ${{ matrix.platform }} - cache-tag-suffix: main - build-args: | - ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} - BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} - SETUP_ARGS=${{ matrix.setup-args }} - LIB_DIR=${{ matrix.lib_dir }} - - - name: Show disk space - run: | - df -h diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-main-self-hosted.yaml similarity index 100% rename from .github/workflows/docker-build-and-push-main-self-hosted.yaml rename to .github/workflows/docker-build-main-self-hosted.yaml diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-main.yaml similarity index 100% rename from .github/workflows/docker-build-and-push-main.yaml rename to .github/workflows/docker-build-main.yaml From a0f3b14ecdc6f8fcf556f0ca9d263fec84b21a01 Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Tue, 21 May 2024 15:34:25 +0300 Subject: [PATCH 02/11] simplify names Signed-off-by: Oguz Ozturk --- .github/workflows/docker-build-main-self-hosted.yaml | 4 ++-- .github/workflows/docker-build-main.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-main-self-hosted.yaml b/.github/workflows/docker-build-main-self-hosted.yaml index 541b2757744..2506291f3fd 100644 --- a/.github/workflows/docker-build-main-self-hosted.yaml +++ b/.github/workflows/docker-build-main-self-hosted.yaml @@ -4,7 +4,7 @@ # push-branch: Build only devel and prebuilt. TAGS: date, latest # push-tag: Build all. TAGS: version, date, latest -name: docker-build-and-push-main-self-hosted +name: docker-build-main-self-hosted on: push: @@ -26,7 +26,7 @@ jobs: load-env: uses: ./.github/workflows/load-env.yaml - docker-build-and-push-main-self-hosted: + docker-build-main-self-hosted: needs: load-env runs-on: [self-hosted, linux, ARM64] strategy: diff --git a/.github/workflows/docker-build-main.yaml b/.github/workflows/docker-build-main.yaml index 32193ef6dc1..627f4b74bf5 100644 --- a/.github/workflows/docker-build-main.yaml +++ b/.github/workflows/docker-build-main.yaml @@ -4,7 +4,7 @@ # push-branch: Build only devel and prebuilt. TAGS: date, latest # push-tag: Build all. TAGS: version, date, latest -name: docker-build-and-push-main +name: docker-build-main on: push: @@ -26,7 +26,7 @@ jobs: load-env: uses: ./.github/workflows/load-env.yaml - docker-build-and-push-main: + docker-build-main: needs: load-env runs-on: ubuntu-latest strategy: From 05911aeb89561d430083e70f5f749a63e3561f49 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 4 Jun 2024 13:53:43 +0900 Subject: [PATCH 03/11] update schedule Signed-off-by: Yutaka Kondo --- .github/workflows/docker-build-main-self-hosted.yaml | 2 +- .github/workflows/docker-build-main.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-main-self-hosted.yaml b/.github/workflows/docker-build-main-self-hosted.yaml index 2506291f3fd..6f23d5e7df4 100644 --- a/.github/workflows/docker-build-main-self-hosted.yaml +++ b/.github/workflows/docker-build-main-self-hosted.yaml @@ -11,7 +11,7 @@ on: tags: - openadkit-v*.*.* schedule: - - cron: 0 0 1,15 * * + - cron: 0 12 * * * workflow_dispatch: inputs: artifacts-destination: diff --git a/.github/workflows/docker-build-main.yaml b/.github/workflows/docker-build-main.yaml index 627f4b74bf5..d1582546c61 100644 --- a/.github/workflows/docker-build-main.yaml +++ b/.github/workflows/docker-build-main.yaml @@ -11,7 +11,7 @@ on: tags: - openadkit-v*.*.* schedule: - - cron: 0 0 1,15 * * + - cron: 0 12 * * * workflow_dispatch: inputs: artifacts-destination: From 7de2a35c672f46d1edbde27f81d183bc23a93aa7 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 4 Jun 2024 13:58:42 +0900 Subject: [PATCH 04/11] remove -main Signed-off-by: Yutaka Kondo --- ...-build-main-self-hosted.yaml => docker-build-self-hosted.yaml} | 0 .github/workflows/{docker-build-main.yaml => docker-build.yaml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docker-build-main-self-hosted.yaml => docker-build-self-hosted.yaml} (100%) rename .github/workflows/{docker-build-main.yaml => docker-build.yaml} (100%) diff --git a/.github/workflows/docker-build-main-self-hosted.yaml b/.github/workflows/docker-build-self-hosted.yaml similarity index 100% rename from .github/workflows/docker-build-main-self-hosted.yaml rename to .github/workflows/docker-build-self-hosted.yaml diff --git a/.github/workflows/docker-build-main.yaml b/.github/workflows/docker-build.yaml similarity index 100% rename from .github/workflows/docker-build-main.yaml rename to .github/workflows/docker-build.yaml From 6a4b24f620a293ec1d6e1f77f666e3f4949e5098 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 4 Jun 2024 14:04:25 +0900 Subject: [PATCH 05/11] update badge Signed-off-by: Yutaka Kondo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbc8e85a0f3..6e45987d48d 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@

- - + Build Main CI Date: Tue, 4 Jun 2024 14:06:50 +0900 Subject: [PATCH 06/11] remove -main Signed-off-by: Yutaka Kondo --- .github/workflows/docker-build-self-hosted.yaml | 4 ++-- .github/workflows/docker-build.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-self-hosted.yaml b/.github/workflows/docker-build-self-hosted.yaml index 6f23d5e7df4..097d593a2bd 100644 --- a/.github/workflows/docker-build-self-hosted.yaml +++ b/.github/workflows/docker-build-self-hosted.yaml @@ -4,7 +4,7 @@ # push-branch: Build only devel and prebuilt. TAGS: date, latest # push-tag: Build all. TAGS: version, date, latest -name: docker-build-main-self-hosted +name: docker-build-self-hosted on: push: @@ -26,7 +26,7 @@ jobs: load-env: uses: ./.github/workflows/load-env.yaml - docker-build-main-self-hosted: + docker-build-self-hosted: needs: load-env runs-on: [self-hosted, linux, ARM64] strategy: diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index d1582546c61..c89d4226031 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -4,7 +4,7 @@ # push-branch: Build only devel and prebuilt. TAGS: date, latest # push-tag: Build all. TAGS: version, date, latest -name: docker-build-main +name: docker-build on: push: @@ -26,7 +26,7 @@ jobs: load-env: uses: ./.github/workflows/load-env.yaml - docker-build-main: + docker-build: needs: load-env runs-on: ubuntu-latest strategy: From 991afca731efb9de0275902a420bc350e9a91e1a Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Mon, 24 Jun 2024 13:06:02 +0300 Subject: [PATCH 07/11] add push day check to docker build workflows Signed-off-by: Oguz Ozturk --- .github/workflows/docker-build-self-hosted.yaml | 7 ++++++- .github/workflows/docker-build.yaml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-self-hosted.yaml b/.github/workflows/docker-build-self-hosted.yaml index 097d593a2bd..7a6f8484e46 100644 --- a/.github/workflows/docker-build-self-hosted.yaml +++ b/.github/workflows/docker-build-self-hosted.yaml @@ -48,6 +48,11 @@ jobs: lib_dir: aarch64 additional-tag-suffix: -cuda steps: + - name: Check if push day + run: | + if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi + if: ${{ github.event_name == 'schedule' }} + # https://github.com/actions/checkout/issues/211 - name: Change permission of workspace run: | @@ -101,7 +106,7 @@ jobs: *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }} tag-prefix: ${{ needs.load-env.outputs.rosdistro }} - allow-push: true + allow-push: ${{ env.IS_PUSH_DAY == 'true' }} - name: Show disk space run: | diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index c89d4226031..4c82f50b73c 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -48,6 +48,11 @@ jobs: lib_dir: x86_64 additional-tag-suffix: -cuda steps: + - name: Check if push day + run: | + if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi + if: ${{ github.event_name == 'schedule' }} + - name: Check out repository uses: actions/checkout@v4 @@ -96,7 +101,7 @@ jobs: *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }} tag-prefix: ${{ needs.load-env.outputs.rosdistro }} - allow-push: true + allow-push: ${{ env.IS_PUSH_DAY == 'true' }} - name: Show disk space run: | From 3423d0db3f74b1826b2fdfc307dddf43535cdc88 Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Mon, 24 Jun 2024 14:01:22 +0300 Subject: [PATCH 08/11] push every 15 days Signed-off-by: Oguz Ozturk --- .github/actions/docker-build-and-push/action.yaml | 5 ++--- .github/workflows/docker-build.yaml | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 4e42577f96b..ea750e6e7c6 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -16,7 +16,7 @@ inputs: required: false allow-push: description: "" - default: "true" + default: "false" required: false runs: @@ -108,8 +108,7 @@ runs: password: ${{ github.token }} - name: Build and Push to GitHub Container Registry - if: ${{ github.event_name == 'push' || - github.event_name == 'schedule' || + if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }} uses: docker/bake-action@v5 with: diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 4c82f50b73c..c3bdc99c4e6 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -49,10 +49,11 @@ jobs: additional-tag-suffix: -cuda steps: - name: Check if push day + if: ${{ github.event_name == 'schedule' }} run: | if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi - if: ${{ github.event_name == 'schedule' }} - + echo "Day of the month: $(date +'%d')" + - name: Check out repository uses: actions/checkout@v4 From 2ff028073dae6dfa6230f57827d33bf0c9488057 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:01:36 +0000 Subject: [PATCH 09/11] style(pre-commit): autofix --- .github/workflows/docker-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index c3bdc99c4e6..e9bfc4f70c9 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -53,7 +53,7 @@ jobs: run: | if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi echo "Day of the month: $(date +'%d')" - + - name: Check out repository uses: actions/checkout@v4 From 71804e18452c630cf223cc42e49e9bd4e34f900b Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Mon, 24 Jun 2024 14:02:56 +0300 Subject: [PATCH 10/11] . Signed-off-by: Oguz Ozturk --- .github/workflows/docker-build-self-hosted.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-self-hosted.yaml b/.github/workflows/docker-build-self-hosted.yaml index 7a6f8484e46..5fcb8648850 100644 --- a/.github/workflows/docker-build-self-hosted.yaml +++ b/.github/workflows/docker-build-self-hosted.yaml @@ -49,10 +49,11 @@ jobs: additional-tag-suffix: -cuda steps: - name: Check if push day + if: ${{ github.event_name == 'schedule' }} run: | if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi - if: ${{ github.event_name == 'schedule' }} - + echo "Day of the month: $(date +'%d')" + # https://github.com/actions/checkout/issues/211 - name: Change permission of workspace run: | From f6ad80bcbff8ee6648cf08b0e46a48926724e509 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:03:27 +0000 Subject: [PATCH 11/11] style(pre-commit): autofix --- .github/workflows/docker-build-self-hosted.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-self-hosted.yaml b/.github/workflows/docker-build-self-hosted.yaml index 5fcb8648850..9257de94900 100644 --- a/.github/workflows/docker-build-self-hosted.yaml +++ b/.github/workflows/docker-build-self-hosted.yaml @@ -53,7 +53,7 @@ jobs: run: | if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi echo "Day of the month: $(date +'%d')" - + # https://github.com/actions/checkout/issues/211 - name: Change permission of workspace run: |