Commit Graph

50 Commits

Author SHA1 Message Date
vitor-aignosi
31e95cbdf8 feat: log regression metrics as parameters in Training class
- Added a method to persist computed regression metrics (MSE, MAE, R²) as MLflow parameters during model training, enhancing model evaluation and tracking.
- Updated the Training class to log the equation path if available, improving artifact management.
2026-04-17 10:52:32 -03:00
vitor-aignosi
b245801e09 fix: clear input example in Training class before model storage
- Set wrapper._input_example to None to ensure no residual data is stored with the model, enhancing data integrity during model storage.
2026-04-16 15:08:26 -03:00
vitor-aignosi
e2b2f702f8 feat: integrate SientiaModel wrapper and enhance logging in Training class
- Imported SientiaModel to standardize the wrapper type in the Training class.
- Added conditional logging to capture training process details when a logger is provided, improving traceability during model training.
2026-04-16 14:51:41 -03:00
vitor-aignosi
1e05ebe147 feat: add experiment_name to TrainModelResult and update training logic
- Introduced experiment_name parameter in TrainModelResult to enhance tracking of training experiments.
- Updated the Training class to utilize run_name and experiment_name for improved MLflow run management.
2026-04-16 09:43:39 -03:00
vitor-aignosi
3bee743cfd feat: enhance training and regression metrics logging
- Added debug logging for data preparation, transformation, and prediction steps in the Training class to improve traceability.
- Updated compute_regression_metrics method to include metadata for better debugging and validation of index alignment between true and predicted values.
2026-04-13 15:18:42 -03:00
vitor-aignosi
388d4c95e4 chore: update configuration and imports for improved functionality
- Updated image tag in values.yaml from "1.0.0" to "1.0.2" for the latest version.
- Modified STORE_BASE_URL to include port 3000 for proper service access.
- Changed import from MinioRepository to MinioRepositorySync for synchronization support.
- Updated import from Postgres to PostgresSync to enhance experiment tracking capabilities.
- Renamed TRAIN_TASK_QUEUE from "train_model-single-queue" to "train_model-basic-queue" for clarity.
2026-04-13 14:57:06 -03:00
vitor-aignosi
c0bef2d688 feat: update values.yaml and refactor cleanup paths
- Changed project name in values.yaml from "sientia-dataops-model-manager" to "sientia-model-manager".
- Added new environment variables for GitHub repository and branch configuration.
- Refactored cleanup paths to use a centralized REPORTS_TEMP_DIR constant for consistency.
- Updated runtime configurations and adjusted volume mounts for better resource management.
- Enabled SSH access for the model manager and disabled Grafana dashboard creation.
- Updated tests to reflect changes in directory paths and environment variable usage.
2026-04-09 16:37:36 -03:00
vitor-aignosi
526edcb50e feat: update training workflow and repository management
- Replaced synchronous MinIO repository calls with asynchronous counterparts in the Training class for improved performance.
- Enhanced logging throughout the training process to provide better insights into model metadata loading, parameter validation, and training execution.
- Updated the train_test_split function to enforce DataFrame input type, ensuring consistency in data handling.
- Removed the deprecated model_repository.py file to streamline the codebase.
- Adjusted cleanup schedule logic to improve error handling and logging during schedule reconciliation.
- Updated tests to reflect changes in the training workflow and repository interactions.
2026-04-09 12:09:52 -03:00
vitor-aignosi
c5cd382350 feat: enhance configuration and scheduling for cleanup processes
- Updated `.env.example` to include new environment variables for MinIO and PyPI configuration.
- Refactored `create_cleanup_schedule` to utilize runtime-specific task queues and improve schedule reconciliation logic.
- Enhanced `Activities` class to require a default bucket in MinIO configuration.
- Adjusted `requirements.txt` to specify version for `evidently`.
- Updated tests to reflect changes in schedule creation and configuration handling.
2026-04-07 12:57:29 -03:00
vitor-aignosi
09ee92f100 feat: enhance configuration and error handling in project setup
- Added new ignore rule for Ruff to allow temporary paths in tests.
- Introduced MyPy overrides for specific modules to ignore errors.
- Refactored `Cleanup` and `ExperimentTracking` classes to remove async keywords from methods, improving consistency in method signatures.
- Updated `Training` class methods to handle synchronous operations, enhancing performance and clarity.
- Adjusted `requirements.txt` to remove unnecessary Git dependency, streamlining project setup.
2026-04-07 10:25:17 -03:00
vitor-aignosi
6b1df7c3a7 feat: enhance training and experiment tracking functionality
- Updated `Activities` class to improve garbage collection handling.
- Enhanced error messaging in `ExperimentTracking` for better clarity on update failures.
- Refactored `Training` class to streamline exception handling and improve type hints.
- Introduced new methods in `TrainModelParams` for better handling of experiment run IDs and model metadata.
- Added functionality to extract model equations in `DataManagerRepository` for linear regression models.
2026-04-06 15:05:57 -03:00
vitor-aignosi
1352d1ac8f feat: enhance training model functionality and reporting
- Added `evidently` to requirements for improved model evaluation.
- Introduced `TrainModelResult` class with a `to_dict` method for better result handling.
- Updated `train_model` method to return a comprehensive training result, including run details.
- Enhanced `cleanup_run_directory` method in `DataManagerRepository` for improved resource management.
- Adjusted type hints in `TrainModel` for clarity and consistency.
2026-04-06 11:40:08 -03:00
vitor-aignosi
a8b926649a feat: enhance training reporting and directory management
- Added functionality to store run name and ID in the training results.
- Implemented report generation in the `DataManagerRepository`, including methods to create a run directory and generate comprehensive reports.
- Updated `TrainModelResult` to include `run_id` and `run_dir` attributes for better tracking of training sessions.
2026-04-06 10:38:24 -03:00
vitor-aignosi
18412958d2 refactor: remove MinIO repository references and streamline cleanup process
- Eliminated MinIO repository dependencies from the `Activities`, `Cleanup`, and `Training` classes.
- Updated the `cleanup_resources` method to focus on removing local temporary directories instead of handling MinIO file deletions.
- Adjusted the `TrainModel` class to pass the run directory for cleanup, enhancing resource management in the training workflow.
2026-04-06 09:30:38 -03:00
vitor-aignosi
d2bb588739 Merge branch 'main' into release/SIENTIAPDE-1645 2026-04-06 08:34:15 -03:00
vitor-aignosi
bf2b6b3888 feat: improve error handling and resource cleanup in training workflow
- Updated the `Training` class to raise `ModelTrainingError` on training failures for better error management.
- Enhanced the `run` method in `TrainModel` to return training results and ensure proper resource cleanup, including validation files.
- Refactored exception handling to prevent silent failures during resource cleanup and experiment run updates.
- Adjusted type hints for improved clarity and consistency in method signatures.
2026-04-06 08:26:42 -03:00
Bruno Domingues
7a0961f29d SIENTIAPDE-1717: Remove MinIO cleanup functionality and associated components. This change streamlines the cleanup workflow to focus solely on local temporary directories, removes the ModelTrainingError exception, and updates related configurations, documentation, and tests. 2026-03-30 14:14:10 -03:00
vitor-aignosi
342a02d6f7 feat: enhance training workflow with model metadata loading and refactor data handling
- Introduced a new activity to load model metadata from the model store.
- Refactored training logic to utilize new model metadata and improved parameter handling.
- Updated the `TrainModelParams` class to include additional fields for model configuration.
- Replaced deprecated utility functions with a custom train-test split implementation.
- Removed unused utility functions and cleaned up the data manager repository.
- Adjusted experiment tracking to include model-specific metadata in notifications.
2026-03-24 14:39:28 -03:00
vitor-aignosi
cf5111e520 feat: integrate PluginStore and MinIO repository into model manager activities
- Added PluginStore integration for model management.
- Replaced StorageRepository with MinIORepository in Activities, Cleanup, and Training classes.
- Updated training logic to handle validation files and improved data management.
- Enhanced configuration for MinIO and PluginStore in connectors.
- Removed deprecated model repository and storage repository files.
- Updated environment variable handling for new configurations.
2026-03-11 17:35:05 -03:00
Kou Kinoshita
43cbc31e10 SIENTIAPDE-1579: Lint fixes and formatting 2026-02-18 17:31:58 -03:00
Bruno Domingues
9d3ecc1c2f SIENTIAPDE-1350: Simplify exception handling for file and directory deletion in cleanup activity 2025-11-27 11:00:16 -03:00
Bruno Domingues
5dcb62ef4b SIENTIAPDE-1350: Integrate cleanup workflow and update default task queue names. 2025-11-26 22:11:20 -03:00
Bruno Domingues
463906073e SIENTIAPDE-1350: Refactor: Improve logging, configuration, and resource management. Includes .env updates, client initialization logging, and resource closing. 2025-11-24 23:08:29 -03:00
Bruno Domingues
53f49d7a97 SIENTIAPDE-1350: Implement file cleanup workflow and activities, including MinIO and local directory cleanup, configuration, and metrics. 2025-11-19 18:38:00 -03:00
Bruno Domingues
9f56a128e6 SIENTIAPDE-1308: Update documentation, remove install_dependencies.sh script from README, correct Training class initialization, and update sientia-dataops-library version in requirements.txt. 2025-11-03 17:35:33 -03:00
Bruno Domingues
f32d647d1c SIENTIAPDE-1307: Implement metrics for training activities and workflow executions, tracking success/failure status. 2025-11-03 14:41:37 -03:00
Bruno Domingues
db581f60f9 SIENTIAPDE-1307: Integrate metrics controller and update sientia-dataops-library to 1.5.1. This change adds metrics collection capabilities to activities and updates the dataops library dependency. (18 files changed, 143 insertions(+), 16 deletions(-)) 2025-10-31 17:06:26 -03:00
Kou-Kinoshita
26fca36d82 SIENTIAPDE-1241: Refactored method into smaller ones 2025-10-29 16:45:30 -03:00
Bruno Domingues
f07bc8ff30 SIENTIAPDE-1241: Refactor: Remove redundant logging and fix duplicate logs
This commit removes redundant logging statements from training and experiment tracking activities, preventing duplicate log entries. It also introduces a logger helper to disable log propagation, further addressing the duplicate logs issue. Additionally, the Makefile, run_coverage.sh, setup_port_forwards.sh, and simulator/Dockerfile files were removed as they are no longer needed.
2025-10-22 22:39:26 -03:00
Bruno Domingues
94697215aa SIENTIAPDE-1241: Refactor: Improve documentation, exception handling, and configuration in model manager. This commit enhances clarity and robustness by adding detailed docstrings to methods, standardizing exception handling with custom types, and simplifying MLflow configuration. 2025-10-22 21:48:12 -03:00
Bruno Domingues
5789a13023 SIENTIAPDE-1241: refactor train_model workflow due to I/O errors. 2025-10-22 15:37:56 -03:00
Bruno Domingues
4a32d712ba SIENTIAPDE-1255: Implement object destructors for Activities and ExperimentTracking to prevent AttributeError during garbage collection, and mock workflow logger in tests to avoid RuntimeWarning. 2025-10-20 17:53:49 -03:00
Bruno Domingues
a66b996cc1 SIENTIAPDE-1255: Refactor MLFlow activities for training operations and update metrics
This commit refactors the MLFlow activities to focus on model training rather than prediction operations. It removes prediction-related activities and metrics, and updates the MLFlow activity descriptions to reflect the change in focus. The README is also updated to reflect these changes.
2025-10-17 00:51:29 -03:00
Bruno Domingues
85a8ba1e68 SIENTIAPDE-1255: Refactor data quality gates to training focused metrics and repositories. This commit removes the data quality gates and filters, focusing on training-specific metrics and data repositories. It also updates the README to reflect these changes, including new training metrics and a streamlined data services section. 2025-10-17 00:39:06 -03:00
Bruno Domingues
305a39b44c SIENTIAPDE-1253: Implement business rule validation for training parameters. Adds a validate_business_rules method to the TrainModelParams class to enforce constraints on training parameters, improving data integrity and preventing errors. Also updates tests to include target variable in variable columns and adds tests for business rule validations. 2025-10-15 16:16:09 -03:00
Bruno Domingues
1ec40bfb2a SIENTIAPDE-1253: Implement activity for cleaning up temporary run directory and integrate into train model workflow. This change introduces a new activity for idempotent cleanup of the run directory after model training, replacing the direct directory removal in the workflow. This improves determinism and error handling. Also includes unit tests for the new activity. 2025-10-15 15:49:05 -03:00
Bruno Domingues
8ea98360c3 SIENTIAPDE-1253: Refactor training workflow and activities to raise exceptions on failure
This commit refactors the training workflow and associated activities to raise exceptions on failure instead of returning success/failure dictionaries. This allows the Temporal workflow to handle errors more effectively and ensures that the workflow stops when a critical error occurs.

Key changes:

- The train_model workflow is introduced to orchestrate the entire training process, including parameter validation, data download, model training, and model saving.
- The validate_train_params activity is added to validate and convert training parameters.
- The train_model and save_model activities are updated to raise exceptions on failure.
- The ExperimentStatus enum is updated to include a new status for orchestrator validation errors.
- The tests are updated to reflect the new exception-based error handling.
- The activities now return the TrainModelResult directly instead of a dictionary.
2025-10-15 15:19:29 -03:00
Bruno Domingues
61267ec49d SIENTIAPDE-1253: Enforce TrainModelParams object in Training activity and tests, removing dict conversion. 2025-10-14 10:03:34 -03:00
Bruno Domingues
b3c749872c SIENTIAPDE-1252: Implement save_model activity to save trained models to MLflow with comprehensive error handling and add corresponding unit tests. 2025-10-13 10:18:45 -03:00
Bruno Domingues
bee6036205 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.
2025-10-09 15:07:27 -03:00
Bruno Domingues
97f5ee08f1 SIENTIAPDE-1250: Fix: Update pip cache key and replace pytz with datetime.UTC in experiment tracking. 2025-10-07 14:12:35 -03:00
Bruno Domingues
7e1eace77f SIENTIAPDE-1250: Implement experiment tracking activity with status updates, error handling, and model registration. This includes a unified update method, error message truncation, and integration into the main activities orchestrator. (236+, 2-) 2025-10-07 11:27:23 -03:00
Bruno Domingues
520975e7aa SIENTIAPDE-1248: Refactor MinIO activity to raise specific exception types for better error handling 2025-10-06 10:58:48 -03:00
Bruno Domingues
9afe711075 SIENTIAPDE-1248: Integrate MinIO for object storage and add related configurations
This commit introduces MinIO integration for object storage within the Model Manager system. It includes:

- Added MinIO activity class for file operations (fetch, delete).
- Updated Activities orchestrator to include MinIO activities.
- Added MinIO configuration builder to utils/connectors_config.py.
- Added environment variables for MinIO configuration in .env.example.
- Added boto3 and botocore dependencies to requirements.txt.
- Added unit tests for MinIO activities.
2025-10-03 21:04:27 -03:00
Bruno Domingues
ef3c2a0c8a SIENTIAPDE-1243: Add type ignores and fix datetime index formatting in gates and model repository. 2025-10-01 17:44:45 -03:00
Bruno Domingues
8bcee4c6a0 SIENTIAPDE-1243: Fix: Resolved mypy errors and added pandas stubs. Addressed type hinting issues and suppressed mypy warnings to improve code quality and maintainability. 2025-10-01 17:36:47 -03:00
Bruno Domingues
dfc190c818 SIENTIAPDE-1243: Refactor and enhance model manager activities and workflows
This commit includes several changes:

- Reorganized imports and class inheritance in activities.py, gates.py and mlflow.py for better readability and maintainability.
- Improved error handling and logging in gates.py and mlflow.py.
- Added input validation and filtering in gates.py to ensure data quality.
- Enhanced prediction formatting and storage policy management in gates.py.
- Updated metrics.py to use consistent naming conventions and labels.
- Refactored connectors_config.py to use type hints and improve code clarity.
- Updated conditional and MLFlow filters for better data quality checks.
- Improved model repository logic for retraining and updating models.
- Enhanced worker.py to include SDK metrics and improved error handling.
- Refactored workflows for better modularity and error handling.
- Updated tests to reflect the changes and improve test coverage.
2025-10-01 17:28:57 -03:00
Bruno Domingues
b102f79087 SIENTIAPDE-1243: Remove OPC server integration and add code quality tools.
This commit removes the OPC server integration from the Model Manager, including related activities, repositories, metrics, and configuration. It also adds code quality tools such as Ruff (linting/formatting), mypy (type checking), and Bandit (security analysis) along with a validation script and CI/CD integration for automated code validation. The README has been updated to reflect these changes.
2025-10-01 16:25:08 -03:00
Bruno Domingues
bc4d98f78d SIENTIAPDE-1243: Rename project from 'laborious' to 'model-manager' across codebase and configuration. This includes updating project names in environment variables, Makefiles, README, metrics, and Helm chart values. 2025-10-01 14:41:24 -03:00
Bruno Domingues
aba4a3f1a5 SIENTIAPDE-1243: Refactor: Rename 'laborious' package to 'model_manager'
This commit renames the 'laborious' package to 'model_manager' across the entire project. This includes renaming directories, modules, references in code, configuration files, and documentation to reflect the new package name. This change improves clarity and consistency within the project.
2025-10-01 14:29:24 -03:00