Commit Graph

55 Commits

Author SHA1 Message Date
vitor-aignosi
e19b57d4b1 SIENTIAPDE-1318
Refactor project structure and update configurations

- Deleted the empty `__init__.py` file to clean up the project structure.
- Renamed the project from "laborious" to "ingestor" in `pyproject.toml`, updating the description accordingly.
- Improved type hints and conditional checks in the `Ingestor`, `DataManager`, `IngestorManager`, and `OpcManager` classes for better code clarity and type safety.
- Enhanced error handling and assertions in various methods to ensure robustness.
- Updated unit tests to reflect changes in class names and error handling improvements.
2025-10-17 14:54:39 -03:00
vitor-aignosi
e2462af31c Update dependencies, improve CI workflow, and enhance code formatting
- Updated the `sientia-dataops-library` dependency version from 1.4.3 to 1.4.6 in `requirements.txt`.
- Modified the GitHub Actions workflow to install development and runtime dependencies separately, improving clarity and organization.
- Added code formatting and linting checks using Ruff, along with type checking using mypy, to ensure code quality.
- Updated `.gitignore` to include additional cache directories and log files.
- Refactored code in various files for consistency in string formatting and improved logging messages.
2025-10-17 12:58:24 -03:00
Matheus
1eb5711345 Atualiza o OPC Manager para incluir um intervalo de watchdog de 1 hora e define o nome do cliente como o ID do pod. Ajusta os testes para refletir essas mudanças na inicialização do cliente. 2025-09-03 11:47:47 -03:00
vitor-aignosi
26f776f8e1 SIENTIAPDE-1084
Enhance documentation and improve shutdown methods for DataManager and IngestorManager

- Updated README.md to clarify persistent storage capabilities.
- Enhanced docstrings in DataManager and IngestorManager for shutdown processes, detailing resource cleanup and error handling.
- Improved comments in various methods to provide clearer explanations of functionality and side effects.
2025-09-01 12:47:39 -03:00
vitor-aignosi
8f6ba4ddcf SIENTIAPDE-1084
Remove deprecated files and enhance documentation

- Deleted `coverage.sh`, `docker-compose.yaml`, `Dockerfile`, and simulator-related files to streamline the project structure.
- Updated `README.md` to provide a comprehensive overview of the OPC Ingestor, including features, architecture, installation, usage, and troubleshooting.
- Enhanced docstrings across various classes and methods in the `ingestor` module for better clarity and maintainability.
- Improved Prometheus metrics documentation in `metrics.py` to ensure proper monitoring and observability of the system.
2025-08-29 11:20:28 -03:00
vitor-aignosi
f55604c7db SIENTIAPDE-1205
Refactor tests for async compatibility and enhance IngestorManager functionality

- Updated test cases in `test_app.py`, `test_ingestor.py`, and `test_ingestor_manager.py` to use async/await syntax for improved concurrency.
- Refactored methods in IngestorManager and related classes to support asynchronous operations, ensuring non-blocking behavior during execution.
- Enhanced mock setups in tests to accommodate async methods, improving test reliability and performance.
2025-08-27 17:00:06 -03:00
vitor-aignosi
501aac1868 SIENTIAPDE-1205
Update values.yaml and refactor shutdown methods for improved configuration and async handling

- Changed replica count from 2 to 1 in values.yaml for deployment optimization.
- Updated image tag from 0.4.3 to 0.4.5 in values.yaml for version consistency.
- Refactored shutdown method in IngestorManager to use await server.shutdown() for better async operation.
- Removed __del__ method in OpcManager to prevent blocking during cleanup.
2025-08-27 08:48:31 -03:00
vitor-aignosi
d4aa44d774 SIENTIAPDE-1205
Refactor Ingestor and OPC Manager for Asynchronous Operations

- Updated main function to be asynchronous and integrated asyncio for better concurrency.
- Refactored Ingestor methods to support async operations, including prepare_ingestor, loop, and shutdown.
- Enhanced IngestorManager and OpcManager with async methods for improved performance and responsiveness.
- Replaced blocking calls with await statements to ensure non-blocking behavior during operations.
- Added a new run_async_main function to handle the async event loop setup.
2025-08-26 16:27:35 -03:00
vitor-aignosi
0bdd7f5410 SIENTIAPDE-1193
Update requirements and refactor timestamp handling in DataManager

- Updated sientia-dataops-library version to 1.4.3 in requirements.txt.
- Refactored timestamp insertion in DataManager to use the now() function for improved consistency.
2025-08-22 13:59:11 -03:00
vitor-aignosi
9b4333a83e SIENTIAPDE-1193
Update requirements and refactor datetime handling in OpcManager for timezone support

- Commented out the specific version of sientia-dataops-library in requirements.txt and added a local path.
- Updated GITHUB_BRANCH in values.yaml for consistency with current development.
- Refactored source_timestamp handling in OpcManager to include timezone information.
- Adjusted timestamp formatting in test cases to reflect the new datetime format with timezone.
2025-08-22 10:00:00 -03:00
vitor-aignosi
f90a261d7c SIENTIAPDE-1199
Refactor logging levels in Ingestor and IngestorManager for improved clarity

- Changed debug log statements to info level in Ingestor class for better visibility of subscription and management actions.
- Updated log level for initializing OPC manager in IngestorManager to info for consistent logging practices.
2025-08-20 12:20:15 -03:00
vitor-aignosi
ac55ed8aff Update dependencies and refactor logger imports for observability
- Updated sientia-dataops-library version to 1.4.1 in requirements.txt.
- Changed image tag from 0.3.2 to 0.4.2 in values.yaml.
- Refactored logger imports from sientia_do.temporal.utils.logger to sientia_do.observability.logger in multiple manager files for improved observability.
2025-08-19 16:48:41 -03:00
vitor-aignosi
47e61360ff SIENTIAPDE-1174
Update requirements and refactor manager classes to remove pod_id

- Updated the sientia-dataops-library dependency version to 1.3.8 in requirements.txt.
- Refactored IngestorManager, OpcManager, and ResourceManager classes to remove pod_id from their initialization and internal handling, enhancing code clarity and consistency.
- Adjusted unit tests to reflect the removal of pod_id, ensuring they remain functional and accurate.
2025-08-05 10:59:29 -03:00
vitor-aignosi
bb40e723ba SIENTIAPDE-1174
Update BaseActivity initialization in manager classes to enable error counter metric

- Modified the initialization of DataManager, IngestorManager, OpcManager, and ResourceManager to include 'set_error_counter=True' for enhanced error tracking.
2025-08-04 15:32:49 -03:00
vitor-aignosi
9fb2862d3c SIENTIAPDE-1174
Update BaseActivity initialization in manager classes to disable error counter metric

- Modified the initialization of DataManager, IngestorManager, OpcManager, and ResourceManager to include 'set_error_counter_metric=False' for improved error handling.
2025-08-04 15:02:55 -03:00
vitor-aignosi
bc7008acdf SIENTIAPDE-1174
Update requirements and environment configurations

- Changed the sientia-dataops-library dependency to a relative path in requirements.txt.
- Updated image tag to 0.3.0 in values.yaml.
- Renamed HTTP_SERVER_PORT to HTTP_METRICS_PORT in app.py and updated its default value to 9090.
- Added TAG_WRITTEN_COUNT metric in metrics.py to track writing processes.
- Incremented TAG_WRITTEN_COUNT in DataManager upon successful data insertion.
2025-07-31 08:30:00 -03:00
vitor-aignosi
9309d7591e SIENTIAPDE-1163
SIENTIAPDE-1163
Refactor Ingestor and DataManager classes to enhance metadata handling

- Updated Ingestor class to include additional metadata fields: 'workflow_name' and 'schema_name'.
- Modified DataManager to accept metadata during initialization.
- Adjusted unit tests to validate the new metadata structure and ensure proper functionality across various managers.
- Removed unused logger initialization in tests for cleaner code.
2025-07-17 14:27:16 -03:00
vitor-aignosi
5132162eaa SIENTIAPDE-1163
Refactor Ingestor and Manager classes to use CoreNotificationHandler and improve metadata handling

- Updated Ingestor class to initialize logger using get_logger and replaced notification handler initialization with metadata dictionary.
- Refactored DataManager, IngestorManager, OpcManager, and ResourceManager classes to inherit from BaseActivity, allowing for consistent logger and notification handler usage.
- Enhanced notification handling by integrating metadata into notification methods across various managers.
- Added .vscode/ to .gitignore to exclude VSCode configuration files.
2025-07-16 10:54:34 -03:00
vitor-aignosi
0885544bc7 SIENTIAPDE-1163
Update values.yaml for image tag and GITHUB_BRANCH

- Updated image tag to "0.2.4" for the latest version.
- Changed GITHUB_BRANCH value to "SIENTIAPDE-1163-alterar-dinamica-de-notificacoes-para-usar-o-mongodb-ao-inves-do-kafka".
- Removed .vscode/settings.json as it is no longer needed.
2025-07-16 10:16:02 -03:00
vitor-aignosi
1512ca98bd SIENTIAPDE-1110
Refactor OpcManager to improve node subscription handling

- Simplified the address node assignment in the OpcManager class by directly using a local variable instead of an instance variable.
- Enhanced debug logging to provide clearer insights into the nodes being subscribed to.
2025-07-08 12:32:21 -03:00
vitor-aignosi
7391ed3ba5 SIENTIAPDE-1110
Refactor OPC Manager metrics logging for improved readability

- Reformatted metrics logging statements in the OpcManager class for better readability and consistency.
- Enhanced debug logging to provide clearer insights into subscription management and connection status.
2025-07-08 12:25:11 -03:00
vitor-aignosi
22ed2c8cde SIENTIAPDE-1110
Update GITHUB_BRANCH in values.yaml and remove debug log in DataManager

- Changed GITHUB_BRANCH value to "SIENTIAPDE-1110-criar-testes-e-2-e" in values.yaml.
- Removed unnecessary debug log for skipping messages in DataManager class.
2025-07-08 11:38:32 -03:00
vitor-aignosi
750d947d7e Update MongoDB connection handling in DataManager and enhance IngestorManager configuration
- Updated DataManager to simplify MongoDB connection logic by removing retry loop and adding logging for connection attempts.
- Enhanced IngestorManager to accept MongoDB connection parameters and export_to_kafka flag as part of its initialization.
- Updated requirements.txt to use the latest version of the sientia-dataops-library.
2025-07-03 15:35:38 -03:00
vitor-aignosi
28866ac9c8 Update logging in DataManager to use debug level for message skipping and insertion confirmation
- Changed log level from info to debug for skipping messages to Kafka topic.
- Added debug log for successful message insertion into MongoDB collection.
2025-07-03 14:13:00 -03:00
vitor-aignosi
cbaa66026c Add support for Kafka export in Ingestor and DataManager classes
- Introduced EXPORT_TO_KAFKA environment variable in Ingestor class.
- Refactored DataManager to conditionally initialize Kafka producer based on export setting.
- Updated IngestorManager to pass Redis configuration as a dictionary.
- Enhanced error handling and logging for Kafka message publishing.
2025-07-03 13:45:09 -03:00
vitor-aignosi
c5b23da373 Update MongoDB configuration in values.yaml and enhance Ingestor class to utilize MongoDB connection parameters 2025-07-01 12:31:46 -03:00
vitor-aignosi
d79f882018 Add MongoDB integration to DataManager, switch Python language server to Jedi, and include pymongo in requirements.txt 2025-07-01 12:19:06 -03:00
vitor-aignosi
38273dab13 Update ingestor_manager.py 2025-06-09 16:48:19 -03:00
vitor-aignosi
5edc2983f7 Merge branch 'main' into SIENTIAPDE-988-criar-ingestor-opc 2025-06-09 16:45:45 -03:00
vitor-aignosi
82f3e9358d SIENTIAPDE-988
Refactor variable naming for clarity and update image tag and service settings in values.yaml
2025-06-09 16:31:04 -03:00
Bruno Domingues
0fe2343891 SIENTIAPDE-1083: add prometheus metrics to ingestor_manager. 2025-05-29 17:47:53 -03:00
Bruno Domingues
c49f04ded6 SIENTIAPDE-1083: add prometheus metrics to opc_manager. 2025-05-29 16:52:10 -03:00
Bruno Domingues
03ed5784b1 SIENTIAPDE-1083: add prometheus metrics to resource_manager. 2025-05-29 11:38:57 -03:00
Bruno Domingues
f71b4c7937 SIENTIAPDE-1083: add prometheus metrics to data_manager. 2025-05-28 21:30:28 -03:00
vitor-aignosi
c7dbe3585b SIENTIAPDE-1049
Update ingestor and data manager for improved shutdown handling and logging

- Incremented project version in quality gate configuration.
- Commented out ingestor service in docker-compose for clarity.
- Enhanced main loop in app.py to handle exit signals and exceptions.
- Added shutdown methods in Ingestor and DataManager classes for graceful resource cleanup.
- Updated unit tests to validate shutdown behavior and exception handling.
- Introduced coverage configuration to omit specific files.
2025-05-21 09:46:38 -03:00
vitor-aignosi
92ed3c9cb2 SIENTIAPDE-1049
Fix
2025-05-21 09:46:38 -03:00
vitor-aignosi
2fa1d2175e SIENTIAPDE-1049
Stability fix try
2025-05-21 09:46:38 -03:00
vitor-aignosi
1fa6558986 SIENTIAPDE-1049
Integrity fix
2025-05-21 09:46:38 -03:00
vitor-aignosi
39530f115e SIENTIAPDE-1049
Integrity fix
2025-05-21 09:46:38 -03:00
vitor-aignosi
b03fe75753 SIENTIAPDE-1049
Handling size change
2025-05-21 09:46:38 -03:00
vitor-aignosi
bb4ab7d209 SIENTIAPDE-1049
Refactor logging statements for consistency and clarity; update environment variable parsing to handle string inputs.
2025-05-21 09:46:38 -03:00
vitor-aignosi
9196861033 SIENTIAPDE-1049Enhance OPC connection handling with error logging and update branch in values.yaml 2025-05-21 09:46:38 -03:00
vitor-aignosi
3a2d488eed Refactor logging in Ingestor and OpcManager to use debug level
- Changed logging statements in Ingestor and OpcManager from info to debug level to reduce log verbosity and improve performance.
- This adjustment aids in better log management while maintaining necessary traceability for debugging purposes.
2025-05-05 14:43:55 -03:00
vitor-aignosi
342535b7e7 Enhance OpcManager logging for data change notifications
- Added logging statements to OpcManager to track data change notifications and cycle count resets for monitored tags.
- Improved traceability of events related to OPC cycles, aiding in debugging and monitoring.
2025-05-05 11:10:16 -03:00
vitor-aignosi
5f95b6309e SIENTIAPDE-988
Enhance IngestorManager and related tests with notification handling integration

- Added notification_handler parameter to IngestorManager and OpcManager initialization for improved event handling.
- Updated unit tests to include notification_handler in the Ingestor and IngestorManager instantiation, ensuring proper coverage of new functionality.
- Refactored test cases to validate the integration of notification handling across components.
2025-05-05 10:06:05 -03:00
vitor-aignosi
d00078d323 SIENTIAPDE-988
Enhance ingestor and manager classes with notification handling

- Integrated NotificationHandler into Ingestor, DataManager, IngestorManager, and OpcManager for improved error reporting and monitoring.
- Updated methods to send notifications on critical events such as Kafka publishing errors, OPC connection issues, and cycle count warnings.
- Refactored related tests to ensure coverage of new notification functionalities and validate integration with existing components.
- Improved logging and error handling across the system to enhance traceability and operational insights.
2025-04-30 19:28:43 -03:00
vitor-aignosi
c65c016b91 SIENTIAPDE-1017
Add container ports to deployment and update service configuration
2025-04-28 08:06:44 -03:00
vitor-aignosi
8674a710af SIENTIAPDE-1017
Update liveness and readiness probes, enhance Redis connection, and refine OPC tag data structure
2025-04-25 16:57:55 -03:00
vitor-aignosi
9eb483ee92 SIENTIAPDE-1017
Enhance OPC ingestor with Redis authentication and update Helm chart configurations. Improve README for clarity on Docker and Kubernetes setup.
2025-04-25 13:26:42 -03:00
vitor-aignosi
da079c6320 SIENTIAPDE-988
Refactor ingestor lease management and update Docker configurations

- Updated CMD in Dockerfile to use the correct application entry point.
- Added docker compose command to remove volumes in README.
- Removed unnecessary restart policy from ingestor service in docker-compose.yaml.
- Refactored manage_leases method in Ingestor class to improve clarity and parameter naming.
- Added get_number_of_leases method in IngestorManager to retrieve active leases.
- Implemented get_all_leases method in ResourceManager to fetch active leases from Redis.
- Enhanced unit tests for lease management in test_ingestor_manager and test_resource_manager.
2025-04-24 08:42:56 -03:00