You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/09/14 13:14:11 UTC

[airflow] 01/02: Make "quick build" actually test build time (#26251)

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

ephraimanierobi pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 89c611f0dac69f789605d6e357e807069c8e2135
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Fri Sep 9 15:53:28 2022 +0200

    Make "quick build" actually test build time (#26251)
    
    * Make "quick build" actually test build time
    
    There was a "string" instead of array passed in case of --max-time
    command flag which caused an error - regardless of the time it
    took to run the build, but it was also ignored because the
    job was run within "continue-on-error" cache push job.
    
    This PR fixes it to use proper "exit" command and separates it out
    to a job where quick build failure will be noticed (not in PRs but
    in the merge-run)
    
    (cherry picked from commit 63da96b4331bdc70ec49e360e87610960b31371c)
---
 .github/workflows/ci.yml                           | 39 +++++++++++++++++++++-
 .../airflow_breeze/commands/developer_commands.py  |  2 +-
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 15c51466c4..51fd6ac9b0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -304,7 +304,44 @@ jobs:
       - name: "Clean docker cache for ${{ matrix.platform }}"
         run: docker system prune --all --force
         if: matrix.platform == 'linux/amd64' && needs.build-info.outputs.merge-run == 'true'
-      - name: "Check that image builds quickly ${{ matrix.platform }}"
+      - name: "Fix ownership"
+        run: breeze ci fix-ownership
+        if: always() && needs.build-info.outputs.merge-run == 'true'
+
+  # Check that after earlier cache push, breeze command will build quickly
+  chcek-that-image-builds-quicklly:
+    timeout-minutes: 5
+    name: "Check that image builds quickly"
+    runs-on: ${{ needs.build-info.outputs.runs-on }}
+    needs:
+      - build-info
+      - push-early-buildx-cache-to-github-registry
+    env:
+      RUNS_ON: ${{ needs.build-info.outputs.runs-on }}
+      UPGRADE_TO_NEWER_DEPENDENCIES: false
+      PLATFORM: "linux/amd64"
+    steps:
+      - name: Cleanup repo
+        run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
+        if: needs.build-info.outputs.merge-run == 'true'
+      - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+        uses: actions/checkout@v3
+        with:
+          persist-credentials: false
+        if: needs.build-info.outputs.merge-run == 'true'
+      - name: "Setup python"
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ needs.build-info.outputs.default-python-version }}
+          cache: 'pip'
+          cache-dependency-path: ./dev/breeze/setup*
+        if: needs.build-info.outputs.merge-run == 'true'
+      - run: ./scripts/ci/install_breeze.sh
+        if: needs.build-info.outputs.merge-run == 'true'
+      - name: "Free space"
+        run: breeze ci free-space
+        if: needs.build-info.outputs.merge-run == 'true'
+      - name: "Check that image builds quickly"
         run: breeze shell --max-time 120
         if: matrix.platform == 'linux/amd64' && needs.build-info.outputs.merge-run == 'true'
       - name: "Fix ownership"
diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
index 6d689333dc..5ad16f7731 100644
--- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
@@ -184,7 +184,7 @@ def shell(
         force_build=force_build,
         db_reset=db_reset,
         include_mypy_volume=include_mypy_volume,
-        extra_args=extra_args if not max_time else "exit",
+        extra_args=extra_args if not max_time else ["exit"],
         answer=answer,
         image_tag=image_tag,
         platform=platform,