Skip to content

Enable Auth Metadata Local Caching in Flyte-SDK#1105

Open
edwardsun-union wants to merge 25 commits into
flyteorg:mainfrom
edwardsun-union:reducerCall
Open

Enable Auth Metadata Local Caching in Flyte-SDK#1105
edwardsun-union wants to merge 25 commits into
flyteorg:mainfrom
edwardsun-union:reducerCall

Conversation

@edwardsun-union

@edwardsun-union edwardsun-union commented May 22, 2026

Copy link
Copy Markdown

- Description

Based on the decision make in eng slack channel. We have decided to enable auth metadata local cache capability in order to reduce the unnecessary GetPublicClientConfig API calls currently existing when executing common tasks such as flyte run workflow. As part of the decision, the cache will be stored within the hidden .flyte directory under home based on the OS.

- Testing

before change:

  1. In local env, create a new config. Example:
    flyte create config --endpoint dns:///dogfood.cloud-staging.union.ai --project edward-test --domain staging --image-builder remote
  2. executing flyte task using the create config. Example test command below:
    flyte -vvv -c ./.flyte/config.yaml run ./basics/types/int_collection.py main --numbers '[1,2,3,4,5,10,20,30]'
    For client configuration refer to dogfood staging config v2
  3. GetPublicClientConfig call occurs for every task run

after change:

  1. repeat the same test steps.
  2. cache file contains auth metadata is generated and stored with all required auth metadata
  3. Repeat the same flyte task run
  4. observed that GetPublicClientConfig API call is not made from Grafana (To differentiate traffic from local env, temporarily bump up connectrpc minor version to such as connectrpc/0.10.1)

@edwardsun-union edwardsun-union force-pushed the reducerCall branch 2 times, most recently from c3c10eb to c9956d8 Compare May 26, 2026 16:37
Comment thread src/flyte/cli/_create.py Outdated
Comment thread src/flyte/config/_internal.py Outdated
Comment thread src/flyte/remote/_client/auth/_authenticators/client_credentials.py Outdated
@edwardsun-union edwardsun-union force-pushed the reducerCall branch 2 times, most recently from 60821f4 to 8b34025 Compare May 26, 2026 20:57
Comment thread src/flyte/config/_config.py Outdated
Comment thread pyproject.toml
Comment thread src/flyte/_initialize.py
Comment thread src/flyte/remote/_client/auth/_client_config.py
Comment thread src/flyte/cli/_create.py Outdated
Comment thread src/flyte/cli/_create.py Outdated
@edwardsun-union edwardsun-union changed the title Reducing GetPublicClientConfig API call For Pkce and ClientCredential Enable Auth Metadata Local Caching in Flyte-SDK Jun 2, 2026
Comment thread src/flyte/cli/_create.py
Comment thread src/flyte/remote/_client/auth/_public_client_cache.py Outdated
Comment thread src/flyte/cli/_create.py Outdated
Comment thread pyproject.toml
"mcp>=1.26.0",
"starlette",
"uvicorn",
"debugpy>=1.8.20",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this needed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this is for enabling breakpoint to help debugging, added as dev dependency only, should be no harm

Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
authorizationHeader=public_client_config.authorization_metadata_key,
redirectUri=public_client_config.redirect_uri,
scopes=list(public_client_config.scopes),
audience=public_client_config.audience,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@pmahindrakar-oss the audience is already refreshed from PublicClientConfig Call here

Signed-off-by: Edward Sun <edward.sun@union.ai>
Signed-off-by: Edward Sun <edward.sun@union.ai>
This reverts commit 2353d31.
Signed-off-by: Edward Sun <edward.sun@union.ai>
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.

2 participants