Commit Graph

45 Commits

Author SHA1 Message Date
vitor-aignosi
83e43edf95 Fix formatting of NOSONAR comment in update_opc_servers method for consistency 2025-10-23 11:58:00 -03:00
vitor-aignosi
f415207d5b Update OPC server update method to include NOSONAR comment for code quality tools 2025-10-23 11:55:55 -03:00
vitor-aignosi
eea6ccb48f Refactor OPC manager shutdown logic for improved reliability
Updated the IngestorManager class to ensure that OPC managers are properly shut down and removed from the management list when servers are lost or removed. This change enhances the integrity checks for OPC server management by ensuring asynchronous handling of shutdown operations.
2025-10-23 11:52:00 -03:00
vitor-aignosi
6d2a0e46be Refactor OPC server integrity checks to be asynchronous
Updated the Ingestor and IngestorManager classes to use async methods for checking OPC server integrity and shutting down OPC managers. Adjusted related tests to ensure proper mocking of asynchronous behavior.
2025-10-23 11:46:02 -03:00
vitor-aignosi
47b3159e71 SIENTIAPDE-1312
Enhance OpcManager to accept subscription period from configuration

- Updated OpcManager to include subscription_period_ms as a parameter for better configurability.
- Refactored create_subscription method to utilize the new subscription period parameter.
- Adjusted unit tests to reflect changes in subscription handling and ensure correct functionality.
2025-10-20 12:41:05 -03:00
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
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
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
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
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
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
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
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
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
vitor-aignosi
b9ef69a865 SIENTIAPDE-988
Refactor OpcManager initialization and unsubscribe method; enhance logging

- Removed the `initialize_from_config` method from `OpcManager` class and adjusted the constructor to handle configuration directly.
- Improved the `unsubscribe` method to include detailed logging for non-existent subscriptions.
- Updated tests in `test_opc_manager.py` to reflect changes in the `OpcManager` class.
- Commented out Docker-related fixtures in `conftest.py` for potential future use.
- Enhanced test coverage in `test_single_node.py` and `test_data_manager.py` with additional scenarios and assertions.
- Introduced new methods in `Ingestor` and `IngestorManager` classes to manage server subscriptions and leases more effectively.
- Added new tests for `Ingestor` class to validate initialization and slot management logic.
- Implemented logging improvements across various classes to ensure better traceability of actions and errors.
2025-04-23 18:24:49 -03:00
vitor-aignosi
4208412eca SIENTIAPDE-988
Add temporary functiontal tests, that must be removed soon.

Refactor tests: Remove outdated resource manager tests and add functional tests with Docker and Kafka integration

- Deleted existing unit tests for ResourceManager.
- Introduced new functional tests for single node operations with Redis and Kafka.
- Added Docker Compose setup for test environment.
- Implemented fixtures for Redis and Kafka consumers.
- Created comprehensive tests for data publishing and slot management.
- Added unit tests for DataManager and IngestorManager with mocked dependencies.
- Included tests for OpcManager covering connection, subscription, and data change notifications.
2025-04-22 17:56:54 -03:00
vitor-aignosi
fa51d142e8 SIENTIAPDE-988
Enhance README and Docker setup; improve IngestorManager and DataManager functionality, add error handling, and implement unit tests for OPC initialization and subscription management.
2025-04-17 17:13:13 -03:00
vitor-aignosi
4e919a08be SIENTIAPDE-988 Implement core functionality for OPC ingestor, including main execution flow, IngestorManager methods, and OPC server management. Add unit tests for IngestorManager and OPCManager. 2025-04-16 17:02:26 -03:00
vitor-aignosi
988ee65fbf SIENTIAPDE-988
Implement initial structure for data ingestion with Kafka and OPC UA integration

- Added DataManager for Kafka message handling
- Introduced IngestorManager to manage data ingestion processes
- Created OpcManager for OPC UA client interactions
- Developed ResourceManager for Redis-based resource management
- Established testing framework with unit tests for DataManager and OpcManager
- Configured project settings for Python testing with pytest
2025-04-15 17:00:04 -03:00