Skip to content

Fix BazelContainer cloud packaging with unset push_image_tag - #74

Open
rootkiller6788 wants to merge 1 commit into
google-deepmind:mainfrom
rootkiller6788:fix/bazel-container-default-push-tag
Open

Fix BazelContainer cloud packaging with unset push_image_tag#74
rootkiller6788 wants to merge 1 commit into
google-deepmind:mainfrom
rootkiller6788:fix/bazel-container-default-push-tag

Conversation

@rootkiller6788

Copy link
Copy Markdown

Problem

Packaging an xm.BazelContainer for a cloud executor (xm_local.Vertex / xm_local.Kubernetes) crashes when the executor spec does not set push_image_tag (the default). _package_bazel_container passes the resulting None straight into image.tag() and client.images.push(), which fails with AttributeError: 'NoneType' object has no attribute 'rsplit'.

The sibling packaging paths already handle this: _package_dockerfile and _package_python_container fall back to a freshly tagged image in the project's GCR when push_image_tag is unset, and _package_container reuses the image repository when it already points at the project's GCR.

Fix

Add the same default-tag fallback to _package_bazel_container: when push_image_tag is unset, generate a gcr.io/{project}/{target_name}:{timestamp} tag, matching the _package_dockerfile behavior.

Verification

  • push_image_tag is Optional[str] = None on both VertexSpec and KubernetesSpec.
  • _get_push_image_tag returns it unchanged.
  • The xm.BazelContainer cloud path was the only one missing the None guard.

The BazelContainer packaging path passed push_image_tag directly to
image.tag() and images.push() without falling back to a default GCR tag,
so packaging a BazelContainer with a Vertex/Kubernetes executor that does
not set push_image_tag crashed with an AttributeError. Add the same
default-tag fallback already used by the Dockerfile and PythonContainer
paths.
@rootkiller6788
rootkiller6788 marked this pull request as ready for review August 23, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant