Commit Graph

136 Commits

Author SHA1 Message Date
vitor-aignosi
49b6e504ae SIENTIAPDE-1231
Enhance Gates and MLFlowRepository with new functionalities and improvements

- Added a new method `clean_tmp_files` in the Gates class to remove temporary files associated with model retraining.
- Updated MLFlowRepository methods to improve experiment handling, including dynamic parameter logging and model retrieval.
- Refactored model loading methods to streamline the process and enhance error handling.
- Improved logging for model operations and added support for model parameter retrieval.
- Adjusted minimal_retrain workflow to extend timeouts for activities and ensure proper model configuration handling.
2025-10-13 10:36:11 -03:00
vitor-aignosi
7512963e19 SIENTIAPDE-1231
Enhance MinIO integration and update environment configurations

- Added MinIO configuration parameters to .env.example and values.yaml for improved storage management.
- Updated requirements.txt to include necessary libraries for MinIO support.
- Refactored Activities class to utilize Storage for MinIO interactions.
- Enhanced MLFlow class to integrate MinIO for data retrieval during model retraining.
- Introduced build_minio_config function to streamline MinIO configuration setup.
- Updated minimal_retrain workflow to support data storage in MinIO.
2025-10-07 16:56:16 -03:00
vitor-aignosi
16a3aa7022 SIENTIAPDE-1231
Update .gitignore, values.yaml, and model_repository.py for improved data handling and logging

- Added 'catboost_info/' to .gitignore to prevent tracking of additional temporary files.
- Updated GITHUB_BRANCH in values.yaml to reflect the current branch for model retraining.
- Enhanced model_repository.py to drop duplicate timestamps in treated data and streamline attribute logging during model retraining.
2025-10-06 16:35:53 -03:00
vitor-aignosi
36af84f056 SIENTIAPDE-1231
Enhance MLFlow and MLFlowRepository with improved data handling and logging

- Refactored MLFlow class to sort data by 'created_at' and drop duplicates for better input preparation.
- Updated MLFlowRepository methods to include detailed logging for artifact downloads and model predictions.
- Introduced LzmaPayloadCodec for efficient payload compression in the worker, optimizing data handling for large payloads.
- Enhanced timestamp handling in treated data to ensure compatibility with model expectations.
2025-10-06 13:32:36 -03:00
vitor-aignosi
9b71ad7556 SIENTIAPDE-1231
Update model retraining and logging enhancements

- Changed the GITHUB_BRANCH value in values.yaml to 'main' for consistency.
- Refactored MLFlow class to improve timestamp handling and error messaging during model retraining.
- Enhanced MLFlowRepository methods to include metadata logging and improved model version retrieval.
- Updated minimal_retrain workflow to support extended timeout for activities and include model configuration in input data.
2025-10-02 16:36:18 -03:00
vitor-aignosi
c6f004d20d 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.
2025-09-29 17:34:47 -03:00
vitor-aignosi
1aede51dc1 SIENTIAPDE-1231
SIENTIAPDE-1222
Enhance MLFlow and MLFlowRepository with model configuration support

- Introduced `model_config` parameter in MLFlow methods to streamline model handling and configuration management.
- Updated `retrain_model`, `transform`, and `predict` methods to accept `model_config` and `metadata` for improved flexibility and logging.
- Added `detect_and_parse_datetime_index` method to handle datetime index parsing with enhanced error handling and logging.
- Refactored model experiment creation to include transformation and prediction flavors, along with compression options.
- Improved documentation and type hints across methods for better clarity and usability.
2025-09-24 17:04:40 -03:00
vitor-aignosi
b279244160 SIENTIAPDE-1222
Enhance MLFlow data handling by adding timestamp column and improving debug logging

- Added a 'timestamp' column to the input data, converting the index to a datetime format for better tracking of predictions.
- Improved debug logging to provide clearer context by including the input data preview in the log output.
2025-09-24 13:07:29 -03:00
vitor-aignosi
295cab9f73 SIENTIAPDE-1222
Update MLFlow class to pass logger instance directly to MLFlowRepository

- Modified the initialization of MLFlowRepository in the MLFlow class to pass the logger instance directly, improving logging capabilities and consistency across the application.
2025-09-24 13:07:29 -03:00
vitor-aignosi
03ac6a8f8d SIENTIAPDE-1222
SIENTIAPDE-1222 Update MLFlow methods to include metadata parameter

- Modified the transform and predict method calls in the MLFlow class to include a new 'metadata' parameter, enhancing the functionality and data handling capabilities of the model monitoring repository.
2025-09-24 13:07:29 -03:00
vitor-aignosi
20fc938cc0 SIENTIAPDE-1222
Refactor datetime index handling in MLFlow and MLFlowRepository

- Moved the detect_and_parse_datetime_index method from MLFlow to MLFlowRepository for better organization and reusability.
- Updated the method to include enhanced logging and error handling for invalid datetime formats.
- Adjusted the transform method in MLFlowRepository to utilize the new datetime index parsing logic.
- Added unit tests for both valid and invalid datetime index cases to ensure robustness.
2025-09-24 13:07:29 -03:00
vitor-aignosi
12b56cb71f SIENTIAPDE-1222
Update model configuration keys in MLFlowRepository for consistency

- Changed 'model_retention' to 'retention_minutes' and 'is_compressed' to 'compressed' in model configuration handling, ensuring alignment with updated configuration standards.
2025-09-24 13:00:36 -03:00
vitor-aignosi
73b03e6749 SIENTIAPDE-1222
Update prediction_store_policy handling in workflows

- Added 'prediction_store_policy' to the input data handling in PredictionsBatch, ensuring a default value of 'lts:1' is used when not provided.
- Modified FormatAndExportPrediction to directly use 'prediction_store_policy' from input_data, removing the default fallback.
- Updated PredictionProcess to include 'prediction_store_policy' in the output data structure, ensuring consistency across workflows.
2025-09-24 12:59:54 -03:00
vitor-aignosi
39aa089384 SIENTIAPDE-1222
Enhance MLFlow debug logging to limit output size

- Updated debug logging statements in the MLFlow activity to include a maximum of 5 items and a depth of 5 for the sample dictionary, improving readability and reducing log clutter for raw and transformed response data.
2025-09-24 12:59:54 -03:00
vitor-aignosi
3752170c3a SIENTIAPDE-1222
Refactor debug logging in Gates activity for improved readability

- Reformatted the debug logging statement for input data in the Gates activity to enhance clarity and maintain consistency with previous logging improvements.
2025-09-24 12:59:54 -03:00
vitor-aignosi
8095e37710 SIENTIAPDE-1222
Refactor MLFlow debug logging for improved readability

- Reformatted debug logging statements in the MLFlow activity to enhance clarity and consistency.
- Ensured that the output of raw and transformed response data is presented in a more readable format, maintaining the use of create_sample_dict for better visualization.
2025-09-24 12:59:54 -03:00
vitor-aignosi
0bdbef00b7 SIENTIAPDE-1222
Update image tag in values.yaml and enhance debug logging in Gates and MLFlow activities

- Updated the image tag in values.yaml from '0.0.1' to '0.0.2'.
- Improved debug logging in the Gates activity to format input data and filters for better readability.
- Enhanced MLFlow activity logging to include formatted output for raw and transformed response data, ensuring consistent logging format.
2025-09-24 12:59:54 -03:00
vitor-aignosi
31e7e94a95 SIENTIAPDE-1222
Update requirements and enhance logging in Gates and MLFlow activities

- Updated the sientia-dataops-library and sientia-mlops-library dependencies in requirements.txt to the latest versions.
- Improved debug logging in the Gates activity to display a sample of input data and filters, enhancing clarity and reducing output size.
- Refactored MLFlow activity logging to utilize the create_sample_dict function for better visualization of nested data structures in logs.
2025-09-24 12:59:42 -03:00
vitor-aignosi
1de44e7ed1 SIENTIAPDE-1222
SIENTIAPDE-1222
Enhance MLFlow logging with sample dictionary for response data

- Introduced a new method to create a sample dictionary for debugging, allowing for better visualization of nested data structures in logs.
- Updated debug logging to utilize the new sampling method for raw and transformed response data, improving clarity and reducing output size.
- Adjusted logging for processed input data to display only the first few rows, enhancing readability.
2025-09-24 12:59:42 -03:00
vitor-aignosi
ecffa0c301 SIENTIAPDE-1222
Refactor MLFlow logging to enhance data output clarity

- Updated debug logging to use data.to_string() for processed input data, improving readability.
- Modified raw response data logging to format the output as a string, ensuring consistent logging format.
2025-09-24 12:59:42 -03:00
vitor-aignosi
16f28c4d63 SIENTIAPDE-1222
Update values.yaml and MLFlow logging for courier integration

- Changed the image repository to 'sientia-module-courier' and updated the image tag to '0.0.1'.
- Modified environment variables for GITHUB_BRANCH and MLFLOW_PASSWORD to reflect new configurations.
- Enhanced MLFlow logging to include additional debug statements for raw response data and added a check for empty DataFrames.
2025-09-24 12:59:42 -03:00
vitor-aignosi
dcfd0572d1 SIENTIAPDE-1222
Refactor MLFlow logging to improve data output clarity

- Updated the debug logging to directly capture the output of data.to_csv, enhancing traceability of processed input data.
- Removed redundant debug statements for raw response data to streamline logging and focus on essential information.
2025-09-24 12:59:42 -03:00
vitor-aignosi
45263c10e5 SIENTIAPDE-1222
SIENTIAPDE-1214: Enhance MLFlow and tests with datetime index handling and logging improvements

- Added a new method in MLFlow to detect and parse datetime indices in DataFrames, ensuring proper format and raising errors for invalid types.
- Updated prediction workflows to utilize the new datetime index handling, improving data integrity during transformations.
- Enhanced logging in model_repository to include detailed data outputs for better traceability.
- Adjusted timeout settings in prediction workflows for improved execution time management.
- Updated tests.ipynb to include additional checks for index types and outputs for better validation of functionality.
2025-09-24 12:59:42 -03:00
vitor-aignosi
f7217d400f SIENTIAPDE-1214
SIENTIAPDE-1214: Refactor MLFlow and model repository methods to use model_config dictionary

- Updated MLFlow class methods to accept model_config instead of model_retention for improved flexibility.
- Modified model_repository methods to handle model_config, extracting necessary parameters for transformation and prediction.
- Adjusted predictions_batch and prediction_process workflows to utilize model_config for better configuration management.
- Commented out the previous sientia-mlops-library dependency in requirements.txt for clarity.
2025-09-24 12:59:18 -03:00
vitor-aignosi
ec0a193c32 SIENTIAPDE-1231
Refactor OPC and model repository for improved functionality and clarity

- Updated OPC server logging to handle missing prediction and confidence tags gracefully.
- Corrected documentation for OPC reconnection interval from milliseconds to seconds.
- Enhanced MLFlowRepository with new methods for model retrieval, caching, and transformation, improving model management and retraining workflows.
2025-09-23 16:06:10 -03:00
vitor-aignosi
f971e711bd SIENTIAPDE-1182
Update tests.ipynb and gates.py for enhanced functionality and clarity

- Adjusted execution count in tests.ipynb for reproducibility.
- Modified DataFrame creation in tests.ipynb to dynamically set size and update timestamp frequency.
- Added a new filter function for empty data in gates.py to improve data handling.
2025-09-04 15:39:01 -03:00
vitor-aignosi
2e420dadba SIENTIAPDE-1182
Enhance tests.ipynb and gates.py for improved logging and output clarity

- Set execution count to null in tests.ipynb for reproducibility.
- Added stdout output to tests.ipynb for better visibility of results.
- Updated DataFrame display logic in tests.ipynb to include additional print statements for length and size.
- Improved debug logging in gates.py to log prediction data as a string for better traceability.
- Changed info log in gates.py to use len() instead of size for consistency.
2025-09-04 09:51:58 -03:00
vitor-aignosi
da21c128f8 SIENTIAPDE-1182
Update tests.ipynb and values.yaml for improved functionality and versioning

- Updated execution count in tests.ipynb for reproducibility.
- Modified DataFrame creation in tests.ipynb to include a timestamp column and save to CSV.
- Changed image tag in values.yaml from "0.4.4" to "0.4.5" for versioning.
- Updated GITHUB_BRANCH in values.yaml to reflect the latest branch adjustments.
2025-09-04 09:36:23 -03:00
vitor-aignosi
456eb5c674 SIENTIAPDE-1084
Refactor debug logging in gates.py to remove f-string usage for improved consistency and readability
2025-09-03 09:53:07 -03:00
vitor-aignosi
bac17579d6 SIENTIAPDE-1084
Refactor connectors_config.py and conditional_filters.py for improved configuration management and data filtering

- Updated PostgreSQL and MLFlow configuration functions to enhance default values and environment variable handling.
- Simplified OPC server configuration logic and improved MongoDB connection string construction.
- Refactored conditional filters to streamline null value checks and empty data validation, removing unnecessary comments and examples for clarity.
- Removed extensive module docstrings to enhance code readability.
2025-09-03 08:42:24 -03:00
vitor-aignosi
430af65359 SIENTIAPDE-1084
Update README.md to enhance installation instructions and refactor MLFlow filters

- Added steps for installing GitHub CLI and authenticating with GitHub.
- Updated the `api_error_filter` and `nan_values_filter` functions to improve parameter handling and streamline logic.
2025-09-03 08:20:01 -03:00
vitor-aignosi
844a2e84cf SIENTIAPDE-1084
Remove all module docstrings and the versioning information from the Laborious package, activities, utils, and workflows. This cleanup enhances code readability and reduces unnecessary comments in the codebase.
2025-09-01 16:03:03 -03:00
vitor-aignosi
995ba7900a SIENTIAPDE-1182
Remove Docker configuration files and refactor project structure

- Deleted docker-compose.yml and Dockerfile as part of the project restructuring.
- Updated README.md to reflect changes in project setup and configuration.
- Introduced a new __init__.py file in the laborious package to provide an overview of the system.
- Enhanced documentation across various modules, including metrics, activities, and workflows, to improve clarity and usability.
- Added comprehensive docstrings and comments to key classes and methods for better maintainability.
2025-08-29 13:22:48 -03:00
vitor-aignosi
30c1d6746a SIENTIAPDE-1182
Implement prediction store policy handling in Gates activity

- Added a new method `get_prediction_store_policy` to validate and parse the prediction store policy.
- Updated `format_prediction` method to utilize the new policy handling, allowing for sorting of predictions based on the specified policy.
- Enhanced test coverage for the new policy handling, including various scenarios for valid and invalid policies.
- Removed the obsolete `coverage.sh` script.
2025-08-28 16:31:55 -03:00
vitor-aignosi
7f3ecc9add SIENTIAPDE-1205
Refactor OpcRepository and update tests for async handling

- Removed the shutdown method from OpcRepository and adjusted the disconnect logic.
- Updated tests in test_activities.py and test_opc.py to support async shutdown functionality.
- Enhanced test cases in test_opc_repository.py to ensure proper async behavior and error handling in OpcRepository methods.
2025-08-28 14:39:00 -03:00
vitor-aignosi
fc799de42e SIENTIAPDE-1205
Revert image tag in values.yaml to 0.4.4 and rename shutdown method in OpcRepository class

- Changed image tag in values.yaml from 0.4.5 back to 0.4.4.
- Renamed __del__ method to shutdown in OpcRepository for clarity.
- Enhanced connection validation logic in OpcRepository to improve error handling and logging.
2025-08-28 14:39:00 -03:00
vitor-aignosi
b23217cb0e SIENTIAPDE-1205
Update values.yaml and enhance logging in OPC activity

- Change replicaCount from 5 to 1 for reduced resource allocation.
- Update image tag in values.yaml to 0.4.5 for the latest version.
- Modify GITHUB_BRANCH environment variable for improved async handling.
- Add logging statements in OPC class to track server initialization and connection status.
2025-08-28 14:39:00 -03:00
vitor-aignosi
cba90c98fa Update environment configuration and refactor OPC activities for async handling
- Expanded the .env file with configurations for MongoDB, Postgres, MlFlow, and Temporal.
- Refactored OPC class methods to be asynchronous, including init_opc, write_data, manage_output_tags, and shutdown.
- Updated the worker to initialize OPC asynchronously and adjusted shutdown handling for activities.
2025-08-28 14:39:00 -03:00
vitor-aignosi
1cd91f2b58 SIENTIAPDE-1182
Update requirements and modify MLFlow activity

- Bump sientia-mlops-library version in requirements.txt from 0.38.5 to 0.38.8.
- Comment out the reset_index call in the MLFlow activity to prevent unintended data manipulation.
2025-08-26 08:30:32 -03:00
vitor-aignosi
9cdbc0afda SIENTIAPDE-1193
Update dependencies and enhance datetime handling

- Bump sientia-dataops-library version in requirements.txt to 1.4.4.
- Update image tag in values.yaml to 0.4.4.
- Add 'datetime_columns' to metadata in MinimalRetrain and PredictionsBatch workflows for improved data handling.
2025-08-25 08:27:58 -03:00
vitor-aignosi
4b9c4ecca0 SIENTIAPDE-1193
Enhance logging in Gates activity by adding debug output for input data
2025-08-22 16:14:48 -03:00
vitor-aignosi
aba077fcc9 SIENTIAPDE-1193
Update image tag in values.yaml to 0.4.3 and fix timestamp formatting in Gates activity
2025-08-22 16:12:44 -03:00
vitor-aignosi
ae6d28df54 SIENTIAPDE-1193
Update Gates activity and format_and_export_prediction workflow to use DATETIME_FORMAT_WITH_TZ for consistent timestamp handling

- Modified Gates activity to correctly handle the maximum timestamp without formatting it prematurely.
- Updated format_and_export_prediction workflow to utilize DATETIME_FORMAT_WITH_TZ for timestamp conversion.
- Enhanced tests to ensure timestamp conversion is applied consistently across workflows.
2025-08-22 14:17:54 -03:00
vitor-aignosi
2301dd63c7 SIENTIAPDE-1193
Update requirements and refactor Gates activity for improved datetime handling

- Update sientia-dataops-library reference in requirements.txt to version 1.4.3.
- Refactor datetime handling in Gates activity to use a consistent format with timezone support, replacing direct datetime calls with a centralized now() function and DATETIME_FORMAT_WITH_TZ constant.
2025-08-22 11:33:33 -03:00
vitor-aignosi
5050e0652b SIENTIAPDE-1193
Update requirements and values for SIENTIAPDE-1193

- Bump sientia-dataops-library version from 1.4.1 to 1.4.2 in requirements.txt.
- Change GITHUB_BRANCH in values.yaml to reflect the new task SIENTIAPDE-1193 regarding datetime writing in temporal.
2025-08-22 08:11:42 -03:00
vitor-aignosi
3761cbd22f SIENTIAPDE-1199
Refactor OPC class to remove success_count variable and streamline output tag management
2025-08-21 09:11:32 -03:00
vitor-aignosi
baf52c4a16 SIENTIAPDE-1199
Refactor OPC class to initialize success_count within the loop for better scope management
2025-08-21 09:04:35 -03:00
vitor-aignosi
935a9e9279 SIENTIAPDE-1199
Enhance logging in OpcRepository to include metadata for all log messages

- Introduced a metadata dictionary to the OpcRepository class for improved context in logging.
- Updated logging statements to utilize custom_info, custom_warning, and custom_error methods, ensuring all key operations and error messages include relevant metadata.
- Improved visibility of connection status, disconnection attempts, and error handling, facilitating better monitoring and debugging.
2025-08-20 11:35:42 -03:00
vitor-aignosi
40870b021a SIENTIAPDE-1199
Refactor logging in worker module to include metadata in custom info and error messages

- Updated logging statements in the worker module to utilize custom_info and custom_error methods, incorporating a metadata dictionary for enhanced context.
- Improved visibility of key operations such as starting the worker, notification handler, and activities, as well as error handling for unhandled exceptions.
2025-08-20 10:51:38 -03:00
vitor-aignosi
8b9bb8d720 SIENTIAPDE-1199
Refactor logging in Gates and MLFlow activities to use info level for key operations

- Updated logging statements in the Gates class to replace debug logs with info logs for input and output gate operations, enhancing visibility.
- Modified MLFlow class to use info logs for data transformation and prediction processes, improving clarity in the logging output.
- Adjusted OPC class to return the count of successfully written tags, providing better insight into data writing operations.
2025-08-20 10:38:08 -03:00