Commit Graph

161 Commits

Author SHA1 Message Date
vitor-aignosi
3eacf27faf SIENTIAPDE-1312
Refactor OpcManager connection error handling and enhance unit tests

- Simplified error handling during connection attempts in OpcManager by removing redundant disconnection logic.
- Updated unit tests to include subscription_period_ms in server configuration and adjusted connection assertions to include a timeout parameter.
- Added new tests for disconnection fallback functionality to ensure robust error handling during disconnect attempts.
2025-10-20 17:08:40 -03:00
vitor-aignosi
aaa8d00f56 SIENTIAPDE-1312
Update OpcManager to set a timeout for the client connection

- Added a timeout parameter to the Client initialization in OpcManager to enhance connection reliability and prevent indefinite blocking during connection attempts.
2025-10-20 16:26:24 -03:00
vitor-aignosi
8c552f50a8 SIENTIAPDE-1312
Fix pod URI formatting and enhance disconnection error logging in OpcManager

- Updated pod URI construction to replace hyphens with colons for correct formatting.
- Improved error logging during disconnection attempts to include the attempt number for better traceability.
- Changed disconnection_fallback method call to be awaited for proper asynchronous handling.
2025-10-20 15:56:00 -03:00
vitor-aignosi
7001b5e9bd SIENTIAPDE-1312
SIENTIAPDE-1318 Enhance OpcManager disconnection handling

- Introduced a disconnection_fallback method to attempt multiple disconnects from the OPC UA server, improving reliability.
- Updated error handling during connection attempts to ensure proper logging and notification of disconnection failures.
- Refactored disconnect method to utilize the new fallback mechanism and maintain metrics accurately.
2025-10-20 15:27:05 -03:00
vitor-aignosi
44a9367663 SIENTIAPDE-1312
Update GITHUB_BRANCH in values.yaml to reflect changes for SIENTIAPDE-1312, focusing on improvements and corrections in data pipelines.
2025-10-20 12:41:30 -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
Matheus Demoner
64a1a14a8b Merge pull request #20 from Aignosi/SIENTIAPDE-1318-adicionar-pipeline-de-qualidade
Chore: Update dependencies, improve CI, and enhance code formatting
2025-10-20 08:37:51 -03:00
vitor-aignosi
acae38377f SIENTIAPDE-1318
Refactor app.py for consistency in comment formatting

- Updated the main asynchronous function and loop condition comments for improved readability and consistency.
2025-10-17 16:25:50 -03:00
vitor-aignosi
a192e2ba04 SIENTIAPDE-1318
Update app.py to add a comment for clarity in the main asynchronous function
2025-10-17 16:25:24 -03:00
vitor-aignosi
fe9fce0ba6 SIENTIAPDE-1318
Update app.py to add a comment for clarity in the main loop condition
2025-10-17 16:17:41 -03:00
vitor-aignosi
4c3289647b SIENTIAPDE-1318
Refactor app.py and enhance unit tests for better clarity and structure

- Updated `app.py` to improve async compatibility with a clearer comment.
- Added blank lines in `test_ingestor.py` for improved readability and organization of test cases.
2025-10-17 16:09:41 -03:00
vitor-aignosi
2fad392dcb SIENTIAPDE-1318
Refactor async handling and enhance unit tests for ingestor manager

- Updated `app.py` to improve async compatibility by adding a comment for clarity.
- Added new unit tests to handle scenarios where the ingestor manager is None, ensuring robustness in `manage_leases` and `loop` methods.
- Enhanced existing tests to cover edge cases related to the ingestor manager's state.
2025-10-17 16:07:13 -03:00
vitor-aignosi
1e4085d8c4 SIENTIAPDE-1318
Update GitHub Actions workflow to include a blank line for improved readability
2025-10-17 15:25:38 -03:00
vitor-aignosi
7e460018fe SIENTIAPDE-1318
Enhance GitHub Actions workflow for quality gate

- Added steps to generate a GitHub App token for authentication.
- Prepared `requirements.txt` to use HTTPS for GitHub dependencies.
- Configured Git to utilize the generated App token for repository access.
- Updated caching strategy to use the processed requirements file for improved dependency management.
2025-10-17 14:58:13 -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
Matheus Demoner
464c9aae9b Merge pull request #19 from Aignosi/OPC-connection-changes
Atualiza o OPC Manager para incluir um intervalo de watchdog de 1 hor…
2025-09-03 13:28:45 -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
Bruno Domingues
28dd9eb5c7 Merge pull request #18 from Aignosi/SIENTIAPDE-1084-ajustar-documentacao
SIENTIAPDE-1084: Enhance Data Management and Documentation
2025-09-03 13:32:48 +00:00
vitor-aignosi
0a3826b767 Merge branch 'main' into SIENTIAPDE-1084-ajustar-documentacao 2025-09-01 16:04:25 -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
873c733730 SIENTIAPDE-1084
Update README.md to clarify data streaming and storage features

- Revised descriptions for Real-time Data Streaming and Persistent Storage to emphasize historical data streaming capabilities.
- Updated Data Manager section to reflect the integration of both MongoDB and Kafka for data management.
- Enhanced configuration example in the prerequisites section with additional fields for server configuration.
2025-08-29 11:26:36 -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
Bruno Domingues
a384a077a9 Merge pull request #17 from Aignosi/SIENTIAPDE-1205-alterar-opc-para-assincrono
SIENTIAPDE-1205: Refactor Ingestor and OPC Manager for Asynchronous Shutdown and Enhanced Testing
2025-08-29 13:59:43 +00:00
vitor-aignosi
f92ee20831 SIENTIAPDE-1205
Update quality-gate.yml to include pytest-asyncio for enhanced async testing capabilities
2025-08-28 12:54:58 -03:00
vitor-aignosi
102507d815 SIENTIAPDE-1205
Enhance unit tests for async shutdown and improve assertions

- Updated `test_app.py` to verify multiple calls to `asyncio_sleep` and ensure proper handling of sleep intervals.
- Added new tests in `test_ingestor.py` and `test_opc_manager.py` to validate shutdown behavior and error handling for async operations.
- Improved assertions in existing tests to enhance reliability and clarity of test outcomes.
2025-08-28 08:34:30 -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
c09a96d4a4 SIENTIAPDE-1205
Remove __del__ method from Ingestor class to prevent blocking during cleanup and ensure proper async shutdown handling.
2025-08-27 08:49:19 -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
Bruno Domingues
ec3c738519 Merge pull request #16 from Aignosi/SIENTIAPDE-1193-conferir-como-a-escrita-de-datetime-ocorre-no-temporal
SIENTIAPDE-1193: Enhance Configuration, Update Dependencies, and Improve Timezone Handling
2025-08-26 13:39:53 +00:00
vitor-aignosi
59c1bc6214 Merge branch 'main' into SIENTIAPDE-1193-conferir-como-a-escrita-de-datetime-ocorre-no-temporal 2025-08-25 10:29:05 -03:00
Matheus Demoner
bd621cb46b Merge pull request #15 from Aignosi/SIENTIAPDE-1199-revisar-e-testar-observabilidade
Sientiapde 1199 revisar e testar observabilidade
2025-08-25 09:53:33 -03:00
vitor-aignosi
30eaab4f35 SIENTIAPDE-1193
SIENTIAPDE-1193 Update values.yaml to include new environment variables for enhanced configuration

- Added new environment variables for improved deployment flexibility.
- Updated existing configurations to align with recent changes in the application structure.
2025-08-25 09:19:24 -03:00
vitor-aignosi
c5744ebee4 SIENTIAPDE-1193
Update replica count and image tag in values.yaml for deployment configuration
2025-08-22 15:00:59 -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
63ba075a87 SIENTIAPDE-1193
Add OPC_TIMEZONE environment variable to values.yaml for timezone configuration
2025-08-22 10:01:12 -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
a19ec20c12 SIENTIAPDE-1199
Update Ingestor project name and metadata keys to lowercase for consistency

- Changed project_name, workflow_name, and schema_name from uppercase to lowercase in Ingestor class and corresponding unit tests.
2025-08-20 12:16:38 -03:00
vitor-aignosi
2fa07728f9 Refactor values.yaml to enable metrics service and remove unused API and OPC services
- Enabled metrics service with updated configuration for Prometheus ServiceMonitor.
- Removed disabled API and OPC service configurations to streamline values.yaml.
- Updated helm upgrade command version to 0.5.0.
2025-08-19 16:50:12 -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
Bruno Domingues
34be0e0ef7 Merge pull request #14 from Aignosi/SIENTIAPDE-1174-mapear-e-implementar-metricas-a-serem-criadas
Sientiapde 1174 mapear e implementar metricas a serem criadas
2025-08-13 16:34:20 -03:00
vitor-aignosi
ee69815f97 SIENTIAPDE-1174
Add metrics patch decorator to raw_opc_manager fixture for improved test isolation in test_opc_manager.py
2025-08-13 15:57:58 -03:00
vitor-aignosi
59f518b785 SIENTIAPDE-1174
Refactor test_init_metrics_calls_correct_metric_methods to use metrics directly instead of mock_metrics for improved clarity in test_opc_manager.py.
2025-08-13 15:53:10 -03:00
vitor-aignosi
753acf464b SIENTIAPDE-1174
Rename OpcManager instance in test_init_metrics_calls_correct_metric_methods for clarity in test_opc_manager.py.
2025-08-13 15:49:31 -03:00
vitor-aignosi
75bbcf5a28 SIENTIAPDE-1174
Reset mock metrics in test_init_metrics_calls_correct_metric_methods for improved test isolation in test_opc_manager.py.
2025-08-13 15:47:09 -03:00
vitor-aignosi
2cf836c35b SIENTIAPDE-1174
SIENTIAPDE-1174 Remove pod_id from test_prepare_ingestor to align with Ingestor class changes
2025-08-13 15:39:53 -03:00
vitor-aignosi
c10432eae8 SIENTIAPDE-1174
SIENTIAPDE-1174 Remove pod_id from Ingestor class initialization to streamline code structure
2025-08-12 08:53:06 -03:00
vitor-aignosi
2de4c4917f SIENTIAPDE-1174
Refactor test assertions in test_opc_manager.py for improved readability

- Updated the assertion syntax for notification calls in the test_check_opc_listenning_error_notification_and_retry function to use dictionary literals for clarity.
2025-08-05 14:01:51 -03:00