diff --git a/.github/actions/download-manifests/action.yml b/.github/actions/download-manifests/action.yml index c96fcd704a..47caa42539 100644 --- a/.github/actions/download-manifests/action.yml +++ b/.github/actions/download-manifests/action.yml @@ -14,6 +14,10 @@ inputs: description: Directory to store manifest files required: true type: string + fastBuild: + description: Only build docker-stacks-foundation and base-notebook + required: true + type: bool runs: using: composite @@ -40,81 +44,97 @@ runs: path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: minimal-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: minimal-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: scipy-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: scipy-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: r-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: r-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: julia-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: julia-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: tensorflow-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: tensorflow-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: datascience-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: datascience-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: pyspark-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: pyspark-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: all-spark-notebook-aarch64-history_line path: ${{ inputs.histLineDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: all-spark-notebook-x86_64-history_line path: ${{ inputs.histLineDir }} @@ -141,71 +161,85 @@ runs: path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: minimal-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: minimal-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: scipy-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: scipy-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: r-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: r-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: tensorflow-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: tensorflow-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: datascience-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: datascience-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: pyspark-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: pyspark-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: all-spark-notebook-aarch64-manifest path: ${{ inputs.manifestDir }} - name: Download artifact 📥 uses: actions/download-artifact@v3 + if: ${{ !inputs.fastBuild }} with: name: all-spark-notebook-x86_64-manifest path: ${{ inputs.manifestDir }} diff --git a/.github/workflows/docker-wiki-update.yml b/.github/workflows/docker-wiki-update.yml index c643f5c438..0f6296b8e3 100644 --- a/.github/workflows/docker-wiki-update.yml +++ b/.github/workflows/docker-wiki-update.yml @@ -23,6 +23,7 @@ jobs: with: histLineDir: /tmp/jupyter/hist_lines/ manifestDir: /tmp/jupyter/manifests/ + fastBuild: ${{ contains(github.event.pull_request.title, '[FAST_BUILD]') }} - name: Display structure of downloaded files 🔍️ run: | ls -R /tmp/jupyter/hist_lines/ diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5eb0cb0e37..d8cb21aaba 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,5 +1,10 @@ name: Build, test and push Docker Images +# [FAST_BUILD] in the PR title makes this workflow only build +# `jupyter/docker-stacks-foundation` and `/jupyter/base-notebook` in the PR +# This allows to run CI faster in case where full build is not required +# This only works for `pull_request` event and has no effect on `push` to the `main` branch + on: schedule: # Weekly, at 03:00 on Monday UTC time @@ -99,7 +104,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-base] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-minimal: uses: ./.github/workflows/docker-build-test-upload.yml @@ -109,6 +114,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-base] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-scipy: uses: ./.github/workflows/docker-build-test-upload.yml @@ -118,7 +124,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-minimal] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-scipy: uses: ./.github/workflows/docker-build-test-upload.yml @@ -128,6 +134,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-minimal] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-r: uses: ./.github/workflows/docker-build-test-upload.yml @@ -137,7 +144,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-minimal] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-r: uses: ./.github/workflows/docker-build-test-upload.yml @@ -147,6 +154,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-minimal] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-julia: uses: ./.github/workflows/docker-build-test-upload.yml @@ -156,7 +164,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-minimal] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-julia: uses: ./.github/workflows/docker-build-test-upload.yml @@ -166,6 +174,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-minimal] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-tensorflow: uses: ./.github/workflows/docker-build-test-upload.yml @@ -175,7 +184,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-scipy] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-tensorflow: uses: ./.github/workflows/docker-build-test-upload.yml @@ -185,6 +194,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-scipy] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-datascience: uses: ./.github/workflows/docker-build-test-upload.yml @@ -194,7 +204,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-scipy] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-datascience: uses: ./.github/workflows/docker-build-test-upload.yml @@ -204,6 +214,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-scipy] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-pyspark: uses: ./.github/workflows/docker-build-test-upload.yml @@ -213,7 +224,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-scipy] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-pyspark: uses: ./.github/workflows/docker-build-test-upload.yml @@ -223,6 +234,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-scipy] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-all-spark: uses: ./.github/workflows/docker-build-test-upload.yml @@ -232,7 +244,7 @@ jobs: platform: aarch64 runsOn: ARM64 needs: [aarch64-pyspark] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-all-spark: uses: ./.github/workflows/docker-build-test-upload.yml @@ -242,6 +254,7 @@ jobs: platform: x86_64 runsOn: ubuntu-latest needs: [x86_64-pyspark] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} aarch64-images-tag-push: uses: ./.github/workflows/docker-tag-push.yml @@ -279,7 +292,21 @@ jobs: aarch64-pyspark, aarch64-all-spark, ] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') + + aarch64-images-tag-push-fast: + uses: ./.github/workflows/docker-tag-push.yml + with: + platform: aarch64 + image: ${{ matrix.image }} + secrets: + REGISTRY_USERNAME: ${{ secrets.QUAY_USERNAME }} + REGISTRY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }} + strategy: + matrix: + image: [docker-stacks-foundation, base-notebook] + needs: [aarch64-foundation, aarch64-base] + if: github.repository_owner == 'jupyter' && contains(github.event.pull_request.title, '[FAST_BUILD]') x86_64-images-tag-push: uses: ./.github/workflows/docker-tag-push.yml @@ -317,6 +344,21 @@ jobs: x86_64-pyspark, x86_64-all-spark, ] + if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} + + x86_64-images-tag-push-fast: + uses: ./.github/workflows/docker-tag-push.yml + with: + platform: x86_64 + image: ${{ matrix.image }} + secrets: + REGISTRY_USERNAME: ${{ secrets.QUAY_USERNAME }} + REGISTRY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }} + strategy: + matrix: + image: [docker-stacks-foundation, base-notebook] + needs: [x86_64-foundation, x86_64-base] + if: contains(github.event.pull_request.title, '[FAST_BUILD]') merge-tags: uses: ./.github/workflows/docker-merge-tags.yml @@ -341,12 +383,32 @@ jobs: all-spark-notebook, ] needs: [aarch64-images-tag-push, x86_64-images-tag-push] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') + + merge-tags-fast: + uses: ./.github/workflows/docker-merge-tags.yml + with: + image: ${{ matrix.image }} + secrets: + REGISTRY_USERNAME: ${{ secrets.QUAY_USERNAME }} + REGISTRY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }} + strategy: + matrix: + image: [docker-stacks-foundation, base-notebook] + needs: [aarch64-images-tag-push-fast, x86_64-images-tag-push-fast] + if: github.repository_owner == 'jupyter' && contains(github.event.pull_request.title, '[FAST_BUILD]') wiki-update: uses: ./.github/workflows/docker-wiki-update.yml needs: [aarch64-images-tag-push, x86_64-images-tag-push] - if: github.repository_owner == 'jupyter' + if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]') + permissions: + contents: write + + wiki-update-fast: + uses: ./.github/workflows/docker-wiki-update.yml + needs: [aarch64-images-tag-push-fast, x86_64-images-tag-push-fast] + if: github.repository_owner == 'jupyter' && contains(github.event.pull_request.title, '[FAST_BUILD]') permissions: contents: write