Live data path#357
Open
Dagonite wants to merge 4 commits into
Open
Conversation
Pasarus
requested changes
May 7, 2026
Pasarus
left a comment
Member
There was a problem hiding this comment.
Probably a small rework needed on this see comments.
| LiveDataRouter = APIRouter(prefix="/live") | ||
|
|
||
| CEPH_DIR = os.environ.get("CEPH_DIR", "/ceph") | ||
| GENERIC_DIR = "GENERIC" if os.environ.get("PRODUCTION", "").lower() == "true" else "GENERIC-staging" |
Member
There was a problem hiding this comment.
We should probably rename this, and rethink about the implementation so we can change the path from gitops.
Suggested change
| GENERIC_DIR = "GENERIC" if os.environ.get("PRODUCTION", "").lower() == "true" else "GENERIC-staging" | |
| LIVE_DATA_PATH = os.environ.get("LIVE_DATA_PATH", "GENERIC-staging") # Prod should be "GENERIC" |
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
| PRODUCTION = os.environ.get("PRODUCTION", "False").lower() == "true" |
Member
There was a problem hiding this comment.
Probably a rethink about if we need this as above.
| """ | ||
| instrument_upper = instrument.upper() | ||
| live_data_path = Path(ceph_dir) / "GENERIC" / "livereduce" / instrument_upper | ||
| generic_dir = "GENERIC" if PRODUCTION else "GENERIC-staging" |
Member
There was a problem hiding this comment.
If we end up keeping this generic dir strategy that is determined from PRODUCTION env var, we should just define the path as the global variable instead of doing it here. We do that in the the live_data.py file (and other places) so let's maintain the same methodology.
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.
Rebase of #312.
Description
Adds a new env var and bases live data path on it.
Adds test cases.