[SPARK-56830][INFRA] Share SBT compile artifact with python hosted runner CI jobs#56107
Draft
zhengruifeng wants to merge 2 commits into
Draft
[SPARK-56830][INFRA] Share SBT compile artifact with python hosted runner CI jobs#56107zhengruifeng wants to merge 2 commits into
zhengruifeng wants to merge 2 commits into
Conversation
Generated-by: Claude Code (Opus 4.7)
Validation-only commit. Revert before marking PR ready for review. Generated-by: Claude Code (Opus 4.7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR extends the SBT precompile-sharing pattern (parent: SPARK-56830, pyspark: SPARK-56768) to the python-only macOS / ARM workflows that run via
.github/workflows/python_hosted_runner_test.yml.Concretely:
precompilejob inpython_hosted_runner_test.ymlruns Spark's SBT build once on${{ inputs.os }}:target/directory (excluding./build/and./.git/) withtar -czf, uploads asspark-compile-<os>-<branch>-<run_id>withretention-days: 1.precompiletoneeds:andif: (!cancelled()), download/extract the artifact (with graceful fallback), and exportSKIP_SCALA_BUILD=truesodev/run-tests.pyskipsbuild_apache_sparkandbuild_spark_assembly_sbt.if: ${{ runner.os != 'macOS' }}to match the existing TODO(SPARK-54466) pattern in this file: onmacos-26the precompile runs without GHA cache; onubuntu-24.04-armit caches as expected.${{ inputs.os }}so the two callers (build_python_3.12_macos26.ymlandbuild_python_3.12_arm.yml) cannot collide.This benefits both callers of the reusable workflow:
.github/workflows/build_python_3.12_macos26.yml(macos-26).github/workflows/build_python_3.12_arm.yml(ubuntu-24.04-arm)Optional: graceful fallback if precompile fails
Same pattern as SPARK-56768:
precompilehascontinue-on-error: trueso a failed or cancelled precompile does not fail the workflow run.needs.precompile.result == 'success'and itself hascontinue-on-error: true.continue-on-error: true.SKIP_SCALA_BUILD=trueis exported only whensteps.extract-precompiled.outcome == 'success'. Otherwise it stays unset anddev/run-tests.pyfalls back to the original local SBT build.Why are the changes needed?
Today every one of the 9 pyspark matrix entries in
python_hosted_runner_test.ymlruns the same SBT build from scratch. Sharing the compile artifact once across the matrix avoids 8x duplicate SBT compile work per scheduled run ofbuild_python_3.12_macos26.yml(andbuild_python_3.12_arm.yml). This mirrors the savings already realized for the Linux pyspark matrix in SPARK-56768.Does this PR introduce any user-facing change?
No. CI infrastructure change only.
How was this patch tested?
The change is exercised by the CI run of this PR itself. If the precompile job is forced to fail (or its artifact is missing), the matrix entries should still pass via the fallback path. The "Run tests" step logs
Reusing precompiled artifact, skipping local SBT build.to make the fast path visible per matrix entry.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.7)