Open
Conversation
Signed-off-by: Niels Bantilan <niels.bantilan@gmail.com>
Signed-off-by: Niels Bantilan <niels.bantilan@gmail.com>
pingsutw
reviewed
Mar 13, 2026
| if raw_data_path: | ||
| from flyte.app._context import set_raw_data_path | ||
|
|
||
| set_raw_data_path(raw_data_path) |
Member
There was a problem hiding this comment.
Instead of updating the env var in set_raw_data_path, would it be better to just pass raw_data_path to _serve()?
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.
This pull request introduces support for configuring and accessing the raw data path in Flyte apps, enabling applications to read the raw data path from the app context. The changes allow the raw data path to be set via command-line options, environment variables, or programmatically, and ensure it is correctly propagated in local and remote serving scenarios. An example FastAPI app is also added to demonstrate this new feature.
Raw Data Path Support
raw_data_pathattribute to theAppContextdataclass and exposed it via thectx()function, allowing apps to access the raw data path. Also implemented theset_raw_data_path()function to set this value and propagate it via environment variables for thread safety. (src/flyte/app/_context.py)_Serve) and its factory function (with_servecontext) to accept and propagate theraw_data_pathparameter, defaulting to/tmp/flyte/raw_datafor local mode. The serving logic ensures the raw data path is set in the correct thread context for request handlers. (src/flyte/_serve.py)* Extended the CLI (serve.py) to accept a--raw-data-pathoption and set the raw data path in the app context when provided. (src/flyte/_bin/serve.py)src/flyte/app/_app_environment.py)Documentation and Example
app_with_raw_data_path.py) that demonstrates accessing the raw data path from the app context and returning it in an API response. (examples/apps/app_with_raw_data_path.py)