From 66e9cf58e46828ec43670ac3b67ebfc0b63651d2 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Wed, 23 Jul 2025 12:51:55 -0300 Subject: [PATCH] SIENTIAPDE-1171 SIENTIAPDE-1171 feat: add minimal retrain schedule configuration to samples.json and update formatters.py - Added a new schedule configuration for the minimal retrain pipeline in samples.json. - Updated the Formatters class in formatters.py to handle the new minimal retrain workflow type, integrating the minimal_retrain function for streamlined processing. --- orchestrator/activities/formatters.py | 9 +++++++++ samples.json | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) 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": {