[INFRA] Cache CI engine archives per URL with a reusable action#7561
Closed
pan3793 wants to merge 6 commits into
Closed
[INFRA] Cache CI engine archives per URL with a reusable action#7561pan3793 wants to merge 6 commits into
pan3793 wants to merge 6 commits into
Conversation
Its last consumer, the gluten workflow, was removed in KYUUBI apache#7562; the master.yml jobs now provision engines via the download-archive action. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… tests Exposing SPARK_HOME into the CI environment disables the spark-home-from-archive profile (activated by !env.SPARK_HOME), which was the only place setting the scalatest environment variables. As a result SPARK_SCALA_VERSION was no longer set, so Spark local-cluster tests such as FinalStageResourceManagerSuite failed to launch executors against the downloaded binary distribution and hung until timeout. SPARK_SCALA_VERSION is always derivable from the build, so set it unconditionally in the base build; keep SPARK_HOME in the profile so it is only supplied when the environment does not already provide it. Maven merges the two environmentVariables maps, so both are present when the profile is active.
Member
Author
|
now the engine binary tarball takes less than 10s to download when hitting cache |
wForget
approved these changes
Jul 14, 2026
wangzhigang1999
approved these changes
Jul 14, 2026
wangzhigang1999
left a comment
Contributor
There was a problem hiding this comment.
Nice work, thanks!
pan3793
added a commit
that referenced
this pull request
Jul 14, 2026
…le action
### Why are the changes needed?
The old `cache-engine-archives` cache is one blob under a constant key, so bumping any
engine invalidates all of them. This provisions engines explicitly instead:
- New reusable action `.github/actions/download-archive` downloads a tarball and caches it
with `actions/cache` **keyed by the URL** (atomic download), so each engine caches
independently and stable versions restore instantly.
- `.github/scripts/resolve-engine-archive-urls.sh` derives each URL from the Maven
properties (honoring the build's profiles/`-D` overrides); `expose-engine-homes.sh`
publishes `SPARK_HOME`/`HIVE_HOME`/`FLINK_HOME` from `/opt`.
- Every `master.yml` job now resolves → downloads → exposes only the engines it needs, and
the build runs with `-P{spark,flink,hive}-provided`. The now-orphaned
`cache-engine-archives` action is removed.
- Flink test helpers now honor `FLINK_HOME` first (fallback to the download dir for local
runs), matching Spark/Hive.
- Spark extension modules gain a `spark-home-from-archive` profile, auto-activated only when
`SPARK_HOME` is unset, so the Standalone-cluster tests use the downloaded archive locally
but a provided `SPARK_HOME` is no longer overridden.
- The `hive-it` avatica/CALCITE-1224 hack is now a single `zip -d`.
### How was this patch tested?
Run by this PR's CI.
Locally checked: URL resolution across all matrix cases (Scala 2.13, Spark/Flink/Hive
version overrides, CDH6 empty-query), `*_HOME` resolution, the `closer.lua` redirect for
`curl -fSL`, the `zip -d` patch on a mock jar, and the extension `SPARK_HOME` profile via
the effective POM (inherits the env when set, falls back to the archive otherwise).
### Was this patch authored or co-authored using generative AI tooling?
Assisted-by: Claude Opus 4.8
Closes #7561 from pan3793/gha-dl.
Closes #7561
1f9ad04 [Cheng Pan] [INFRA] Restore SPARK_SCALA_VERSION for Spark extension local-cluster tests
20a94b2 [Cheng Pan] [INFRA] Bump actions/cache to v6 in download-archive action
a5c4208 [Cheng Pan] fix spark extension standalone tests
0010f4e [Cheng Pan] [INFRA] Remove orphaned cache-engine-archives action
da90a49 [Cheng Pan] nit
13948d3 [Cheng Pan] [INFRA] Cache CI engine archives per URL with a reusable action
Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 445a906)
Signed-off-by: Cheng Pan <chengpan@apache.org>
Member
Author
|
thanks, merged to master/1.11 |
pan3793
added a commit
that referenced
this pull request
Jul 14, 2026
…eusable action
The old `cache-engine-archives` cache is one blob under a constant key, so bumping any
engine invalidates all of them. This provisions engines explicitly instead:
- New reusable action `.github/actions/download-archive` downloads a tarball and caches it
with `actions/cache` **keyed by the URL** (atomic download), so each engine caches
independently and stable versions restore instantly.
- `.github/scripts/resolve-engine-archive-urls.sh` derives each URL from the Maven
properties (honoring the build's profiles/`-D` overrides); `expose-engine-homes.sh`
publishes `SPARK_HOME`/`HIVE_HOME`/`FLINK_HOME` from `/opt`.
- Every `master.yml` job now resolves → downloads → exposes only the engines it needs, and
the build runs with `-P{spark,flink,hive}-provided`. The now-orphaned
`cache-engine-archives` action is removed.
- Flink test helpers now honor `FLINK_HOME` first (fallback to the download dir for local
runs), matching Spark/Hive.
- Spark extension modules gain a `spark-home-from-archive` profile, auto-activated only when
`SPARK_HOME` is unset, so the Standalone-cluster tests use the downloaded archive locally
but a provided `SPARK_HOME` is no longer overridden.
- The `hive-it` avatica/CALCITE-1224 hack is now a single `zip -d`.
Run by this PR's CI.
Locally checked: URL resolution across all matrix cases (Scala 2.13, Spark/Flink/Hive
version overrides, CDH6 empty-query), `*_HOME` resolution, the `closer.lua` redirect for
`curl -fSL`, the `zip -d` patch on a mock jar, and the extension `SPARK_HOME` profile via
the effective POM (inherits the env when set, falls back to the archive otherwise).
Assisted-by: Claude Opus 4.8
Closes #7561 from pan3793/gha-dl.
Closes #7561
1f9ad04 [Cheng Pan] [INFRA] Restore SPARK_SCALA_VERSION for Spark extension local-cluster tests
20a94b2 [Cheng Pan] [INFRA] Bump actions/cache to v6 in download-archive action
a5c4208 [Cheng Pan] fix spark extension standalone tests
0010f4e [Cheng Pan] [INFRA] Remove orphaned cache-engine-archives action
da90a49 [Cheng Pan] nit
13948d3 [Cheng Pan] [INFRA] Cache CI engine archives per URL with a reusable action
Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
pan3793
added a commit
that referenced
this pull request
Jul 14, 2026
Backport of #7564 to branch-1.10. Combined with the parent backport of #7561 (2a278f2), this brings the GHA modernization (#7561 + #7564) to the 1.10 maintenance branch. Bring all GitHub Actions references on branch-1.10 to the latest, ASF-allowlist-compliant versions (matching master). The version normalization is reimplemented rather than cherry-picked, because master's #7564 delta (v7.0.0 -> v7, etc.) is anchored on versions branch-1.10 never carried; bumping branch-1.10's baseline directly is the conflict-free equivalent. Trusted actions (-> latest major tag): actions/checkout v4 -> v7 actions/setup-java v4 -> v5 actions/setup-python v5 -> v6 actions/setup-node v4 -> v6 actions/stale v9 -> v10 actions/upload-artifact v4 -> v7 actions/dependency-review-action v4 -> v5 actions/first-interaction v1 -> v3 actions/labeler v5 -> v6 (.github/labeler.yml already v6-schema) codecov/codecov-action v3 -> v7 actions/cache v4 -> v6 (in .github/actions/setup-maven; @v6 elsewhere unchanged) Docker actions (-> latest allowlist hash + tag comment): docker/build-push-action -> 53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 docker/setup-buildx-action -> bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 docker/setup-qemu-action -> 96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 docker/login-action -> af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 github/super-linter/slim@v7 was already latest; unchanged.
Member
Author
|
backported to branch-1.10 too |
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.
Why are the changes needed?
The old
cache-engine-archivescache is one blob under a constant key, so bumping anyengine invalidates all of them. This provisions engines explicitly instead:
.github/actions/download-archivedownloads a tarball and caches itwith
actions/cachekeyed by the URL (atomic download), so each engine cachesindependently and stable versions restore instantly.
.github/scripts/resolve-engine-archive-urls.shderives each URL from the Mavenproperties (honoring the build's profiles/
-Doverrides);expose-engine-homes.shpublishes
SPARK_HOME/HIVE_HOME/FLINK_HOMEfrom/opt.master.ymljob now resolves → downloads → exposes only the engines it needs, andthe build runs with
-P{spark,flink,hive}-provided. The now-orphanedcache-engine-archivesaction is removed.FLINK_HOMEfirst (fallback to the download dir for localruns), matching Spark/Hive.
spark-home-from-archiveprofile, auto-activated only whenSPARK_HOMEis unset, so the Standalone-cluster tests use the downloaded archive locallybut a provided
SPARK_HOMEis no longer overridden.hive-itavatica/CALCITE-1224 hack is now a singlezip -d.How was this patch tested?
Run by this PR's CI.
Locally checked: URL resolution across all matrix cases (Scala 2.13, Spark/Flink/Hive
version overrides, CDH6 empty-query),
*_HOMEresolution, thecloser.luaredirect forcurl -fSL, thezip -dpatch on a mock jar, and the extensionSPARK_HOMEprofile viathe effective POM (inherits the env when set, falls back to the archive otherwise).
Was this patch authored or co-authored using generative AI tooling?
Assisted-by: Claude Opus 4.8