Commit Graph

233 Commits

Author SHA1 Message Date
vitor-aignosi
62b885afae SIENTIAPDE-1712
SIENTIAPDE-1712 Add last_timestamp parameter to MLFlow and Gates activities for enhanced tracking

- Introduced last_timestamp parameter in the MLFlow and Gates classes to improve tracking of data processing times.
- Updated MinioDataFramePayload to handle last_timestamp, ensuring it defaults to the maximum timestamp from the dataframe if not provided.
2026-03-23 09:26:49 -03:00
vitor-aignosi
2fa7506075 SIENTIAPDE-1712
SIENTIAPDE-1712 Add timestamp column to processed data in MLFlow and improve dataframe validation in MinioDataFramePayload

- Added a 'timestamp' column to the processed data in the MLFlow class for better tracking of data entries.
- Updated the validation check in MinioDataFramePayload to handle None values for the dataframe more explicitly.
2026-03-23 08:35:28 -03:00
vitor-aignosi
e1d1e3d43d SIENTIAPDE-1712
Refactor imports in gates.py and mlflow.py for improved organization

- Removed unnecessary import statement in mlflow.py and re-added it in a more appropriate location.
- Cleaned up the workflow metadata assignment in gates.py for better readability.
2026-03-23 08:06:01 -03:00
vitor-aignosi
2979f2dd5a SIENTIAPDE-1712
Update environment variables in values.yaml and enhance metric labels in metrics.py

- Changed POSTGRES_USER and POSTGRES_PASSWORD values in values.yaml for improved security.
- Added 'runtime' label to metrics in metrics.py for better environment identification.
- Updated CORE_LABELS to include 'runtime' for consistency across metrics.
- Modified type hint for data parameter in PredictionProcess to use a dictionary for better clarity.
- Adjusted tests to reflect changes in core labels and MinIO configuration.
2026-03-20 16:59:04 -03:00
vitor-aignosi
e35e27bfb2 SIENTIAPDE-1712
SIENTIAPDE-1712 Update type hints in PredictionProcess to improve clarity and enforce data structure consistency. Changed `data` parameter to a dictionary type and updated the way `last_timestamp` is accessed.
2026-03-20 16:00:11 -03:00
vitor-aignosi
52bca3f09d SIENTIAPDE-1712
Fix type hint in from_dict method of MinioDataFramePayload class for improved clarity and compatibility with type checking.
2026-03-20 15:53:54 -03:00
vitor-aignosi
67942c45e0 SIENTIAPDE-1712
Refactor MinioDataFramePayload usage across activities

- Updated instances of MinioDataFramePayload initialization in Gates, MLFlow, and Storage classes to use the new from_dict method for better data reconstruction from dictionaries.
- Enhanced the PredictionProcess workflow to utilize the updated payload handling.
- Added passthrough fixtures in tests to accommodate the new from_dict method for consistent testing behavior.
2026-03-20 15:52:04 -03:00
vitor-aignosi
8789e6693f SIENTIAPDE-1712
Remove `query_to_minio` method from Storage class and update worker activities to eliminate its usage. This change streamlines the codebase by removing unused functionality related to MinIO queries.
2026-03-20 15:27:55 -03:00
vitor-aignosi
57b0005c94 SIENTIAPDE-1712
Update MinIO configuration by changing access key in values.yaml and removing region_name references in multiple files to streamline configuration.
2026-03-20 15:06:23 -03:00
vitor-aignosi
18718418fc SIENTIAPDE-1712
Update MinIO configuration in values.yaml and activities.py; add secure option in connectors_config.py
2026-03-20 14:59:47 -03:00
vitor-aignosi
add3629272 SIENTIAPDE-1712
Update liveness and readiness probe initial delays in values.yaml; change GITHUB_BRANCH to feature/SIENTIAPDE-1712; refactor MinioRepository initialization in activities.py
2026-03-20 14:37:26 -03:00
vitor-aignosi
d43f08d272 SIENTIAPDE-1712
Enhance README and Implement Drift Detection and Metrics Workflows

- Added new sections in README for Drift Workflow and Simple Metrics Workflow, detailing their execution flows and functionalities.
- Introduced `drift.py` for data drift detection, comparing current data against reference datasets.
- Added `simple_metrics.py` for calculating regression metrics (RMSE, MSE, MAE, R²).
- Updated `values.yaml` to include configuration for MinIO retention hours and offload threshold.
- Refactored `minio_dataframe_payload.py` to use the new offload threshold environment variable.
- Adjusted tests to reflect changes in environment variable handling for MinIO offload threshold.
2026-03-20 09:22:08 -03:00
vitor-aignosi
5d0d049082 SIENTIAPDE-1712
Remove code validation script and refactor imports in activities and workflows

- Deleted the `validate.sh` script, which was responsible for running code quality checks.
- Cleaned up import statements in `activities.py`, `gates.py`, `mlflow.py`, and `storage.py` by removing unused imports and organizing them.
- Refactored initialization methods in `MinioManager` and `MLFlow` classes for improved readability.
- Updated various workflows to ensure compatibility with the new structure and removed unnecessary comments.
- Enhanced test cases to accommodate changes in the activities and workflows, ensuring proper mocking of dependencies.
2026-03-20 09:14:16 -03:00
vitor-aignosi
981ac700d4 SIENTIAPDE-1712
Implement MinIO Offload and Retention Features

- Added configuration options for MinIO retention hours and offload threshold in README.
- Introduced MinIO payload offloading for large DataFrame-derived payloads, storing them as parquet files.
- Updated activities to utilize MinIO for data loading and cleanup, including new methods for offloading and retention management.
- Refactored existing activities to integrate MinIO functionality, ensuring compatibility with previous workflows.
- Removed the legacy MinioRepository class, consolidating MinIO operations under a new manager structure.
- Updated requirements to use the latest version of the sientia-dataops-library.
2026-03-19 17:29:43 -03:00
vitor-aignosi
3a15ed8058 SIENTIAPDE-1478
Rename get_core_labels method to get_pi_web_api_core_labels in API class for clarity and consistency with PI Web API integration.
2026-02-11 10:29:56 -03:00
vitor-aignosi
c2864d3806 SIENTIAPDE-1478
Enhance API class with optional operation_type in get_core_labels method

- Added a new method get_core_labels to the API class that generates core labels for metrics.
- Introduced an optional operation_type parameter to control the inclusion of the operation_type key in the returned labels.
- Maintained compatibility with the base implementation while providing flexibility for metrics without the operation_type label.
2026-02-11 10:11:28 -03:00
vitor-aignosi
cf0478d9a5 SIENTIAPDE-1478
Enhance API class with default headers for JSON requests

- Added a headers configuration to the API class to specify default Content-Type, Accept, x-requested-with, and User-Agent for JSON requests.
2026-01-27 13:04:18 -03:00
vitor-aignosi
ab5e91fa07 Update laborious/activities/api.py
Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com>
2026-01-23 13:13:25 -03:00
vitor-aignosi
24859eeeb4 SIENTIAPDE-1478
Fix missing newline at end of file in api.py
2026-01-23 10:01:23 -03:00
vitor-aignosi
0739f7e2b3 SIENTIAPDE-1478
Update sientia-dataops-library dependency version from 1.8.1 to 1.8.2 in requirements.txt and modify API class to accept a list of response data for PI Web API integration.
2026-01-22 13:41:02 -03:00
vitor-aignosi
53213bf7f1 SIENTIAPDE-1478
Fix spelling errors in poller behavior parameters in prepare_worker.py and remove redundant endpoint references in test_api.py
2026-01-21 15:42:59 -03:00
vitor-aignosi
276fe6f623 SIENTIAPDE-1478
SIENTIAPDE-1478 Update tests.ipynb execution counts, modify timestamps, and enhance API class for PI Web API integration

- Adjusted execution counts in tests.ipynb for consistency.
- Updated timestamps in test outputs to reflect new data.
- Refactored API class to streamline data writing to PI Web API by removing redundant endpoint handling.
2026-01-21 15:34:58 -03:00
vitor-aignosi
9d7268aa0e SIENTIAPDE-1478
Add write_pi_web_api_data activity to main workflow in worker.py
2026-01-20 16:32:00 -03:00
vitor-aignosi
69b2f93ab2 SIENTIAPDE-1478
Refactor validation script and improve logging in API and model repository

- Updated validation script to include 'e2e/' directory in code formatting and linting checks.
- Enhanced error logging in API class to improve readability of error messages.
- Refactored debug logging in model repository for better structured output.
- Cleaned up import statements in various files for improved organization.
2026-01-16 16:47:33 -03:00
vitor-aignosi
241f283724 SIENTIAPDE-1478
Enhance end-to-end tests for PredictionsBatch workflow scenarios

- Introduced mock repositories for PI Web API and OPC operations to improve test coverage.
- Updated test scenarios to handle partial write errors for PI Web API and OPC.
- Refactored existing tests to assert correct behavior under various error conditions.
- Enhanced logging and error handling in API and OPC activities to provide clearer feedback on failures.
- Removed outdated integration test file to streamline test suite.
2026-01-16 16:41:36 -03:00
vitor-aignosi
6a69687fd5 SIENTIAPDE-1478
Enhance MLFlow logging and add skip_transform option in MLFlowRepository

- Updated logging in mlflow.py to output processed input data as CSV.
- Introduced skip_transform parameter in MLFlowRepository to conditionally bypass data transformation.
- Improved logging in model_repository.py to display data in a more structured format (to_dict) for predictions and transformations.
2026-01-15 10:55:48 -03:00
vitor-aignosi
63017754a8 SIENTIAPDE-1478
Update coverage source in pyproject.toml, add testcontainers for PostgreSQL in requirements-dev.txt, increment image tag and adjust probe delays in values.yaml, and refine condition checks in format_and_export_prediction.py and mlflow.py. Additionally, enhance test coverage in test_gates.py.
2026-01-14 16:01:03 -03:00
vitor-aignosi
34e8cce282 SIENTIAPDE-1478
Refactor import paths for create_sample_dict in gates.py and mlflow.py to improve module organization
2026-01-13 13:09:07 -03:00
vitor-aignosi
1a2a3b3d91 SIENTIAPDE-1478
Update sientia-dataops-library dependency to version 1.8.0 and adjust import path in worker.py for improved module organization
2026-01-13 12:55:39 -03:00
vitor-aignosi
8adb7151ee SIENTIAPDE-1478
Update environment variables in values.yaml and refactor worker.py for improved worker preparation

- Removed KAFKA_BOOTSTRAP_SERVERS from environment variables in values.yaml.
- Added PYPI_SERVER environment variable for library distribution.
- Refactored worker.py to replace resource tuner and poller behavior with a new prepare_worker function, streamlining worker initialization and enhancing code clarity.
2026-01-09 14:57:37 -03:00
vitor-aignosi
7891a7ca6e SIENTIAPDE-1478
SIENTIAPDE-1478
Implement PI Web API response processing and metrics tracking

- Added a new method in the API class to process responses from the PI Web API, validating tag writes and emitting metrics for success and errors.
- Enhanced error handling for missing WebIds and tag names in responses, with appropriate logging and notifications.
- Updated tests to cover various scenarios for processing PI Web API responses, ensuring robust functionality and metrics emission.
- Refactored existing methods to integrate the new response processing logic, improving overall code clarity and maintainability.
2026-01-09 11:33:00 -03:00
vitor-aignosi
7cfa34a963 SIENTIAPDE-1478
Enhance README and Codebase with PI Web API Integration

- Updated README.md to include details about PI Web API integration, including configuration and export capabilities.
- Modified Activities class to incorporate PI Web API export operations and error handling.
- Added new API class for handling PI Web API interactions, including writing prediction and confidence data.
- Updated prediction workflows to support PI Web API output configuration.
- Enhanced worker and sub-workflows to include PI Web API in task queues and export processes.
- Improved documentation and error handling for PI Web API connections and configurations.
2026-01-09 09:30:26 -03:00
vitor-aignosi
1bddde17f4 SIENTIAPDE-1478
Refactor Activities and API Integration for PI Web API

- Reintroduced the API import in the Activities class for proper integration.
- Cleaned up whitespace and formatting in the API class and related tests for improved readability.
- Updated test cases to ensure consistent formatting in error messages and configuration structures for PI Web API.
- Enhanced connectors_config.py with additional whitespace for better organization.
2026-01-09 09:00:21 -03:00
vitor-aignosi
892823df11 SIENTIAPDE-1478
Enhance Activities and Prediction Workflows with PI Web API Integration

- Updated the Activities class to include API integration, allowing for configuration of PI Web API parameters.
- Modified prediction workflows to support output configuration for PI Web API, enabling data writing to the API.
- Refactored connectors_config.py by removing unused PostgreSQL and MongoDB configuration functions.
- Added tests to validate the new PI Web API functionality in activities and workflows, ensuring robust integration and functionality.
2026-01-08 16:04:19 -03:00
vitor-aignosi
894d39faa4 SIENTIAPDE-1273
Refactor import statements in worker.py for improved organization

- Moved the import of the os module to the appropriate section, enhancing clarity and consistency in the import structure.
2025-11-24 09:06:00 -03:00
vitor-aignosi
2a451da976 SIENTIAPDE-1273
Refactor imports in opc.py to improve code clarity

- Moved the import of Hashable from collections.abc to the appropriate section, enhancing readability and organization of imports.
2025-11-19 18:31:52 -03:00
vitor-aignosi
3311409885 SIENTIAPDE-1273
Update sientia-mlops-library dependency to version 0.40.6 and refactor get_prediction_data method calls for improved readability in model_repository.py and test_model_repository.py.
2025-11-19 14:54:50 -03:00
vitor-aignosi
684bc9fb31 SIENTIAPDE-1273
Enhance prediction data retrieval in MLFlowRepository by adding predict_flavor parameter

- Updated get_prediction_data method to accept a predict_flavor argument, allowing for different prediction model handling.
- Adjusted calls to get_prediction_data throughout the codebase to include the new parameter.
- Added new test cases to validate behavior for different predict_flavor values, ensuring robust functionality.
2025-11-19 13:26:08 -03:00
vitor-aignosi
8f6a3cd93d SIENTIAPDE-1273
Enhance resource management and configuration in Laborious worker

- Updated `values.yaml` to define resource limits and requests for better performance tuning.
- Modified environment variables in `worker.py` to support resource-based scaling and improved task queue management.
- Introduced new functions for creating resource tuners and poller behaviors, enhancing scalability and efficiency in handling workloads.
2025-11-19 11:53:50 -03:00
vitor-aignosi
7e4e048ca3 SIENTIAPDE-1273
Update sientia-mlops-library dependency to version 0.40.5 and fix SQL interval formatting in Drift and SimpleMetrics workflows for improved query accuracy.
2025-11-19 08:47:48 -03:00
vitor-aignosi
388685df6e SIENTIAPDE-1273
Update image tag to 1.1.2 in values.yaml and refactor prediction data sorting in model_repository.py for improved clarity and consistency.
2025-11-18 09:16:42 -03:00
vitor-aignosi
07dc612116 SIENTIAPDE-1273
Enhance data handling and export processes in Laborious workflows

- Updated `gates.py` to improve data quality validation, filtering, and formatting operations, including enhanced metrics recording.
- Refined `mlflow.py` to better manage model transformations and reference data retrieval from MLflow Model Registry.
- Enhanced `format_and_export_prediction.py` to support separate export of transformed data, improving flexibility in data handling.
- Added comprehensive test coverage for new functionalities, including transformed data formatting and retrain report generation.
- Improved documentation in `README.md` to reflect changes in activities and workflows, ensuring clarity on data processing and export paths.
2025-11-17 16:52:33 -03:00
vitor-aignosi
a88a15c60a SIENTIAPDE-1273
SIENTIAPDE-1273
Enhance security analysis and SQL injection handling

- Added skip for potential SQL injection false positives in Bandit configuration.
- Updated validate.sh to use the pyproject.toml configuration for Bandit security analysis.
- Refactored code to replace ensure_dataframe utility with direct DataFrame usage in multiple activities, improving clarity and reducing dependencies.
- Removed the deprecated dataframe_utils module to streamline the codebase.
2025-11-17 16:04:54 -03:00
vitor-aignosi
1014c33dd9 SIENTIAPDE-1273
Fix data size calculation in ModelMetrics class to use target_data.shape[0] for improved accuracy in metrics processing.
2025-11-17 11:03:27 -03:00
vitor-aignosi
019b46009a SIENTIAPDE-1273
Refactor data size calculation in ModelMetrics class to use shape method for improved accuracy. Changed from using len(target_data) to data.shape[0] for better clarity in data handling.
2025-11-17 10:56:58 -03:00
vitor-aignosi
4563ffecac SIENTIAPDE-1273
Update sientia-dataops-library dependency version to 1.6.1 and refactor return types in Gates class methods for improved type clarity. Changed return types from dict[str, Any] to dict for better compatibility with downstream systems.
2025-11-17 10:45:13 -03:00
vitor-aignosi
c9b1ddfd15 SIENTIAPDE-1273
Refactor data export in Drift, SimpleMetrics, and FormatAndExportPrediction workflows to improve data handling. Changed the export format from a list of dictionaries to direct objects for enhanced clarity and compatibility with downstream systems.
2025-11-17 10:38:44 -03:00
vitor-aignosi
08f9522695 SIENTIAPDE-1273
Refactor data export in MinimalRetrain workflow to improve structure. Changed the export format from a list of dictionaries to a direct report object for enhanced clarity and compatibility with downstream systems.
2025-11-17 10:36:17 -03:00
vitor-aignosi
91580f8255 SIENTIAPDE-1273
Refactor return type of get_reference_data method in MLFlow class to improve type specificity. Changed from a list of dictionaries with Hashable keys to a generic list of dictionaries for enhanced clarity in data handling.
2025-11-17 10:25:30 -03:00
vitor-aignosi
46fe88f69e SIENTIAPDE-1273
Refactor return types in ModelMetrics class methods to enhance type clarity. Updated calculate_drift and calculate_simple_metrics methods to return lists of dictionaries instead of generic lists, improving type specificity for better data handling.
2025-11-17 10:14:47 -03:00