SIENTIAPDE-1251: Implement ML model training activity and repository

This commit introduces the 'Training' activity and 'TrainingRepository' for handling ML model training operations within the Model Manager system.

- Added model_manager/activities/training.py for the Training activity, which extends BaseActivity and integrates with Temporal workflows.
- Added model_manager/utils/repository/training_repository.py for the TrainingRepository, which encapsulates the core training logic.
- Updated model_manager/activities/activities.py to include the Training activity in the main activities orchestrator.
- Updated README.md to document the new 'Training' component.
- Added unit tests for the new activity and repository.
This commit is contained in:
Bruno Domingues
2025-10-09 15:07:27 -03:00
parent c970754e1b
commit bee6036205
7 changed files with 1046 additions and 2 deletions

View File

@@ -10,9 +10,10 @@ with workflow.unsafe.imports_passed_through():
from model_manager.activities.gates import Gates
from model_manager.activities.minio import MinIO
from model_manager.activities.mlflow import MLFlow
from model_manager.activities.training import Training
class Activities(ExperimentTracking, MLFlow, MinIO, Gates):
class Activities(ExperimentTracking, MLFlow, MinIO, Gates, Training):
"""
Main activities orchestrator for the Model Manager system.
@@ -25,6 +26,7 @@ class Activities(ExperimentTracking, MLFlow, MinIO, Gates):
- MLFlow: Model inference and transformation operations
- MinIO: Object storage operations (file upload/download/delete)
- Gates: Data quality validation and filtering mechanisms
- Training: ML model training operations (extends BaseActivity)
Attributes:
postgres_config (dict): PostgreSQL connection configuration
@@ -102,6 +104,8 @@ class Activities(ExperimentTracking, MLFlow, MinIO, Gates):
Gates.__init__(self, logger=logger, notification_handler=notification_handler)
Training.__init__(self, logger=logger, notification_handler=notification_handler)
async def shutdown(self):
"""
Gracefully shutdown all activities and clean up resources.