Commit Graph

86 Commits

Author SHA1 Message Date
vitor-aignosi
9031b4c88f SIENTIAPDE-1231
Enhance README and code documentation for clarity and structure

- Added a comprehensive Table of Contents to the README for easier navigation.
- Introduced a new section on Code Quality & Validation, detailing the validation workflow and tools used.
- Improved descriptions and consistency in docstrings across various modules, including metrics, formatters, and MongoDB activities.
- Clarified function return types and arguments in the MongoDB and TemporalManager classes for better understanding.
2025-10-16 10:33:58 -03:00
vitor-aignosi
6b826863f4 SIENTIAPDE-1231
Enhance type hinting and code structure in orchestrator activities

- Added type hints for better code clarity in `formatters.py`, `mongo_db.py`, `temporal_manager.py`, and `email_builder.py`.
- Updated `.gitignore` to include `coverage.xml` for improved coverage reporting.
- Improved readability by restructuring variable declarations and method signatures.
2025-10-16 08:52:38 -03:00
vitor-aignosi
f3a6af5603 SIENTIAPDE-1231
Refactor orchestrator activities and configuration files

- Removed unused Temporal timeout environment variables from values.yaml.
- Reorganized import statements in various activity files for better readability.
- Updated logging messages to use consistent formatting across activities.
- Enhanced test cases to ensure proper initialization and shutdown of orchestrator activities.
- Improved overall code structure and readability by applying consistent formatting and style adjustments.
2025-10-15 17:20:52 -03:00
vitor-aignosi
310cae4c2f SIENTIAPDE-1231
SIENTIAPDE-1231: Add timeout configuration for Temporal tasks

- Introduced new timeout parameters in values.yaml for task execution.
- Updated TemporalManager to utilize execution and task timeout settings in seconds.
- Enhanced orchestrator_functions.py to include default timeout values for better orchestration control.
2025-10-10 15:55:03 -03:00
vitor-aignosi
5fdabd27c0 SIENTIAPDE-1231
Update orchestration configuration and execution parameters

- Adjusted execution counts in Jupyter notebook cells for better tracking.
- Updated schedule name in the orchestration configuration to align with new requirements.
- Modified `values.yaml` to change the GitHub branch for improved versioning.
- Enhanced `Activities` and `TemporalManager` classes to include timeout parameters for task execution.
- Updated connector configuration to include new timeout settings for better orchestration control.
2025-10-06 13:46:17 -03:00
vitor-aignosi
b816ad523b SIENTIAPDE-1222
Enhance README and activities with advanced notification filtering features

- Updated README to include new intelligent notification filtering capabilities, including TTL-based duplicate prevention and ignore lists.
- Enhanced `Formatters` activity to support notification filtering for scheduled reports and added detailed filtering logic.
- Improved `SlotManager` to implement advanced notification filtering with persistent alert detection and group-based filtering.
- Updated `Alerts` workflow to incorporate intelligent filtering for real-time error notifications, ensuring efficient alert delivery.
2025-09-16 16:36:32 -03:00
vitor-aignosi
137367c963 SIENTIAPDE-1222
Refactor orchestration and email handling

- Updated the orchestration queries to streamline model lookups and added conditions for active models.
- Changed the entry point in the local run script to use the worker module.
- Removed the deprecated samples.json file.
- Enhanced the Email activity to skip sending if the SMTP server is not configured.
- Added timestamp field handling in MongoDB activities for better data management.
- Updated connectors configuration to allow for a None SMTP server.
- Improved the common configuration function to include model configuration details.
2025-09-12 14:39:42 -03:00
vitor-aignosi
deeb6a6d2f SIENTIAPDE-1084
Remove outdated module docstrings from orchestrator and activities packages for improved clarity and maintenance.
2025-09-01 15:51:39 -03:00
vitor-aignosi
01b4c7a126 SIENTIAPDE-1182
Remove deprecated files and configurations

- Deleted coverage.sh, Dockerfile, docker-compose.yml, email.html, input_sample.json, and Makefile as part of the cleanup process.
- Updated README.md to reflect the removal of these components and provide a clearer overview of the project structure and functionality.
- Added module-level docstrings to orchestrator, activities, and workflows for improved documentation and clarity on system architecture.
2025-09-01 15:49:44 -03:00
vitor-aignosi
fbf006bb99 SIENTIAPDE-1205
SIENTIAPDE-1205: Update timestamp handling in MongoDB activities

- Modified timestamp formatting in mongo_db.py to apply UTC timezone before string conversion, ensuring consistency with DATETIME_FORMAT_MS_WITH_TZ.
2025-08-27 09:37:45 -03:00
vitor-aignosi
90e9e571b2 SIENTIAPDE-1205
SIENTIAPDE-1205: Simplify timestamp formatting in MongoDB activities

- Removed timezone conversion from timestamp handling in mongo_db.py, streamlining the formatting process while maintaining consistency with DATETIME_FORMAT_MS_WITH_TZ.
2025-08-27 09:35:55 -03:00
vitor-aignosi
2a3e5b8bc4 SIENTIAPDE-1205
SIENTIAPDE-1205: Refactor timestamp handling in MongoDB activities

- Updated the import statement in mongo_db.py to include timezone support.
- Modified timestamp formatting to ensure UTC timezone is applied before string conversion, enhancing consistency in datetime handling.
2025-08-27 09:32:42 -03:00
vitor-aignosi
93915841d6 SIENTIAPDE-1205
SIENTIAPDE-1205: Update GITHUB_BRANCH and standardize datetime handling in MongoDB activities

- Changed GITHUB_BRANCH in values.yaml from "main" to "SIENTIAPDE-1205-alterar-opc-para-assincrono".
- Updated datetime parsing in mongo_db.py to use DATETIME_FORMAT_MS_WITH_TZ for consistent timestamp handling.
2025-08-27 09:25:17 -03:00
vitor-aignosi
e17df007ab SIENTIAPDE-1205
Update orchestration notebook execution count, modify image tag in values.yaml, and standardize datetime handling in MongoDB activities

- Changed execution count in init_orchestration.ipynb from 2 to 1.
- Updated image tag in values.yaml from 0.4.4 to 0.4.5.
- Replaced DATETIME_FORMAT_MS_WITH_TZ with DATETIME_FORMAT_MS in mongo_db.py for consistent timestamp handling.
2025-08-27 09:12:24 -03:00
vitor-aignosi
4aa7ea70fa SIENTIAPDE-1193
refactor: standardize timestamp handling across MongoDB and SlotManager

- Replaced instances of `now()` with `date_now` for consistent timestamp usage in MongoDB and SlotManager activities.
- Updated test cases to mock the new `now()` function, ensuring accurate timestamp handling in unit tests.
- Adjusted timestamp formatting in various tests to align with the DATETIME_FORMAT_MS_WITH_TZ standard.
2025-08-25 10:04:26 -03:00
vitor-aignosi
d7effd44e5 SIENTIAPDE-1193
refactor: update date handling and remove deprecated constants

- Replaced the usage of datetime.now() with a new now() function from sientia_do.temporal.constants for consistent timestamp handling across multiple files.
- Updated the date format from DEFAULT_DATE_FORMAT to DATETIME_FORMAT_MS_WITH_TZ in various activities to ensure uniformity in timestamp formatting.
- Removed the obsolete patterns.py file that contained the DEFAULT_DATE_FORMAT constant.
2025-08-25 10:04:26 -03:00
vitor-aignosi
2ade08c916 SIENTIAPDE-1199
refactor: remove unused schedule_handles attribute from TemporalManager

- Eliminated the schedule_handles dictionary from the TemporalManager class as it was no longer needed.
- Cleaned up related code to ensure proper functionality without the removed attribute.
2025-08-20 14:58:15 -03:00
vitor-aignosi
02243a1e22 SIENTIAPDE-1199
refactor: enhance logging and metadata handling across activities

- Updated logging statements in Email, Formatters, MongoDB, SlotManager, and TemporalManager classes to include metadata for better traceability.
- Improved success reporting in MongoDB, SlotManager, and TemporalManager by specifying the number of successfully processed items.
- Refactored logger usage in worker.py to utilize custom_info for enhanced logging consistency.
2025-08-20 11:15:58 -03:00
vitor-aignosi
9e49dd4255 SIENTIAPDE-1169
chore: update dependencies and refactor logger imports

- Updated the sientia-dataops-library dependency version from 1.3.8 to 1.4.1 in requirements.txt.
- Changed image tag in values.yaml from 0.4.0 to 0.4.2.
- Refactored logger imports in multiple files to use the new observability module instead of the temporal module.
- Updated retry policy imports in various workflow files to reflect the new structure.
2025-08-19 16:47:25 -03:00
vitor-aignosi
31f2ff2439 SIENTIAPDE-1184
refactor: enhance shutdown procedures and documentation across activities

- Added shutdown methods to MongoDB and Email classes to ensure proper resource cleanup.
- Updated docstrings for shutdown methods to clarify their purpose and functionality.
- Enhanced documentation for various methods across multiple classes, improving clarity on parameters and return values.
- Improved the main function and other utility functions with detailed docstrings for better understanding and maintainability.
2025-08-14 09:48:19 -03:00
vitor-aignosi
bfb633c9d7 SIENTIAPDE-1184
docs: enhance docstrings in Formatters class

- Improved clarity and consistency of docstrings across multiple methods in the Formatters class.
- Added detailed descriptions for method arguments and return values to facilitate better understanding and usage.
- Ensured that all public methods now have comprehensive documentation, enhancing maintainability and readability.
2025-08-14 09:29:48 -03:00
vitor-aignosi
36c34d3208 SIENTIAPDE-1184
refactor: consolidate report handling in Formatters class

- Introduced a new method, manage_and_send_report, to streamline success and error report generation.
- Improved code readability by reducing duplication in report handling logic.
- Maintained existing functionality while enhancing the structure of report messages.
2025-08-14 09:26:10 -03:00
vitor-aignosi
4791665642 SIENTIAPDE-1184
SIENTIAPDE-1184
 refactor: improve schedule reporting in Formatters class

- Introduced a unified reporting structure for created, updated, and deleted schedules.
- Enhanced success and error report messages for clarity, including specific schedule types in notifications.
- Updated attachment handling in success and error reports to improve context and readability.
2025-08-14 09:19:48 -03:00
vitor-aignosi
e8ce3e75d5 SIENTIAPDE-1184
fix: enhance error reporting in Formatters class

- Updated the parse_report_schedule method to return a dictionary for error keys, including both message and attachment.
- Improved error report formatting in send_error_report method to include attachments for better context in failure notifications.
2025-08-14 08:50:21 -03:00
vitor-aignosi
4d75d581f8 SIENTIAPDE-1184
Changing "updated_at" type from str to datetime
2025-08-13 16:34:02 -03:00
vitor-aignosi
1306bed21d SIENTIAPDE-1184
fix: enhance error reporting in TemporalManager class

- Added typed_search_attributes to the schedule creation for improved search capabilities.
- Included traceback in error messages when schedule deletion fails, providing better context for debugging.
2025-08-12 16:26:24 -03:00
vitor-aignosi
5477f68b6b SIENTIAPDE-1184
fix: update notification IDs for error reporting in Formatters class

- Changed notification IDs for error reports related to schedule creation, update, and deletion to include the suffix '_ERROR' for better clarity in error handling.
2025-08-12 14:12:52 -03:00
vitor-aignosi
7fd38e1d52 SIENTIAPDE-1184
fix: add conditional check for data_filter in MongoDB activity

- Updated the insert_many method to only execute if data_filter is not empty, preventing unnecessary database operations and potential errors.
2025-08-12 13:36:13 -03:00
vitor-aignosi
6c1b7c4bf7 SIENTIAPDE-1174
feat: enhance notification filtering in Formatters and SlotManager classes

- Added logic to remove receiver groups with no notifications, improving the efficiency of notification handling.
- Implemented early return in Alerts and Reports workflows when there are no notifications or receiver groups, streamlining the processing flow.
2025-08-01 12:41:40 -03:00
vitor-aignosi
ae0fa2fc8a SIENTIAPDE-1174
feat: integrate metrics tracking for sent emails in Email activity

- Added metrics tracking for the number of emails sent, incorporating pod ID, model name, pipeline name, and email group for better monitoring.
- Enhanced logging to provide detailed information on email sending status for each receiver group.
2025-08-01 12:27:59 -03:00
vitor-aignosi
3a8eb04462 SIENTIAPDE-1172
fix: add conditional login for SMTP server and enhance test coverage

- Updated the Email class to conditionally log in to the SMTP server only if a sender password is provided, improving security.
- Enhanced test cases for the try_send_email method to cover various scenarios, including successful email sending and handling SMTP disconnections.
2025-07-30 09:25:02 -03:00
vitor-aignosi
ce380bd46d SIENTIAPDE-1172
fix: add timeout to SMTP connection for improved reliability

- Updated the SMTP connection in the Email class to include a timeout of 20 seconds, enhancing the robustness of email sending operations.
- Adjusted the reconnection logic to maintain consistent timeout settings during server initialization.
2025-07-30 08:55:59 -03:00
vitor-aignosi
e75e089b1b SIENTIAPDE-1172
refactor: rename send_email method to try_send_email and update parameter type

- Renamed the send_email method to try_send_email for clarity in its purpose.
- Changed the receivers parameter type from list[str] to str to simplify the method signature.
2025-07-30 08:43:48 -03:00
vitor-aignosi
0a5e137cc3 SIENTIAPDE-1172
SIENTIAPDE-1172
feat: update email configuration and enhance email sending functionality

- Changed EMAIL_SENDER in values.yaml to a new email address.
- Updated EMAIL_SENDER_PASSWORD key reference in values.yaml for improved security.
- Added PostgreSQL configuration parameters to values.yaml for database connectivity.
- Refactored Email class to include a new send_email method for better error handling during email transmission.
- Implemented reconnection logic for SMTP server disconnections to ensure reliable email delivery.
2025-07-30 08:29:11 -03:00
vitor-aignosi
263410b292 SIENTIAPDE-1172
feat: enhance notification handling in Formatters and SlotManager classes

- Introduced a mechanism to prevent duplicate notifications by tracking already added keys.
- Updated notification filtering logic to ensure unique notifications are processed for each receiver group.
- Improved overall notification management in orchestrator activities.
2025-07-29 12:13:08 -03:00
vitor-aignosi
6f6094b2ce SIENTIAPDE-1172
feat: enhance email notifications and orchestrator activities for reports

- Updated email HTML structure to clearly present errors, warnings, and info notifications.
- Introduced a new method in the Formatters class to filter notification reports based on group configurations.
- Enhanced the Reports workflow to integrate the new filtering functionality and manage notification packages effectively.
- Adjusted SlotManager to store timestamps with mail type specificity for better tracking.
- Improved test coverage for the new filtering functionality in the Formatters class.
2025-07-29 11:42:05 -03:00
vitor-aignosi
bc456cc8be SIENTIAPDE-1172
refactor: streamline email generation and enhance notification handling

- Updated email HTML structure to improve clarity and presentation of notifications.
- Enhanced notification generator to better manage execution counts and output formatting.
- Refactored Email class to improve error handling and logging during email sending.
- Adjusted EmailBuilder to efficiently process error, warning, and info models.
- Improved test coverage for email and notification functionalities to ensure reliability.
2025-07-29 10:25:31 -03:00
vitor-aignosi
c3ba2e4b5a SIENTIAPDE-1172
refactor: update email HTML structure and enhance notification generator

- Modified email HTML to reflect updated model names and error/warning messages.
- Adjusted notification generator to improve execution counts and streamline output handling.
- Refactored activities in orchestrator to correct parameter names and improve type hints for better clarity.
- Enhanced email builder to handle error, warning, and info models more efficiently.
2025-07-28 17:26:28 -03:00
vitor-aignosi
9bc238388a SIENTIAPDE-1172
feat: integrate email configuration and enhance orchestrator activities

- Added email configuration parameters to values.yaml for sender details and SMTP settings.
- Refactored Email class to correct parameter names and improve logging during initialization.
- Introduced build_email_config function to streamline email configuration retrieval.
- Updated worker.py to include email and Postgres configurations in the main orchestration process.
2025-07-28 16:12:22 -03:00
vitor-aignosi
ab657d0fda SIENTIAPDE-1172
feat: enhance email and slot manager activities with new filtering and caching functionalities

- Updated Email class to improve attachment handling and logging.
- Refactored Formatters class to process notifications more effectively by grouping them based on their configurations.
- Introduced new methods in SlotManager for filtering notification alerts and storing notification cache.
- Enhanced Alerts workflow to integrate new filtering and caching activities.
- Added tests for new functionalities in SlotManager and Formatters classes to ensure reliability.
2025-07-28 15:07:09 -03:00
vitor-aignosi
2a5534cf64 SIENTIAPDE-1172
feat: enhance orchestrator activities with new email and Postgres integrations

- Added Email and Postgres classes to the Activities class for improved functionality.
- Introduced new methods in MongoDB and SlotManager for loading and managing data.
- Updated requirements.txt to include jinja2.
- Added new formatting activity for log reports in Formatters class.
- Enhanced test coverage for MongoDB and SlotManager activities.
2025-07-25 16:03:39 -03:00
vitor-aignosi
66e9cf58e4 SIENTIAPDE-1171
SIENTIAPDE-1171 feat: add minimal retrain schedule configuration to samples.json and update formatters.py

- Added a new schedule configuration for the minimal retrain pipeline in samples.json.
- Updated the Formatters class in formatters.py to handle the new minimal retrain workflow type, integrating the minimal_retrain function for streamlined processing.
2025-07-23 12:51:55 -03:00
vitor-aignosi
2317bd404b SIENTIAPDE-1166
fix: add missing newline in MongoDB class for improved readability
2025-07-23 07:45:51 -03:00
vitor-aignosi
4905e61214 SIENTIAPDE-1166
feat: add TTL index functionality to MongoDB activities and update requirements

- Updated MongoDB class to accept TTL index duration in seconds.
- Implemented create_collection_with_ttl_index method to create collections with TTL indexes.
- Added environment variable for TTL index duration in connectors_config.
- Updated tests to cover new TTL index functionality and ensure proper behavior.
- Bumped sientia-dataops-library version to 1.3.4 in requirements.txt.
2025-07-22 15:09:15 -03:00
vitor-aignosi
37f4e6cf59 SIENTIAPDE-1151
fix: update GITHUB_BRANCH in values.yaml and ensure error messages are converted to strings in formatters.py for improved notification clarity
2025-07-18 09:49:55 -03:00
vitor-aignosi
92fbb704f5 SIENTIAPDE-1151
refactor: enhance error handling in build_tag_config and slot processing to include notifications for missing servers
2025-07-18 09:45:42 -03:00
vitor-aignosi
7c92bd2584 SIENTIAPDE-1163
refactor: enhance logging in activities to include metadata for improved context in notifications and error handling
2025-07-17 15:27:58 -03:00
vitor-aignosi
d60062af74 SIENTIAPDE-1163
refactor: update MongoDB notification IDs for error handling in activities; add tests for error scenarios in MongoDB and TemporalManager activities to ensure proper notification sending on failures
2025-07-16 15:18:49 -03:00
vitor-aignosi
b67d23da1f SIENTIAPDE-1163
refactor: update notification handling in activities to include metadata in notifications, enhancing context for error reporting and success messages; update requirements to use version 1.3.0 of the sientia-dataops-library
2025-07-16 13:14:16 -03:00
vitor-aignosi
2fa3a74bcc SIENTIAPDE-1150
refactor: update notification handler imports to use CoreNotificationHandler across activities and worker, enhancing consistency in notification management
2025-07-16 09:37:50 -03:00