Files
sientia-dataops-model-manager/model_manager/runtime_paths.py
vitor-aignosi c0bef2d688 feat: update values.yaml and refactor cleanup paths
- Changed project name in values.yaml from "sientia-dataops-model-manager" to "sientia-model-manager".
- Added new environment variables for GitHub repository and branch configuration.
- Refactored cleanup paths to use a centralized REPORTS_TEMP_DIR constant for consistency.
- Updated runtime configurations and adjusted volume mounts for better resource management.
- Enabled SSH access for the model manager and disabled Grafana dashboard creation.
- Updated tests to reflect changes in directory paths and environment variable usage.
2026-04-09 16:37:36 -03:00

27 lines
1.1 KiB
Python

"""Filesystem layout for worker runtime data outside the application package tree."""
from os import makedirs
from os.path import join
# Root for all mutable runtime data (not under /app; avoids clashing with git clone under /app).
RUNTIME_DATA_ROOT = '/var/lib/model-manager'
# Training reports (HTML, CSV exports, etc.) and related outputs.
REPORTS_ROOT = join(RUNTIME_DATA_ROOT, 'reports')
# Per-training run folders (name + timestamp); cleanup cron deletes stale entries here.
REPORTS_TEMP_DIR = join(REPORTS_ROOT, 'temp')
# Worker log files when file logging is wired; stdout remains primary until then.
LOGS_DIR = join(RUNTIME_DATA_ROOT, 'logs')
def ensure_runtime_directories() -> None:
"""Create runtime directories expected by the worker process."""
# REPORTS_ROOT: base directory for report artifacts; remove if all outputs move elsewhere.
makedirs(REPORTS_ROOT, exist_ok=True)
# REPORTS_TEMP_DIR: transient run subdirs; remove after retention/cleanup is centralized.
makedirs(REPORTS_TEMP_DIR, exist_ok=True)
# LOGS_DIR: on-disk logs; remove if logging stays stdout-only forever.
makedirs(LOGS_DIR, exist_ok=True)