This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch use-emulation-for-releasing-images
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 94301dc7b4376e8e6d54ea1b35e9a0b51f6e461b
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Sep 2 19:22:36 2024 +0200

    Switch to using emulation for image building
    
    Until we can use ARM hardware to build images with the new ARC
    architecture https://github.com/apache/airflow/issues/41935
    we switch image building to emulated builds. They are 10x slower
    but it's better than nothing.
---
 .github/workflows/release_dockerhub_image.yml | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/release_dockerhub_image.yml 
b/.github/workflows/release_dockerhub_image.yml
index d45aa2c4be..c06a6cf91a 100644
--- a/.github/workflows/release_dockerhub_image.yml
+++ b/.github/workflows/release_dockerhub_image.yml
@@ -102,15 +102,29 @@ jobs:
         run: breeze ci free-space --answer yes
       - name: "Cleanup dist and context file"
         run: rm -fv ./dist/* ./docker-context-files/*
-      - name: "Start ARM instance"
-        run: ./scripts/ci/images/ci_start_arm_instance_and_connect_to_docker.sh
-        if: github.repository == 'apache/airflow'
       - name: "Login to hub.docker.com"
         run: >
           echo ${{ secrets.DOCKERHUB_TOKEN }} |
           docker login --password-stdin --username ${{ secrets.DOCKERHUB_USER 
}}
       - name: Login to ghcr.io
         run: echo "${{ env.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ 
github.actor }} --password-stdin
+      - name: "Install emulation support and buildx plugin"
+        # yamllint disable rule:line-length
+        run: |
+          sudo apt-get update
+          sudo apt-get install ca-certificates curl
+          sudo install -m 0755 -d /etc/apt/keyrings
+          sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o 
/etc/apt/keyrings/docker.asc
+          sudo chmod a+r /etc/apt/keyrings/docker.asc
+
+          # Add the repository to Apt sources:
+          echo \
+          "deb [arch=$(dpkg --print-architecture) 
signed-by=/etc/apt/keyrings/docker.asc] 
https://download.docker.com/linux/ubuntu \
+          $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
+          sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+          sudo apt-get update
+          sudo apt install docker-buildx-plugin
+          docker run --privileged --rm tonistiigi/binfmt --install all
       - name: "Prepare chicken-eggs provider packages"
         # In case of provider packages which use latest dev0 version of 
providers, we should prepare them
         # from the source code, not from the PyPI because they have 
apache-airflow>=X.Y.Z dependency
@@ -148,9 +162,6 @@ jobs:
           --limit-python ${{ matrix.python-version }} --slim-images
         env:
           COMMIT_SHA: ${{ github.sha }}
-      - name: "Stop ARM instance"
-        run: ./scripts/ci/images/ci_stop_arm_instance.sh
-        if: always() && github.repository == 'apache/airflow'
       - name: >
           Verify regular AMD64 image: ${{ github.event.inputs.airflowVersion 
}}, ${{ matrix.python-version }}
         run: >

Reply via email to