From 076498ebcf977cdbc1329e68048248fc7afa72f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Sat, 22 Jun 2024 04:57:51 +0200 Subject: [PATCH] docker: make images arm64-compatible (#2199) * optimize multi-arch docker build on x86 * test * test * test * test * separate build * separate build * fix package versions * also fixes the release * orjson * orjson * fix cryptography * fix duckdb * all * all * fix * use provenance --- .github/workflows/docker-build.yml | 6 ++++-- .github/workflows/pre-release-base.yml | 3 ++- .github/workflows/pre-release-langflow.yml | 9 ++++++--- .github/workflows/release.yml | 9 ++++++--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6ee66a648..75c136202 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -58,9 +58,10 @@ jobs: with: context: . push: true - platforms: "linux/amd64" file: ${{ needs.setup.outputs.file }} tags: ${{ needs.setup.outputs.tags }} + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false build_components: if: ${{ inputs.release_type == 'main' }} @@ -92,11 +93,12 @@ jobs: with: context: . push: true - platforms: "linux/amd64" build-args: | LANGFLOW_IMAGE=langflowai/langflow:${{ inputs.version }} file: ${{ matrix.dockerfile }} tags: ${{ matrix.tags }} + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false restart-space: name: Restart HuggingFace Spaces diff --git a/.github/workflows/pre-release-base.yml b/.github/workflows/pre-release-base.yml index 6f1e4fe8e..e732af993 100644 --- a/.github/workflows/pre-release-base.yml +++ b/.github/workflows/pre-release-base.yml @@ -74,6 +74,7 @@ jobs: context: . push: true file: ./docker/build_and_push_base.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" tags: | langflowai/langflow:base-${{ needs.release.outputs.version }} + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false diff --git a/.github/workflows/pre-release-langflow.yml b/.github/workflows/pre-release-langflow.yml index 79c1d6af5..879fb9da5 100644 --- a/.github/workflows/pre-release-langflow.yml +++ b/.github/workflows/pre-release-langflow.yml @@ -80,7 +80,8 @@ jobs: context: . push: true file: ./docker/build_and_push.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false tags: | langflowai/langflow:${{ needs.release.outputs.version }} langflowai/langflow:1.0-alpha @@ -90,7 +91,8 @@ jobs: context: . push: true file: ./docker/frontend/build_and_push_frontend.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false tags: | langflowai/langflow-frontend:${{ needs.release.outputs.version }} langflowai/langflow-frontend:1.0-alpha @@ -102,7 +104,8 @@ jobs: context: . push: true file: ./docker/build_and_push_backend.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false build-args: | LANGFLOW_IMAGE=langflowai/langflow:${{ needs.release.outputs.version }} tags: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 364289b90..e27836ee3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,8 @@ jobs: context: . push: true file: ./docker/build_and_push.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false tags: | langflowai/langflow:${{ steps.check-version.outputs.version }} langflowai/langflow:latest @@ -64,7 +65,8 @@ jobs: context: . push: true file: ./docker/build_and_push_backend.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false build-args: | LANGFLOW_IMAGE=langflowai/langflow:${{ steps.check-version.outputs.version }} tags: | @@ -76,7 +78,8 @@ jobs: context: . push: true file: ./docker/frontend/build_and_push_frontend.Dockerfile - platforms: "linux/amd64,linux/arm64/v8" + # provenance: false will result in a single manifest for all platforms which makes the image pullable from arm64 machines via the emulation (e.g. Apple Silicon machines) + provenance: false tags: | langflowai/langflow-frontend:${{ steps.check-version.outputs.version }} langflowai/langflow-frontend:latest