From d149c55c344e8da03112f444caecf6eb0c888507 Mon Sep 17 00:00:00 2001 From: d61h6k4 Date: Mon, 19 Jun 2023 17:42:59 +0200 Subject: [PATCH] Build both platforms on the same machine --- .github/workflows/continous-integration.yml | 27 +++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index 5f5865445608..923b0cb53e30 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -823,9 +823,7 @@ jobs: image_tag: ${{ steps.set_output.outputs.image_tag }} # Return 'true' if tag version is equal or higher than the latest tagged Rasa version is_newest_version: ${{ steps.rasa_get_version.outputs.is_newest_version }} - strategy: - matrix: - arch: [linux/amd64, linux/arm64] + steps: # Due to an issue with checking out a wrong commit, we make sure # to checkout HEAD commit for a pull request. @@ -912,51 +910,51 @@ jobs: if: steps.check_image.outputs.base_exists == 'false' || env.IS_TAG_BUILD == 'true' run: | export IMAGE_TAG=${{ steps.check_image.outputs.base_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base - name: Push Docker base image if it's not building from a fork ⬆ if: (steps.check_image.outputs.base_exists == 'false' || env.IS_TAG_BUILD == 'true') && github.event.pull_request.head.repo.owner.login == 'RasaHQ' run: | export IMAGE_TAG=${{ steps.check_image.outputs.base_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base --push + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base --push - name: Build Docker mitie base image 🛠 if: steps.check_image.outputs.base_mitie_exists == 'false' || steps.check_image.outputs.base_exists == 'false' run: | export IMAGE_TAG=${{ steps.check_image.outputs.base_mitie_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-mitie + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-mitie - name: Push Docker mitie base image if it's not building from a fork ⬆ if: (steps.check_image.outputs.base_mitie_exists == 'false' || steps.check_image.outputs.base_exists == 'false') && github.event.pull_request.head.repo.owner.login == 'RasaHQ' run: | export IMAGE_TAG=${{ steps.check_image.outputs.base_mitie_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-mitie --push + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-mitie --push - name: Build Docker poetry base image 🛠 if: steps.check_image.outputs.base_poetry_exists == 'false' || steps.check_image.outputs.base_exists == 'false' run: | export IMAGE_TAG=${{ env.POETRY_VERSION }} export BASE_IMAGE_HASH=${{ steps.check_image.outputs.base_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-poetry + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-poetry - name: Push Docker poetry base image if it's not building from a fork ⬆ if: (steps.check_image.outputs.base_poetry_exists == 'false' || steps.check_image.outputs.base_exists == 'false') && github.event.pull_request.head.repo.owner.login == 'RasaHQ' run: | export IMAGE_TAG=${{ env.POETRY_VERSION }} export BASE_IMAGE_HASH=${{ steps.check_image.outputs.base_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-poetry --push + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-poetry --push - name: Build Docker builder base image 🛠 if: steps.check_image.outputs.base_builder_exists == 'false' || steps.check_image.outputs.base_exists == 'false' run: | export IMAGE_TAG=${{ steps.check_image.outputs.base_builder_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-builder + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-builder - name: Push Docker builder base image if it's not building from a fork ⬆ if: (steps.check_image.outputs.base_builder_exists == 'false' || steps.check_image.outputs.base_exists == 'false') && github.event.pull_request.head.repo.owner.login == 'RasaHQ' run: | export IMAGE_TAG=${{ steps.check_image.outputs.base_builder_image_hash }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl base-builder --push + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl base-builder --push # Set environment variables for a pull request # @@ -1013,7 +1011,6 @@ jobs: strategy: matrix: image: [default, full, mitie-en, spacy-de, spacy-it, spacy-en] - arch: [linux/amd64, linux/arm64] steps: # Due to an issue with checking out a wrong commit, we make sure @@ -1073,19 +1070,19 @@ jobs: - name: Build Docker image if: needs.changes.outputs.docker == 'true' run: | - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl ${{ matrix.image }} + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} - name: Push image with main tag 📦 if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'RasaHQ/rasa' run: | - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl ${{ matrix.image }} --push + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} --push - name: Push image with ${{github.ref}} tag 📦 if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && env.IS_TAG_BUILD == 'true' && github.repository == 'RasaHQ/rasa' run: | IS_NEWEST_VERSION=${{ needs.build_docker_base_images_and_set_env.outputs.is_newest_version }} - docker buildx bake --set *.platform=${{ matrix.arch }} -f docker/docker-bake.hcl ${{ matrix.image }} --push + docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }} --push # Tag the image as latest if [[ "${IS_NEWEST_VERSION}" == "true" ]]; then