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.
This commit is contained in:
vitor-aignosi
2025-07-23 12:51:55 -03:00
parent 115a174a31
commit 66e9cf58e4
2 changed files with 20 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
from temporalio import activity, workflow from temporalio import activity, workflow
from orchestrator.utils.orchestrator_functions import minimal_retrain
with workflow.unsafe.imports_passed_through(): with workflow.unsafe.imports_passed_through():
import json import json
@@ -67,6 +69,13 @@ class Formatters(BaseActivity):
"updated_at": pipeline.get( "updated_at": pipeline.get(
"updated_at", datetime.now().strftime(DEFAULT_DATE_FORMAT)) "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.info("Processed schedules", metadata=metadata)
self.debug(json.dumps( self.debug(json.dumps(

View File

@@ -120,6 +120,16 @@
], ],
"active": true, "active": true,
"updated_at": "2025-07-14 10:00:00.000000" "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": { "opc-servers": {