From d3a7b69a581e054ad8fde0d170a0fda85734531c Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 10 Jun 2024 20:00:30 +0900 Subject: [PATCH] refactor(ci): use platform arg to replace raw string (#4844) use platform arg to replace raw string Signed-off-by: Yutaka Kondo --- .github/workflows/build-main-self-hosted.yaml | 8 +++++--- .github/workflows/build-main.yaml | 8 +++++--- .../workflows/docker-build-and-push-main-self-hosted.yaml | 8 +++++--- .github/workflows/docker-build-and-push-main.yaml | 8 +++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml index d83234253f6..1bbb7b51479 100644 --- a/.github/workflows/build-main-self-hosted.yaml +++ b/.github/workflows/build-main-self-hosted.yaml @@ -27,11 +27,13 @@ jobs: - 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 @@ -68,13 +70,13 @@ jobs: with: bake-target: autoware build-args: | - *.platform=linux/arm64 + *.platform=linux/${{ matrix.platform }} *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-arm64 - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-arm64,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index 953f93492b1..bb261df9181 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -27,11 +27,13 @@ jobs: - 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 @@ -63,13 +65,13 @@ jobs: with: bake-target: autoware build-args: | - *.platform=linux/amd64 + *.platform=linux/${{ matrix.platform }} *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-amd64 - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-amd64,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: false diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml index f5066a2c9ca..d7df16222bf 100644 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ b/.github/workflows/docker-build-and-push-main-self-hosted.yaml @@ -39,11 +39,13 @@ jobs: - 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 @@ -80,13 +82,13 @@ jobs: with: bake-target: autoware build-args: | - *.platform=linux/arm64 + *.platform=linux/${{ matrix.platform }} *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-arm64 - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-arm64,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml index 430b6dbe031..e0f04aaf556 100644 --- a/.github/workflows/docker-build-and-push-main.yaml +++ b/.github/workflows/docker-build-and-push-main.yaml @@ -40,11 +40,13 @@ jobs: include: - name: no-cuda base_image_env: base_image + platform: amd64 lib_dir: x86_64 setup-args: --no-nvidia additional-tag-suffix: "" - name: cuda base_image_env: base_image + platform: amd64 lib_dir: x86_64 additional-tag-suffix: -cuda steps: @@ -75,13 +77,13 @@ jobs: with: bake-target: autoware build-args: | - *.platform=linux/amd64 + *.platform=linux/${{ matrix.platform }} *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }} *.args.SETUP_ARGS=${{ matrix.setup-args }} *.args.LIB_DIR=${{ matrix.lib_dir }} - *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-amd64 - *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-amd64,mode=max + *.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }} + *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }}-${{ matrix.platform }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} allow-push: true