Request cloud-platform scope in ControlPlaneClient credentials (fixes #4)#5
Open
lokic233 wants to merge 1 commit into
Open
Request cloud-platform scope in ControlPlaneClient credentials (fixes #4)#5lokic233 wants to merge 1 commit into
lokic233 wants to merge 1 commit into
Conversation
google.auth.default() was called without scopes. For external_account (Workload Identity Federation) credentials this yields an unscoped credential, which produces a malformed STS token exchange / service-account impersonation and causes the Hypercompute Cluster control plane to reject every request with HTTP 400 INVALID_ARGUMENT. This breaks MLRun create/get for GKE workloads authenticating via WIF. Pass scopes=['https://www.googleapis.com/auth/cloud-platform'] explicitly so token minting is well-formed for both user ADC and external_account creds. Fixes AI-Hypercomputer#4
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.
Summary
ControlPlaneClient.__init__callsgoogle.auth.default()without scopes. Forexternal_account(Workload Identity Federation) credentials this yields an unscoped credential, which makes the downstream STS token exchange / service-account impersonation malformed. The Hypercompute Cluster control plane then rejects every request with HTTP 400INVALID_ARGUMENT, breaking MLRun create/get for any GKE workload that authenticates via WIF.This is deterministic (not transient / propagation-related) and is masked in typical manual testing because interactive user ADC carries an implicit scope.
Fix
Pass the
cloud-platformscope explicitly:external_accountpath.ast.parseOK; applies on currentmain.Testing
Verified on a GKE (TPU v7x, plain-SPMD) workload authenticating as a GSA via Workload Identity Federation (
external_accountADC): before the change,create_ml_run/get_ml_runfailed with400 INVALID_ARGUMENT; after the change, control-plane calls succeed and the MLRun is created.Fixes #4