Normalize GKE workload createTime to RFC 3339 before sending to control plane#1
Open
lokic233 wants to merge 1 commit into
Open
Conversation
…ol plane machinelearning_run() forwards workload_details["creation-timestamp"] verbatim into gke_workload_details["createTime"], which the control plane validates as a google.protobuf.Timestamp. If the injected GKE_DIAGON_METADATA creation-timestamp is not strict RFC 3339, the create request fails with HTTP 400 INVALID_ARGUMENT: "Illegal timestamp format; timestamps must end with 'Z' or have a valid timezone offset." This blocks MLRun creation. Add a best-effort _normalize_rfc3339() helper and apply it at the createTime assignment, so timestamps lacking a 'Z'/offset are normalized to UTC RFC 3339. Unparseable values pass through unchanged (the control plane still validates). Reproduced on google-cloud-mldiagnostics 1.0.2/1.0.3, GKE TPU, single-controller Pathways: the 400 cleared once createTime was RFC 3339, and the MLRun was created. Note: the SDK's own host_utils.get_identifier formats timestamps as "%Y%m%d-%H%M%S" (no 'Z'), so the verbatim pass-through is a latent issue even for the SDK's intended inputs. Reported and authored via Navi on behalf of @lokic233 (dengcchi, Meta MRS-CE).
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
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.
Problem
machinelearning_run()forwardsworkload_details["creation-timestamp"]verbatim intogke_workload_details["createTime"](clients/control_plane_client.py), which the control plane validates as agoogle.protobuf.Timestamp. When the injectedGKE_DIAGON_METADATAcreation-timestampis not strict RFC 3339, the create request fails:This blocks MLRun creation entirely.
Notably, the SDK's own
host_utils.get_identifierformats timestamps as"%Y%m%d-%H%M%S"(noZ), so the verbatim pass-through is a latent issue even for the SDK's intended inputs — not only custom injectors.Fix
Add a best-effort
_normalize_rfc3339()helper and apply it at thecreateTimeassignment. Timestamps lacking aZ/offset are normalized to UTC RFC 3339; unparseable values pass through unchanged (the control plane still validates).Verification
Reproduced on
google-cloud-mldiagnostics1.0.2/1.0.3, GKE TPU (tpu7x), single-controller Pathways: the 400 cleared oncecreateTimewas RFC 3339, and the MLRun was created (ACTIVE). Helper unit-checked across inputs:20260619-174719(the SDK's own%Y%m%d-%H%M%S)2026-06-19T17:47:19.000Z2026-06-20T01:31:33Z2026-06-20T01:31:33.000Z2026-06-20T01:31:33+00:002026-06-20T01:31:33.000Z2026-06-20 01:31:332026-06-20T01:31:33.000Z""""— Reported and authored via Navi on behalf of @lokic233 (Meta MRS-CE).