This is an automated email from the ASF dual-hosted git repository.
zhengruifeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 0af3d6ad7ce4 [SPARK-61446][INFRA] Remove per-shard compilation
fallback in Maven and hosted Python CI
0af3d6ad7ce4 is described below
commit 0af3d6ad7ce4bd5d14a31717f632c11f0d811a53
Author: Ruifeng Zheng <[email protected]>
AuthorDate: Thu Nov 12 15:07:02 2026 +0800
[SPARK-61446][INFRA] Remove per-shard compilation fallback in Maven and
hosted Python CI
JIRA: [SPARK-61446](https://issues.apache.org/jira/browse/SPARK-61446)
### What changes were proposed in this pull request?
Require successful shared precompilation and artifact restoration before
running the Maven and hosted PySpark test matrices.
The compilation fallback has already been removed from
`build_and_test.yml`, which requires successful shared precompilation and
artifact restoration. This PR aligns the Maven and hosted PySpark workflows
with that existing behavior.
Remove the precompile jobs' `continue-on-error`, the matrix jobs'
dependency-status override, and error suppression around downloading and
extracting the compiled artifact. Remove the per-shard full Maven build branch
and always set `SKIP_SCALA_BUILD=true` for hosted PySpark tests after artifact
restoration. Preserve the assembly build required by Maven Connect tests.
Retain compile artifacts for seven days so failed shards can be rerun
later. Use Bash with `pipefail` when packaging and extracting the required
artifacts. Pin shard checkout to the precompiled revision, remove unused
restore step IDs, and skip the unused Coursier cache restore in hosted Python
shards.
This is a standalone change based on master. Timeout changes are tracked
separately in #60318.
### Why are the changes needed?
The shared precompile approach is stable enough to make successful
precompilation a prerequisite: **176 of 179 precompile attempts succeeded
(98.3%)** in a sample of the latest 30 completed `master` runs for each of the
six callers. The sample includes precompile jobs from both successful and
failed workflow runs.
| Caller | Successful precompiles | Failed precompiles |
|---|---:|---:|
| Maven default | 30/30 | 0 |
| Maven Java 25 | 30/30 | 0 |
| Maven ARM | 29/30 | 1 |
| Maven macOS | 29/30 | 1 |
| Hosted Python ARM | 29/29 | 0 |
| Hosted Python macOS | 29/30 | 1 |
The three failures were an [artifact-upload
failure](https://github.com/apache/spark/actions/runs/32041418506/job/95421287222),
a [job failure without a recorded failing
step](https://github.com/apache/spark/actions/runs/37367194229/job/111955093080),
and the [compiler
error](https://github.com/apache/spark/actions/runs/41736782201/job/126267913955)
discussed below. In the compiler-error case, all ten fallback shards also
failed. These results support requiring the shared build and re [...]
Sample collected on 2026-11-11: 180 workflow runs, with one older run
lacking a precompile job excluded. Per-caller sampling windows span
June-November 2026, depending on workflow frequency.
A compiler error in shared precompilation is repeated by every shard that
falls back to compiling the same revision locally. For example, [this hosted
PySpark
precompile](https://github.com/apache/spark/actions/runs/41736782201/job/126267913955)
failed on `AddCheckConstraint` pattern compiler errors. All ten downstream
shards then attempted the local-build fallback and failed.
Failing precompilation once and skipping its dependent test jobs avoids
those repeated builds. Artifact download or extraction failures now fail the
affected shard, so a transient artifact failure requires a rerun instead of a
full local compilation.
### Does this PR introduce _any_ user-facing change?
No. This changes CI failure handling only.
### How was this patch tested?
- Ran actionlint 1.7.12 across all workflows, with optional shellcheck and
pyflakes checks disabled, and `git diff --check`.
- Validated Bash syntax for all shell steps in both modified workflows.
- Ran 13 packaging/extraction checks with real tar/find commands and
controlled failure shims. Healthy pipelines passed; find, tar and decompressor
errors failed the step even after producing valid archive data.
- Checked that compile-artifact upload failures remain fatal, artifact
retention is seven days, checkout uses the precompiled SHA, and Python shards
disable Coursier restore.
- Previously ran five shell smoke checks with stubbed Maven/test commands:
Maven Connect, core, and Hive thriftserver; hosted Python normal and packaging
paths. The Connect assembly build remains, Maven invocations stay
module-scoped, and hosted Python tests skip Scala rebuilding.
No Spark compilation or live runs of the modified reusable workflows were
performed. Push CI reported one Kafka real-time window test timeout in the
unchanged `build_and_test.yml` workflow; lint and shared precompilation passed.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex CLI 0.167.0 (GPT-6)
Closes #60328 from zhengruifeng/remove-ci-compile-fallback.
Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
---
.github/workflows/maven_test.yml | 52 +++++++------------------
.github/workflows/python_hosted_runner_test.yml | 27 ++++---------
2 files changed, 22 insertions(+), 57 deletions(-)
diff --git a/.github/workflows/maven_test.yml b/.github/workflows/maven_test.yml
index 80b9102a8243..124e7abc62a2 100644
--- a/.github/workflows/maven_test.yml
+++ b/.github/workflows/maven_test.yml
@@ -53,14 +53,10 @@ on:
default: '{}'
jobs:
# Precompile Spark with Maven once and publish target/ + ~/.m2/.../spark as
- # an artifact for the matrix entries below to consume. Optional: any failure
- # here degrades the matrix to its original local `clean install` path.
+ # an artifact for the matrix entries below to consume.
precompile-maven:
name: "Precompile Spark with Maven"
runs-on: ${{ inputs.os }}
- # If this job fails or is cancelled, the matrix entries fall back to
- # running `mvn clean install` locally as before.
- continue-on-error: true
outputs:
# Pinned so the build job checks out the same snapshot, even if the
branch advances mid-run.
head_sha: ${{ steps.checkout.outputs.head_sha }}
@@ -93,10 +89,11 @@ jobs:
export JAVA_VERSION=${{ inputs.java }}
./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pkubernetes
-Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Pjvm-profiler
-Pspark-ganglia-lgpl -Pkinesis-asl -Pcredential-aws
-Djava.version=${JAVA_VERSION/-ea} clean install
- name: Package compile output
+ shell: bash
run: |
- # Exclude assembly/ from the artifact: 11 of 12 matrix entries wipe
it
- # right after extraction (SPARK-51628
regression-test-for-SPARK-51600),
- # and the connect entry rebuilds it via `mvn install -pl assembly`.
+ # Exclude assembly/ to preserve SPARK-51628 regression coverage of
the
+ # SPARK-51600 fallback when the assembly jars directory is missing.
+ # Only the Connect shard rebuilds assembly before running tests.
find . \( -path './build' -o -path './.git' -o -path './assembly' \)
-prune \
-o -type d -name target -print0 \
| tar --null -cf - -T - | zstd -c -T0 > compile-target.tar.zst
@@ -111,14 +108,13 @@ jobs:
path: |
compile-target.tar.zst
compile-m2-spark.tar.zst
- retention-days: 1
+ retention-days: 7
if-no-files-found: error
# Build: build Spark and run the tests for specified modules using maven
build:
name: "Build modules: ${{ matrix.modules }} ${{ matrix.comment }}"
needs: precompile-maven
- if: (!cancelled())
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
@@ -196,8 +192,7 @@ jobs:
- name: Checkout and sync Spark repository
uses: ./.github/actions/checkout-and-sync
with:
- # Fall back to the branch when the precompile job failed before
resolving the SHA.
- ref: ${{ needs.precompile-maven.outputs.head_sha || inputs.branch }}
+ ref: ${{ needs.precompile-maven.outputs.head_sha }}
- name: Setup build environment
uses: ./.github/actions/setup-build-env
with:
@@ -219,16 +214,11 @@ jobs:
python3.12 -m pip install 'numpy>=1.23.2' pyarrow 'pandas==2.3.3'
pyyaml scipy unittest-xml-reporting 'grpcio==1.84.1' 'grpcio-status==1.84.1'
'protobuf==6.33.5' 'zstandard==0.25.0'
python3.12 -m pip list
- name: Download precompiled artifact
- id: download-precompiled
- if: needs.precompile-maven.result == 'success'
- continue-on-error: true
uses: actions/download-artifact@v8
with:
name: spark-maven-compile-${{ inputs.branch }}-java${{ matrix.java
}}-${{ github.run_id }}
- name: Extract precompiled artifact
- id: extract-precompiled
- if: steps.download-precompiled.outcome == 'success'
- continue-on-error: true
+ shell: bash
run: |
zstd -dc compile-target.tar.zst | tar -xf -
rm compile-target.tar.zst
@@ -256,26 +246,12 @@ jobs:
export ENABLE_KINESIS_TESTS=0
# Replace with the real module name, for example,
connector#kafka-0-10 -> connector/kafka-0-10
export TEST_MODULES=`echo "$MODULES_TO_TEST" | sed -e "s%#%/%g"`
- if [ "${{ steps.extract-precompiled.outcome }}" = "success" ]; then
- echo "Reusing precompiled artifact, skipping local Maven clean
install."
- # SPARK-51628 regression coverage is naturally preserved on the
reuse
- # path: the precompile artifact excludes assembly/, so non-connect
- # tests already run with the assembly module's jars dir missing.
- # Connect tests strongly depend on a built assembly module; rebuild
- # it here.
- if [ "$MODULES_TO_TEST" = "connect" ]; then
- echo "Building assembly module for connect tests."
- ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pkubernetes
-Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Pjvm-profiler
-Pspark-ganglia-lgpl -Pkinesis-asl -Pcredential-aws
-Djava.version=${JAVA_VERSION/-ea} -pl assembly install
- fi
- else
- ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pkubernetes
-Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Pjvm-profiler
-Pspark-ganglia-lgpl -Pkinesis-asl -Pcredential-aws
-Djava.version=${JAVA_VERSION/-ea} clean install
- # SPARK-51628: wipe the assembly module so tests exercise the
- # SPARK-51600 prepend fallback path. Connect tests strongly depend
- # on a built assembly module, so they are excluded.
- if [ "$MODULES_TO_TEST" != "connect" ]; then
- echo "Clean up the assembly module before maven testing"
- ./build/mvn $MAVEN_CLI_OPTS clean -pl assembly
- fi
+ echo "Reusing precompiled artifact, skipping local Maven clean
install."
+ # The artifact excludes assembly/ for SPARK-51628 regression
coverage.
+ # Connect tests require a built assembly module; rebuild it here.
+ if [ "$MODULES_TO_TEST" = "connect" ]; then
+ echo "Building assembly module for connect tests."
+ ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pkubernetes
-Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Pjvm-profiler
-Pspark-ganglia-lgpl -Pkinesis-asl -Pcredential-aws
-Djava.version=${JAVA_VERSION/-ea} -pl assembly install
fi
if [[ "$INCLUDED_TAGS" != "" ]]; then
diff --git a/.github/workflows/python_hosted_runner_test.yml
b/.github/workflows/python_hosted_runner_test.yml
index 5ff58fdf88b7..123e6df6df9c 100644
--- a/.github/workflows/python_hosted_runner_test.yml
+++ b/.github/workflows/python_hosted_runner_test.yml
@@ -57,14 +57,10 @@ on:
default: '{}'
jobs:
# Precompile Spark with SBT once and publish target/ as an artifact for the
- # matrix entries below to consume. Optional: any failure here degrades the
- # matrix to its original local SBT build path.
+ # matrix entries below to consume.
precompile:
name: "Precompile Spark"
runs-on: ${{ inputs.os }}
- # If this job fails or is cancelled, the matrix entries fall back to
- # running the SBT build locally as before.
- continue-on-error: true
outputs:
# Pinned so the build job checks out the same snapshot, even if the
branch advances mid-run.
head_sha: ${{ steps.checkout.outputs.head_sha }}
@@ -93,6 +89,7 @@ jobs:
-Pdocker-integration-tests -Pvolcano \
Test/package streaming-kinesis-asl-assembly/assembly
connect/assembly assembly/package
- name: Package compile output
+ shell: bash
run: |
find . -type d -name target -not -path './build/*' -not -path
'./.git/*' -print0 \
| tar --null -cf - -T - | zstd -c -T0 > compile-artifact.tar.zst
@@ -102,13 +99,12 @@ jobs:
with:
name: spark-compile-${{ inputs.os }}-${{ inputs.branch }}-${{
github.run_id }}
path: compile-artifact.tar.zst
- retention-days: 1
+ retention-days: 7
if-no-files-found: error
build:
name: "Build modules: ${{ matrix.modules }}"
needs: precompile
- if: (!cancelled())
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
@@ -158,12 +154,12 @@ jobs:
- name: Checkout and sync Spark repository
uses: ./.github/actions/checkout-and-sync
with:
- # Fall back to the branch when the precompile job failed before
resolving the SHA.
- ref: ${{ needs.precompile.outputs.head_sha || inputs.branch }}
+ ref: ${{ needs.precompile.outputs.head_sha }}
- name: Setup build environment
uses: ./.github/actions/setup-build-env
with:
java-version: ${{ matrix.java }}
+ coursier: none
- name: Install Python ${{matrix.python}}
uses: actions/setup-python@v7
with:
@@ -179,16 +175,11 @@ jobs:
- name: List Python packages
run: python${{matrix.python}} -m pip list
- name: Download precompiled artifact
- id: download-precompiled
- if: needs.precompile.result == 'success'
- continue-on-error: true
uses: actions/download-artifact@v8
with:
name: spark-compile-${{ inputs.os }}-${{ inputs.branch }}-${{
github.run_id }}
- name: Extract precompiled artifact
- id: extract-precompiled
- if: steps.download-precompiled.outcome == 'success'
- continue-on-error: true
+ shell: bash
run: |
zstd -dc compile-artifact.tar.zst | tar -xf -
rm compile-artifact.tar.zst
@@ -196,10 +187,8 @@ jobs:
- name: Run tests
env: ${{ fromJSON(inputs.envs) }}
run: |
- if [ "${{ steps.extract-precompiled.outcome }}" = "success" ]; then
- export SKIP_SCALA_BUILD=true
- echo "Reusing precompiled artifact, skipping local SBT build."
- fi
+ export SKIP_SCALA_BUILD=true
+ echo "Reusing precompiled artifact, skipping local SBT build."
if [[ "$MODULES_TO_TEST" == *"pyspark-errors"* ]]; then
export SKIP_PACKAGING=false
echo "Python Packaging Tests Enabled!"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]