SIENTIAPDE-1231

Update model retraining and reporting functionality

- Changed the GITHUB_BRANCH value in values.yaml to reflect the latest adjustments for retraining the courier.
- Enhanced the Gates class with a new method `format_retrain_report` to format retraining report data according to storage policies.
- Refactored the MLFlow class to improve error handling during model retraining and return structured output.
- Updated the model_repository to utilize the latest MLFlow API for retrieving model versions and improved logging.
- Modified the minimal_retrain workflow to conditionally update the production model based on retraining success.
This commit is contained in:
vitor-aignosi
2025-09-29 17:34:47 -03:00
parent 1aede51dc1
commit c6f004d20d
7 changed files with 197 additions and 59 deletions

View File

@@ -91,13 +91,29 @@ class MinimalRetrain():
start_to_close_timeout=timedelta(seconds=60)
)
if experiment_response['success']:
update_report = await workflow.execute_activity_method(
Activities.update_production_model,
{
**metadata,
'model_name': model_name,
**experiment_response
},
retry_policy=retry_policy,
start_to_close_timeout=timedelta(seconds=60)
)
else:
update_report = {}
report = await workflow.execute_activity_method(
Activities.update_production_model,
Activities.format_retrain_report,
{
**metadata,
'model_name': model_name,
'experiment_response': experiment_response,
'model_id': input_data['model_id'],
**experiment_response
'model_name': model_name,
'update_report': update_report
},
retry_policy=retry_policy,
start_to_close_timeout=timedelta(seconds=60)