feat: stage-isolated infrastructure — separate Postgres DBs, Redis DBs, and MinIO bucket prefixes per stage

This commit is contained in:
Celes Renata
2026-04-19 22:20:03 +00:00
parent 2621b3c5c5
commit 5c63264393
10 changed files with 96 additions and 30 deletions
+14 -8
View File
@@ -99,15 +99,21 @@ class RetentionConfig:
# Map bucket names to RetentionConfig field names
# Uses _bucket() so retention cleanup targets the correct stage-specific buckets
def _bucket(name: str) -> str:
"""Apply DEPLOY_STAGE prefix to a bucket name."""
prefix = os.getenv("DEPLOY_STAGE", "")
return f"{prefix}-{name}" if prefix else name
BUCKET_RETENTION_FIELDS: dict[str, str] = {
"stonks-raw-market": "raw_market_days",
"stonks-raw-news": "raw_news_days",
"stonks-raw-filings": "raw_filings_days",
"stonks-normalized": "normalized_days",
"stonks-llm-prompts": "llm_prompts_days",
"stonks-llm-results": "llm_results_days",
"stonks-lakehouse": "lakehouse_days",
"stonks-audit": "audit_days",
_bucket("stonks-raw-market"): "raw_market_days",
_bucket("stonks-raw-news"): "raw_news_days",
_bucket("stonks-raw-filings"): "raw_filings_days",
_bucket("stonks-normalized"): "normalized_days",
_bucket("stonks-llm-prompts"): "llm_prompts_days",
_bucket("stonks-llm-results"): "llm_results_days",
_bucket("stonks-lakehouse"): "lakehouse_days",
_bucket("stonks-audit"): "audit_days",
}