SIENTIAPDE-1350: Implement scheduled cleanup workflow using Temporal schedules. Adds schedule creation to worker startup and configures environment variables.

This commit is contained in:
Bruno Domingues
2025-11-25 18:12:53 -03:00
parent 9ecac9c8fd
commit b028dc1b7d
10 changed files with 140 additions and 7 deletions

View File

@@ -37,6 +37,7 @@ with workflow.unsafe.imports_passed_through():
from model_manager import metrics
from model_manager.activities.activities import Activities
from model_manager.schedules.cleanup_schedule import create_cleanup_schedule
from model_manager.utils.connectors_config import (
build_minio_config,
build_mlflow_config,
@@ -117,6 +118,14 @@ async def main():
logger.custom_info(f'Temporal client initialized at {host}', metadata)
# Create cleanup schedule (idempotent - only creates if doesn't exist)
try:
await create_cleanup_schedule(temporal_client, logger, metadata)
except Exception as e: # noqa: BLE001
logger.custom_error(f'Failed to configure cleanup schedule: {e}', metadata)
# Don't fail the worker startup if schedule creation fails
# The schedule can be created manually if needed
workers = [
Worker(
temporal_client,