diff --git a/orchestrator/activities/formatters.py b/orchestrator/activities/formatters.py index 67a6773..5078b12 100644 --- a/orchestrator/activities/formatters.py +++ b/orchestrator/activities/formatters.py @@ -1,6 +1,8 @@ from temporalio import activity, workflow +from orchestrator.utils.orchestrator_functions import minimal_retrain + with workflow.unsafe.imports_passed_through(): import json @@ -67,6 +69,13 @@ class Formatters(BaseActivity): "updated_at": pipeline.get( "updated_at", datetime.now().strftime(DEFAULT_DATE_FORMAT)) } + elif pipeline['workflow_type'] == 'minimal_retrain': + schedule_config[self.laborious_namespace][pipeline['schedule_name'] + ] = { + **minimal_retrain(pipeline), + "updated_at": pipeline.get( + "updated_at", datetime.now().strftime(DEFAULT_DATE_FORMAT)) + } self.info("Processed schedules", metadata=metadata) self.debug(json.dumps( diff --git a/samples.json b/samples.json index 94274ca..882927f 100644 --- a/samples.json +++ b/samples.json @@ -120,7 +120,17 @@ ], "active": true, "updated_at": "2025-07-14 10:00:00.000000" - } + }, + "3": { + "schedule_name": "minimal-retrain-pipeline", + "model_id": "1", + "workflow_type": "minimal_retrain", + "frequency": "5m", + "max_retry_policy": 1, + "query": "select * from sientia_data.laborious_data order by \"timestamp\" desc limit 30;", + "active": true, + "updated_at": "2025-07-23 10:00:00.000000" + } }, "opc-servers": { "1": {