-
Notifications
You must be signed in to change notification settings - Fork 32
✨ dynamic-scheduler can chain operations #8446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8446 +/- ##
===========================================
- Coverage 87.61% 68.08% -19.53%
===========================================
Files 1990 850 -1140
Lines 77403 37756 -39647
Branches 1333 175 -1158
===========================================
- Hits 67814 25706 -42108
- Misses 9190 11993 +2803
+ Partials 399 57 -342
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
🧪 CI InsightsHere's what we observed from your CI run for a1338ac. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR continues the migration of the dynamic scheduler module (part 6), focusing on enhancing the generic scheduler with event-driven capabilities and operation chaining functionality.
Key changes include:
- Added event-driven architecture for operation completion notifications
- Introduced operation chaining functionality allowing operations to start after others complete
- Enhanced the Operation class to support cancellation control
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/utils.py | Added utility functions for Redis store key validation and helper imports |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test_generic_scheduler.py | Enhanced tests with operation chaining scenarios and event handling validation |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__store.py | Updated store method names and added event proxy tests |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__operation.py | Updated Operation instantiation from list to class constructor |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_scheduler.py | Added comprehensive event scheduling tests for create/undo completion events |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_after.py | New test file for after-event management functionality |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__deferred_runner.py | Updated Operation instantiation and disabled redis-commander |
| services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__core.py | Extensive updates with new Operation syntax, event handling tests, and store validation |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_store.py | Added event proxy classes and renamed store methods for consistency |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_operation.py | Converted Operation from TypeAlias to class with cancellation support |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_models.py | Added EventType enum and OperationToStart dataclass |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_lifespan.py | Integrated AfterEventManager into application lifecycle |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_event_scheduler.py | Enhanced with create/undo completion event handling |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_event_after_registration.py | New module for event registration functions |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_event_after.py | New module implementing after-event management |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_event.py | Enhanced event functions for create/undo completion events |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_errors.py | Added OperationNotCancellableError |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_core.py | Major updates with event emission, operation chaining, and cancellation control |
| services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/init.py | Updated exports for new event registration functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...mic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_operation.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test_generic_scheduler.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_after.py
Outdated
Show resolved
Hide resolved
...c-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_event_after.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_scheduler.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_scheduler.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_scheduler.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__event_scheduler.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__core.py
Outdated
Show resolved
Hide resolved
...dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_store.py
Outdated
Show resolved
Hide resolved
...dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_store.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HEre a firest round of suggestions. I have some questions but i better do it offline.
...dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_store.py
Show resolved
Hide resolved
...heduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_event_scheduler.py
Outdated
Show resolved
Hide resolved
...ynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_errors.py
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__core.py
Show resolved
Hide resolved
...mic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_operation.py
Outdated
Show resolved
Hide resolved
services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__deferred_runner.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
...mic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_operation.py
Outdated
Show resolved
Hide resolved
...dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_store.py
Show resolved
Hide resolved
...mic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_operation.py
Outdated
Show resolved
Hide resolved
…ore-forked into migrate-dy-scheduler-6
|



What do these changes do?
In order to support meaningful scheduling workflows the ability to start operations one after another is required.
Operations can be:
on_create_completed(after the CREATE phase completes with success) andon_undo_completed(after the UNDO phase completes with success)start_operation(which now accepts extra optional parameters) or after it is already started viaregister_to_start_after_on_created_completedorregister_to_start_after_on_undo_completedEnhancements:
Operationis now an object, which allows to declare if it can be cancelled or not, since it does not make sense to cancel certain ones.services/dynamic-scheduler/tests/unit/services/generic_scheduler/test__core.pyby checking for the presence of a field instead of randomly waitingRelated issue/s
How to test
Dev-ops