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
+3 -1
View File
@@ -12,6 +12,8 @@ from dataclasses import dataclass, field
from datetime import datetime
from typing import Any
from services.shared.storage import _prefixed
@dataclass
class AdapterResult:
@@ -71,7 +73,7 @@ class BaseAdapter(ABC):
Override in subclasses if the bucket differs from the default pattern.
"""
return f"stonks-raw-{self.source_type().replace('_api', '').replace('_', '-')}"
return _prefixed(f"stonks-raw-{self.source_type().replace('_api', '').replace('_', '-')}")
def artifact_path(self, ticker: str, document_id: str, now: datetime) -> str:
"""Build the MinIO object path for a raw artifact.
+2 -1
View File
@@ -20,6 +20,7 @@ import httpx
from bs4 import BeautifulSoup
from services.shared.content import content_hash, normalize_url
from services.shared.storage import _prefixed
from .base import AdapterResult, BaseAdapter
@@ -172,7 +173,7 @@ class WebScrapeAdapter(BaseAdapter):
def bucket_name(self) -> str:
"""Web scrape artifacts go to the news raw bucket."""
return "stonks-raw-news"
return _prefixed("stonks-raw-news")
async def fetch(self, ticker: str, config: dict[str, Any]) -> AdapterResult:
"""Fetch HTML from curated URLs for a given ticker.