You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2024/02/16 18:50:21 UTC

(superset) 01/01: feat(ci): no more docker builds on PR-related events

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

maximebeauchemin pushed a commit to branch no_docker_on_prs
in repository https://gitbox.apache.org/repos/asf/superset.git

commit f3605aa942c9c0daad62ff00c331d38ece0ba97b
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Fri Feb 16 10:43:27 2024 -0800

    feat(ci): no more docker builds on PR-related events
    
    Speaking with the devexp committee, and in the recent community hall
    meeting, it's pretty clear we don't need to build the whole docker
    matrix on every PR event. It's somewhat expensive and isn't useful.
    
    One of the reason we did it, from what I've gathered, is we want to
    catch if some change breaks the docker build for whatever reason. Now
    we may not need to actively prevent this pre-merge as this is unlikely,
    yet we can still catch it on `master` as I'm keeping the push events on
    master.
    
    Note that:
    - I'm also moving the master push build to be multi-platform (amd+arm)
      as we started doing this for the release builds, which is nice as
      the same image can be used on different archs
    - The PR events were not "pushed" or cached in our shared, remote
      dockerhub-hosted repo anyways, they were just kind of dry-runs
    
    Oh one more thing, notice the no-op.yml changes? That's because the
    required checks related to branch protection are always based on what's
    defined on .asf.yml ON `master`, meaning i need to add dummy/no-op
    checks to get this merged, and those can be cleaned up later on in a
    follow up PR. Let me know if you know a better way to deal with this.
---
 .asf.yaml                    |  8 --------
 .github/workflows/docker.yml | 17 ++++++-----------
 .github/workflows/no-op.yml  | 25 +++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 180414f24a..e1904d082f 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -73,14 +73,6 @@ github:
           - test-postgres (3.9)
           - test-postgres (3.10)
           - test-sqlite (3.9)
-          - docker-build (dev, linux/amd64)
-          - docker-build (lean, linux/amd64)
-          - docker-build (py310, linux/arm64)
-          - docker-build (py310, linux/amd64)
-          - docker-build (websocket, linux/arm64)
-          - docker-build (websocket, linux/amd64)
-          - docker-build (dockerize, linux/arm64)
-          - docker-build (dockerize, linux/amd64)
 
       required_pull_request_reviews:
         dismiss_stale_reviews: false
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index ae54835e0f..0a46872b39 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -4,8 +4,6 @@ on:
   push:
     branches:
       - 'master'
-  pull_request:
-    types: [synchronize, opened, reopened, ready_for_review]
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
@@ -18,14 +16,6 @@ jobs:
     strategy:
       matrix:
         build_preset: ["dev", "lean", "py310", "websocket", "dockerize"]
-        platform: ["linux/amd64", "linux/arm64"]
-        exclude:
-          # disabling because slow! no python wheels for arm/py39 and
-          # QEMU is slow!
-          - build_preset: "dev"
-            platform: "linux/arm64"
-          - build_preset: "lean"
-            platform: "linux/arm64"
       fail-fast: false
     steps:
       - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
@@ -46,4 +36,9 @@ jobs:
           DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
         run: |
           pip install click
-          ./scripts/build_docker.py ${{ matrix.build_preset }} ${{ github.event_name }} --platform ${{ matrix.platform }}
+          ./scripts/build_docker.py \
+            ${{ matrix.build_preset }} \
+            ${{ github.event_name }} \
+            --build_context_ref "$RELEASE" $FORCE_LATEST \
+            --platform "linux/arm64" \
+            --platform "linux/amd64"
diff --git a/.github/workflows/no-op.yml b/.github/workflows/no-op.yml
index 835063640a..c114a27009 100644
--- a/.github/workflows/no-op.yml
+++ b/.github/workflows/no-op.yml
@@ -43,6 +43,23 @@ jobs:
           exit 0
 
   python-lint:
+    strategy:
+      matrix:
+        build_preset: ["dev", "lean", "py310", "websocket", "dockerize"]
+        platform: ["linux/amd64", "linux/arm64"]
+        exclude:
+          - build_preset: "dev"
+            platform: "linux/arm64"
+          - build_preset: "lean"
+            platform: "linux/arm64"
+    runs-on: ubuntu-latest
+    steps:
+      - name: No-op for python-lint
+        run: |
+          echo "This is a no-op step for python-lint to ensure a successful status."
+          exit 0
+  # section to be deleted after master merge
+  docker:
     strategy:
       matrix:
         python-version: ["3.9"]
@@ -52,3 +69,11 @@ jobs:
         run: |
           echo "This is a no-op step for python-lint to ensure a successful status."
           exit 0
+          - docker-build (dev, linux/amd64)
+          - docker-build (lean, linux/amd64)
+          - docker-build (py310, linux/arm64)
+          - docker-build (py310, linux/amd64)
+          - docker-build (websocket, linux/arm64)
+          - docker-build (websocket, linux/amd64)
+          - docker-build (dockerize, linux/arm64)
+          - docker-build (dockerize, linux/amd64)