Commit Graph

469 Commits

Author SHA1 Message Date
vitor-aignosi
b68674fe64 SIENTIAPDE-1273
Enhance MLFlowRepository and Activities classes with new methods and metrics

- Added `check_artifact_exists` method to MLFlowRepository for verifying artifact presence in the MLflow Model Registry.
- Implemented `get_prediction_data` method in MLFlowRepository to retrieve prediction data from models.
- Updated Activities class to integrate ModelMetrics for improved metrics handling.
- Enhanced tests for artifact existence checks and prediction data retrieval, ensuring robust coverage for new functionalities.
- Updated various workflows to include `transform_table_name` in input data for better data handling.
2025-11-13 16:40:23 -03:00
vitor-aignosi
6ac0f38d59 SIENTIAPDE-1273
Update requirements and enhance metrics and data handling

- Updated the sientia-dataops-library dependency version in requirements.txt to 1.5.3.
- Added new metrics for model analysis, including lag, count, and error count in metrics.py.
- Implemented a new method for formatting transformed data in gates.py.
- Enhanced MLFlowRepository with methods to load artifact dataframes and calculate model metrics, including drift and performance metrics.
- Updated the prediction process to handle transformed data and ensure proper execution of related activities in format_and_export_prediction.py and prediction_process.py.
2025-11-11 16:50:22 -03:00
vitor-aignosi
ee854ffcfe Merge pull request #29 from Aignosi/feature/SIENTIAPDE-1325-adicionar-metricas-especificas-de-operacoes-externas
SIENTIAPDE-1325: Enhance OPC metrics and monitoring with server name and URL
2025-11-10 10:11:44 -03:00
vitor-aignosi
0c59a7def8 SIENTIAPDE-1325
Refactor OPC data handling in opc_repository.py to improve code clarity. Updated commented-out code for SourceTimestamp to include NOSONAR annotations, ensuring better code quality checks.
2025-11-10 09:53:06 -03:00
vitor-aignosi
0de30d85a8 SIENTIAPDE-1325
Update logging in MLFlowRepository and OpcRepository to use unified logging methods

- Refactored logging calls in MLFlowRepository to replace `self.logger.info` and `self.logger.debug` with `self.info` and `self.debug` for consistency.
- Updated connection logging in OpcRepository to format the connection message properly.
- Adjusted test cases to reflect changes in logging behavior and ensure proper assertions.
2025-11-10 09:40:12 -03:00
vitor-aignosi
03dc0978b8 SIENTIAPDE-1325
Enhance OPC connection metrics by emitting total connections metric upon connection attempt. This change ensures accurate tracking of connection attempts in the OpcRepository class.
2025-11-07 09:57:43 -03:00
vitor-aignosi
c41c11b46f SIENTIAPDE-1325
Update OPC metric emissions to include server URL in total connections metric
2025-11-07 09:47:27 -03:00
vitor-aignosi
b7a15999ab SIENTIAPDE-1325
Refactor OPC class to remove unused opc_servers attribute and streamline initialization. Update OpcRepository to consolidate server name tags for metric emissions.
2025-11-07 09:44:01 -03:00
vitor-aignosi
fe82e52f70 SIENTIAPDE-1325
Update OPC connection logging to include server name in connection message
2025-11-07 09:26:03 -03:00
vitor-aignosi
d2f73658c9 SIENTIAPDE-1325
Update OPC connection logging to include server name in success message
2025-11-07 09:25:34 -03:00
vitor-aignosi
8d402fb156 SIENTIAPDE-1325
SIENTIAPDE-1325 Add OPC server name configuration and update repository handling

- Introduced a new environment variable `OPC_SERVER_NAME` in values.yaml with a default value.
- Updated the OPC class to include `server_name` when initializing OpcRepository.
- Enhanced the configuration builder to retrieve `OPC_SERVER_NAME` from the environment.
- Adjusted OpcRepository to store and utilize the `server_name` for metric emissions.
2025-11-07 09:20:48 -03:00
vitor-aignosi
2245baae62 SIENTIAPDE-1325
Update OPC metric emission to include server URL in opc_repository.py
2025-11-07 08:46:11 -03:00
vitor-aignosi
4136c116da SIENTIAPDE-1325
Refactor OPC metrics in metrics.py and opc_repository.py

- Replaced existing OPC connection metrics with new metrics for total connections and failed connections.
- Updated the OPC connection status metric to include server URL and adjusted corresponding metric emissions in opc_repository.py.
2025-11-07 08:37:08 -03:00
vitor-aignosi
507aded950 SIENTIAPDE-1325
Update image tag and enhance OPC metrics tracking

- Bumped image tag from "1.0.1" to "1.1.0" in values.yaml.
- Added new metrics for OPC connection count and error count in metrics.py.
- Refactored OPC connection handling in opc_repository.py to emit new metrics for connection status, count, and errors.
2025-11-06 16:59:02 -03:00
vitor-aignosi
1695df70ae SIENTIAPDE-1325
Enhance metrics handling in Gates and MLFlow classes

- Added checks for `None` response times before emitting OPC writing metrics in the Gates class to prevent unnecessary metric emissions.
- Updated the MLFlow class to conditionally sort and drop duplicates based on the presence of the 'created_at' column, ensuring robustness in data processing.
- Adjusted corresponding tests to validate the new behavior in both classes.
2025-11-05 16:30:51 -03:00
vitor-aignosi
a3da800cab SIENTIAPDE-1325
Refactor monitoring and metrics integration across various components

- Removed coverage options from `pyproject.toml`.
- Updated prediction metrics in `README.md` to replace `pipeline_name` with `workflow_name`.
- Upgraded `sientia-dataops-library` dependency version in `requirements-light.txt` and `requirements.txt`.
- Enhanced metrics handling in `laborious` activities, including `Activities`, `Gates`, `MLFlow`, and `OPC`, to utilize a new `MetricsController`.
- Refactored metric emission methods to improve clarity and consistency across the codebase.
- Updated tests to reflect changes in metrics handling and ensure proper functionality.
2025-11-04 16:49:10 -03:00
Matheus Demoner
77550d49a6 Merge pull request #28 from Aignosi/fix/SIENTIAPDE-1314-ajustes-nas-camadas-de-monitoramento-do-sientia
SIENTIAPDE-1314: Improve OPC Metrics and Update Prediction Workflow Execution
2025-10-27 15:35:42 -03:00
vitor-aignosi
67af03ee94 SIENTIAPDE-1314
Enhance thread safety in MLFlowRepository model caching

- Introduced a reentrant lock to synchronize access to the model cache, ensuring thread safety during cache checks and updates.
- Updated the cache management logic to acquire the lock when checking for existing models and when updating the cache after downloading a new model.
- Reduced the maximum cached workflows in the worker configuration for improved resource management.
2025-10-27 13:29:01 -03:00
vitor-aignosi
1cbf356d0c SIENTIAPDE-1314
Refactor model cache deletion in MLFlowRepository

- Updated the model cache deletion logic to remove the entire 'target' key instead of just the 'model' subkey, streamlining the cache management process.
2025-10-27 12:28:17 -03:00
vitor-aignosi
22eee9dfba SIENTIAPDE-1314
Refactor workflow names to include 'subworkflow' prefix

- Updated the workflow definitions and calls in the predictions_batch, format_and_export_prediction, and prediction_process files to use the 'subworkflow' prefix for consistency.
- Adjusted corresponding test cases to reflect these changes in workflow execution calls.
2025-10-27 10:14:33 -03:00
vitor-aignosi
be06e0a1b6 SIENTIAPDE-1314
Refactor OPC Test for Output Management

- Added spacing for improved readability in the test_manage_output_tags_failed and test_manage_output_tags_do_nothing functions.
- Reformatted the parameters in the call to manage_output_tags for better clarity and organization.
2025-10-27 08:21:47 -03:00
vitor-aignosi
56122efefa SIENTIAPDE-1314
Enhance OPC Testing for Output Management

- Refactored the test_manage_output_tags_failed function to use parameterization for improved test coverage of different side effects.
- Added a new test_manage_output_tags_do_nothing to verify behavior when an invalid key is provided in the configuration, ensuring that no write operations are performed in this case.
2025-10-27 08:17:57 -03:00
vitor-aignosi
1b93eb19cb SIENTIAPDE-1314
Refactor OPC Class and Enhance Testing for Output Management

- Removed the unused 'success' parameter from the manage_output_tags method in the OPC class to streamline its signature.
- Commented out the error handling logic in the OpcRepository for clarity and future reference.
- Added new tests for manage_output_tags to validate successful and failed write operations, ensuring accurate assertions for output data and metrics.
2025-10-27 08:10:19 -03:00
vitor-aignosi
80c987b2dc SIENTIAPDE-1314
Refactor OPC Write Method and Comment Out Error Handling Logic

- Reformatted the `write_opc_data` method for improved readability by adjusting its signature.
- Commented out the error handling logic in `OpcRepository` related to disconnection due to multiple errors, preserving the original functionality for future reference.
- Updated tests to reflect the commented-out error handling, ensuring clarity in the testing process.
2025-10-27 07:47:11 -03:00
vitor-aignosi
aec5839b5e SIENTIAPDE-1314
Refactor OPC Write Test to Separate Output Data and Metrics

- Updated the test for the OPC write operation to separately assert output data and OPC metrics for improved clarity and accuracy in testing.
- Changed the variable names to reflect the new structure of the returned values from the write operation.
2025-10-24 10:59:48 -03:00
vitor-aignosi
4b9da16aa6 SIENTIAPDE-1314
SIENTIAPDE-1314 Refactor OPC Write Operation in FormatAndExportPrediction Workflow

- Changed the variable name for the result of the OPC write operation for clarity.
- Extracted prediction and metrics from the OPC write result to improve data handling.
2025-10-24 10:22:48 -03:00
vitor-aignosi
723b30b1d6 SIENTIAPDE-1314
Update GITHUB_BRANCH in values.yaml to reflect new monitoring layer adjustments for SIENTIAPDE-1314
2025-10-24 10:14:46 -03:00
vitor-aignosi
fe48b480cf SIENTIAPDE-1314
Increase start-to-close timeout in FormatAndExportPrediction workflow from 60 to 180 seconds for improved execution reliability.
2025-10-24 10:09:46 -03:00
vitor-aignosi
c1a5ab3d3b SIENTIAPDE-1314
Update test_format_and_export_prediction.py to use prediction_data for workflow execution

- Replaced the mock return value with prediction_data in the test_run_none_path_flag function to ensure accurate testing of the workflow's data handling.
2025-10-23 17:55:35 -03:00
vitor-aignosi
0324e2e143 SIENTIAPDE-1314
Enhance OPC Metrics Handling and Refactor Write Operations

- Updated the OPC class to return response times for write operations, improving metrics tracking.
- Refactored the Gates activity to incorporate OPC metrics into the metrics writing process.
- Adjusted the manage_output_tags method in OpcRepository to return response times for each tag written.
- Modified tests to validate the new metrics structure and ensure correct behavior of the updated methods.
2025-10-23 17:48:43 -03:00
Bruno Domingues
32a76b35ea Merge pull request #27 from Aignosi/feature/SIENTIAPDE-1327-controle-de-releases
SIENTIAPDE-1327: Update requirements and simplify CI workflow for quality checks
2025-10-23 10:44:39 -03:00
vitor-aignosi
f0276b0cf4 SIENTIAPDE-1327
SIENTIAPDE-1327: Add requirements file to quality gate workflow

- Included 'requirements-light.txt' in the quality gate workflow to specify additional dependencies for the CI process.
2025-10-23 09:51:41 -03:00
vitor-aignosi
a398e2ea38 SIENTIAPDE-1327
Update requirements and simplify CI workflow for quality checks

- Added new dependencies: kaleido, hyperopt, and shap to requirements.txt.
- Refactored the quality gate workflow to use a template for improved maintainability and reduced complexity.
2025-10-23 09:33:10 -03:00
Matheus Demoner
2cecd8eefb Merge pull request #26 from Aignosi/SIENTIAPDE-1312-melhorias-e-correcoes-nas-pipelines-de-dados
SIENTIAPDE-1312: Refactor Error Handling, Enhance OPC Functionality, and Update Dependencies
2025-10-21 17:24:35 -03:00
vitor-aignosi
c5fb921654 SIENTIAPDE-1312
Refactor error handling in MLFlowRepository and update tests

- Improved error message formatting in MLFlowRepository for better readability.
- Updated test assertions to ensure correct calls to MLflow methods during experiment retrieval and creation.
2025-10-21 15:58:28 -03:00
vitor-aignosi
197a25ebf7 SIENTIAPDE-1312
Ensure model_temp_path directory exists before saving retrain data in MLFlowRepository
2025-10-21 14:40:52 -03:00
vitor-aignosi
4c1e9008ab SIENTIAPDE-1312
Update tests notebook execution count and bump image tag in values.yaml

- Incremented the execution count in the tests notebook for accurate tracking.
- Updated the image tag in values.yaml from "0.0.3" to "1.0.1" for versioning consistency.
- Enhanced error handling in model_repository.py to ensure proper retrieval of created experiments.
2025-10-21 14:32:35 -03:00
vitor-aignosi
461a885eeb SIENTIAPDE-1312
Refactor OPC handling by removing pod_id from initialization and updating logging format

- Removed pod_id parameter from OPC class and repository initialization to streamline connection management.
- Updated logging statements for improved readability during disconnection attempts and error handling.
2025-10-20 16:48:21 -03:00
vitor-aignosi
c2315a9455 SIENTIAPDE-1312
Enhance OpcRepository client initialization and error handling

- Updated the Client instantiation in OpcRepository to include a timeout and watchdog interval for improved connection management.
- Added a disconnection call in the exception handling block to ensure proper resource cleanup during connection failures.
2025-10-20 16:26:01 -03:00
vitor-aignosi
f046d079b5 SIENTIAPDE-1312
Update dependencies and enhance OpcRepository functionality

- Updated sientia-dataops-library version to 1.4.7 in requirements files.
- Modified GITHUB_BRANCH in values.yaml for improved pipeline management.
- Refactored OpcRepository class to inherit from BaseActivity, adding enhanced logging and error handling during disconnection.
- Implemented a disconnection fallback mechanism to ensure graceful handling of OPC server disconnections.
2025-10-20 15:55:51 -03:00
Matheus Demoner
8b5fbfe0ab Merge pull request #25 from Aignosi/SIENTIAPDE-1318-adicionar-pipeline-de-qualidade
Enhance validation script and CI workflow for improved code quality checks (SIENTIAPDE-1318)
2025-10-20 08:36:01 -03:00
vitor-aignosi
04cbce259f SIENTIAPDE-1318
Enhance CI workflow for comprehensive code quality checks

- Added code formatting check, linting, type checking, and security analysis steps using Ruff, mypy, and Bandit.
- Integrated pytest for running tests, ensuring a robust quality gate in the CI pipeline.
2025-10-17 12:34:52 -03:00
vitor-aignosi
3326a7da00 SIENTIAPDE-1318
Remove Pytest test execution from CI workflow and add a blank line in MinioRepository class for improved readability.
2025-10-17 12:15:03 -03:00
vitor-aignosi
50741de2b0 Merge branch 'main' into SIENTIAPDE-1318-adicionar-pipeline-de-qualidade 2025-10-17 12:08:27 -03:00
vitor-aignosi
da8706cf78 SIENTIAPDE-1318
Enhance validation script and CI workflow for improved code quality checks

- Added support for a --fix option in validate.sh to apply Ruff auto-fixes for formatting and linting.
- Updated GitHub Actions workflow to install development and runtime dependencies separately.
- Integrated the validation script execution into the CI pipeline to ensure code quality checks are performed automatically.
2025-10-17 07:55:52 -03:00
Bruno Domingues
1ae268d3f4 Merge pull request #24 from Aignosi/SIENTIAPDE-1231-ajustar-o-retreino-do-courier-no-laborious
SIENTIAPDE-1231, SIENTIAPDE-1222, SIENTIAPDE-1214: Enhance MLFlow, Model Repository, Logging, and Configuration
2025-10-16 12:44:49 -03:00
vitor-aignosi
a7cc917760 SIENTIAPDE-1231
Enhance README with code quality and validation guidelines

- Added a new section on code quality and validation tools, detailing the use of Ruff, mypy, Bandit, and pytest.
- Included installation instructions for development dependencies and options for running validation scripts.
- Provided best practices for maintaining code quality and integrating CI/CD workflows.
2025-10-16 11:04:37 -03:00
vitor-aignosi
644a43093a SIENTIAPDE-1231
Enhance README and repository utilities for clarity and functionality

- Updated README.md to improve descriptions and structure, adding detailed sections for features, workflows, and architecture.
- Enhanced MinioRepository with comprehensive docstrings for methods and class attributes, improving usability and documentation.
- Refined MLFlowRepository with clearer method descriptions and improved logging for better observability and maintainability.
2025-10-16 11:01:36 -03:00
vitor-aignosi
de47820c4a SIENTIAPDE-1231
Refactor tests and update model_repository.py for clarity and consistency

- Added a blank line in model_repository.py for improved readability.
- Adjusted formatting in test_mlflow.py to streamline assertions.
- Updated ensure_bucket_exists method tests in test_minio_repository.py to reflect the new return value of None instead of True.
2025-10-16 10:15:53 -03:00
vitor-aignosi
d59833a5e5 SIENTIAPDE-1231
Update .gitignore to include mlruns and remove Dockerfile for project simplification
2025-10-16 10:08:34 -03:00