Repository navigation
Fix ML container publishing in push3XX tasks - #40343
Merged
Merged
Conversation
Contributor
Author
|
R: @jrmccluskey |
Contributor
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
jrmccluskey
approved these changes
Sep 29, 2026
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.
Context & Root Cause
ML containers haven't been published since 2.73.0 because of a lazy task-configuration closure bug in
sdks/python/container/build.gradle:tasks.register("push" + cur) { ... }configures the task lazily—the closure only executes when the task (e.g.:sdks:python:container:push310) is realized, which happens after theforloop has already finished.String cur = "3" + iis a fresh local variable scoped to each loop iteration, the loop counteriis a single mutable variable shared across the loop and captured by reference in the closure.max_python_versionis14, by the time thetasks.registerclosure runs for anypush3XXtask, the loop has completed andiis15.i < 14evaluates15 < 14(false) for every Python version (push310,push311,push312,push313), so:sdks:python:container:ml:push3XXis never added todependsOn.This was introduced in commit
86ca83e81dd(#38221 on April 17, 2026), which is why2.73.0(cut April 16, 2026) was the last release with tags pushed toapache/beam_python3.*_sdk_mlon Docker Hub.Fix
Check
cur != "314"instead ofi < 14inside thetasks.registerclosure so the iteration-scopedcurvariable is used when the task is realized.