Skip to content

Speed up lang-SDK k8s test by building Go/Java natively in CI#69411

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:speed-up-lang-sdk-k8s-build-with-native-toolchain
Jul 5, 2026
Merged

Speed up lang-SDK k8s test by building Go/Java natively in CI#69411
potiuk merged 2 commits into
apache:mainfrom
potiuk:speed-up-lang-sdk-k8s-build-with-native-toolchain

Conversation

@potiuk

@potiuk potiuk commented Jul 5, 2026

Copy link
Copy Markdown
Member

The Multi-Lang KubernetesExecutor system test (#68709) builds a Go bundle and a Java jar inside throwaway toolchain containers. On a dev host the Go module/build cache, the Gradle distribution and the dependency caches persist between runs, but CI runners are ephemeral and nothing cached them — so every scheduled run re-pulled the golang/eclipse-temurin images and re-downloaded the Gradle distribution and all dependencies. That added ~10 min to each of the six KubernetesExecutor + standard-naming-off variants (the only ones that run the test), which the daily CI duration-trend alert flagged.

This builds the artifacts with the host toolchain in CI instead, provisioned and cached through actions/setup-go and actions/setup-java (the same pattern the sibling Go SDK tests / Java SDK tests jobs already use). A new LANG_SDK_NATIVE_TOOLCHAIN=true env, set only for that variant, makes breeze invoke the host go / ./gradlew rather than docker run. Local runs keep the containerised build, so a dev host still needs neither Go nor a JDK installed.

Measured on run 28635348211: the parallel provisioning block was ~5m36s, almost entirely toolchain-image pulls + cold Gradle/Maven/Go dependency downloads. Removing the image pulls and warming the caches should cut that to ~1–1.5 min (~4 min/job); the subsequent helm upgrade and the test itself are unaffected.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

The Multi-Lang KubernetesExecutor system test builds a Go bundle and a
Java jar inside throwaway toolchain containers. On a dev host the module,
Gradle-distribution and dependency caches persist between runs, but CI
runners are ephemeral and nothing cached them, so every scheduled run
re-pulled the golang/temurin images and re-downloaded the Gradle
distribution and all dependencies — adding roughly ten minutes to each of
the six KubernetesExecutor variants that run the test.

Build the artifacts with the host toolchain in CI instead, provisioned and
cached through actions/setup-go and actions/setup-java, so the toolchain
image pulls and cold dependency downloads no longer happen on every run.
Local runs keep the containerised build so a dev host still needs neither
Go nor a JDK installed.
Follow-ups to the native lang-SDK build:

- Move the JDK version (17) into a JAVA_SDK_VERSION breeze constant and
  surface it as the java-sdk-version selective-checks / build-info output,
  so the k8s workflow reads it instead of hardcoding the version in YAML.
- Restore the Go module/build and Gradle caches with an explicit
  actions/cache keyed on a "-v1-" salt rather than the setup-* built-in
  caching, giving an in-repo knob to force-invalidate a poisoned cache
  (bump the salt) without waiting for a dependency change to rotate it.

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of having "native" host setup for CI to speed up the process! Thanks a lot.

@potiuk

potiuk commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

I like the idea of having "native" host setup for CI to speed up the process! Thanks a lot.

Yeah - while not entirely reproducible, we have the docker run that a) caches nicely for local use b) is reproducible, so we are good with native builds on CI - cache on GitHub is very fast.

@potiuk

potiuk commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

Looks good - Back to 13-15 m from 25!

@potiuk potiuk merged commit 673183b into apache:main Jul 5, 2026
144 checks passed
@potiuk potiuk deleted the speed-up-lang-sdk-k8s-build-with-native-toolchain branch July 5, 2026 11:42
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 673183b v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

jason810496 added a commit that referenced this pull request Jul 8, 2026
…n CI (#69411) (#69580)

* Speed up lang-SDK k8s test by building Go/Java natively in CI

The Multi-Lang KubernetesExecutor system test builds a Go bundle and a
Java jar inside throwaway toolchain containers. On a dev host the module,
Gradle-distribution and dependency caches persist between runs, but CI
runners are ephemeral and nothing cached them, so every scheduled run
re-pulled the golang/temurin images and re-downloaded the Gradle
distribution and all dependencies — adding roughly ten minutes to each of
the six KubernetesExecutor variants that run the test.

Build the artifacts with the host toolchain in CI instead, provisioned and
cached through actions/setup-go and actions/setup-java, so the toolchain
image pulls and cold dependency downloads no longer happen on every run.
Local runs keep the containerised build so a dev host still needs neither
Go nor a JDK installed.

* Centralize lang-SDK JDK version and add a bustable cache key in CI

Follow-ups to the native lang-SDK build:

- Move the JDK version (17) into a JAVA_SDK_VERSION breeze constant and
  surface it as the java-sdk-version selective-checks / build-info output,
  so the k8s workflow reads it instead of hardcoding the version in YAML.
- Restore the Go module/build and Gradle caches with an explicit
  actions/cache keyed on a "-v1-" salt rather than the setup-* built-in
  caching, giving an in-repo knob to force-invalidate a poisoned cache
  (bump the salt) without waiting for a dependency change to rotate it.
(cherry picked from commit 673183b)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants