-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ add rabbitmq interface to long_running_tasks ⚠️🚨 #8198
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
♻️ add rabbitmq interface to long_running_tasks ⚠️🚨 #8198
Conversation
…nning-rabbitmq-client
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8198 +/- ##
==========================================
+ Coverage 87.99% 88.03% +0.04%
==========================================
Files 1917 1919 +2
Lines 74169 74311 +142
Branches 1301 1305 +4
==========================================
+ Hits 65264 65423 +159
+ Misses 8514 8495 -19
- Partials 391 393 +2
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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 refactors the long-running tasks framework to add RabbitMQ RPC interface support while maintaining the existing HTTP interface. The main purpose is to enable calling long-running tasks from other services via RabbitMQ RPC instead of just through HTTP.
- Splits the long-running tasks API into client and server RPC components communicating via RabbitMQ
- Improves task cancellation reliability and error handling
- Refactors task registration to use partials for serialization compatibility
- Renames API endpoints from
cancel_and_delete_tasktoremove_task
Reviewed Changes
Copilot reviewed 95 out of 96 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
services/web/server/src/simcore_service_webserver/long_running_tasks/ |
New modular structure with settings and plugin setup for webserver LRT integration |
services/web/server/src/simcore_service_webserver/projects/ |
Updates project creation and node operations to use new RPC client interface |
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py |
Refactored to register tasks with context and use new RPC-based setup |
services/storage/src/simcore_service_storage/ |
Removed unused long-running tasks module |
packages/service-library/src/servicelib/long_running_tasks/ |
Core refactoring with new RPC client/server, improved Redis store, and enhanced task management |
Comments suppressed due to low confidence (1)
packages/service-library/src/servicelib/long_running_tasks/task.py:59
- Class name has a typo:
_TetingErrorshould be_TestingError.
) -> Any: ...
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.
some last suggestions, let's align the result in the client with our other frameworks so they are used the same way.
also did you check what happens in storage as we discussed yesterday?
packages/service-library/src/servicelib/long_running_tasks/_lrt_client.py
Outdated
Show resolved
Hide resolved
packages/service-library/src/servicelib/long_running_tasks/_lrt_client.py
Outdated
Show resolved
Hide resolved
packages/service-library/src/servicelib/long_running_tasks/_lrt_server.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/long_running_tasks/_serialization.py
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.
thanks!
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
packages/service-library/src/servicelib/long_running_tasks/_lrt_client.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/long_running_tasks/task.py
Outdated
Show resolved
Hide resolved
packages/service-library/src/servicelib/long_running_tasks/task.py
Outdated
Show resolved
Hide resolved
|
@Mergifyio queue |
🛑 Configuration not compatible with a branch protection settingThe branch protection setting |
…itHK/osparc-simcore-forked into pr-osparc-long-running-rabbitmq-client
|



What do these changes do?
Unfortunately this is a very noisy pull request and I've tried my best to summarise here the most imporntat parts which changed, I would request to read this full description.
The amount of changes is mostly due to adjusting tests after these changes.
The change per se, is staring forward.
The code inside
servicelib/long_running_tasks/lrt_api.pywas split across an RPC interface:_rabbit/lrt_client.pypart which is called by thelrt_api.py_rabbit/lrt_server.pywhich replies to the requests from_rabbit/lrt_client.pyBEFORE
lrt_apilrt_apicalls required an instance ofTasksManager(part of the long running tasks internals)flowchart LR subgraph HTTP Interface A[HTTP Request] end subgraph LRT Interface B[lrt_api] end subgraph TasksManager C[Task Processor] end A <--> B B <--> CAFTER
lrt_apilrt_api)lrt_apicalls require a genericRabbitMQRPCClientenabling them to also be called from other servicesflowchart LR subgraph HTTP Interface A[HTTP Request] end subgraph LRT Interface E[lrt_api] B[lrt_client] C[lrt_server] end subgraph TasksManager D[Task Processor] end A <--> E E <--> B B <--> C C <--> DHighlights of most important changes:
packages/service-library/src/servicelib/long_running_tasks/_store/redis.pyinternals to deal with concurrencycancel_and_delete_taskwithremove_taskin aiohttp, FastAPI path names and OpenAPI specs (triggered regeneration of openapi-specs)TasksManagerwithRabbitMQRPCClientinsidelrt_apiinterfacelong_running_tasksmodule now has settings and is now a full moduleMost important files changed (🙏 extra attention here):
packages/service-library/src/servicelib/long_running_tasks/lrt_api.pypackages/service-library/src/servicelib/long_running_tasks/_rabbit/all files in modulepackages/service-library/src/servicelib/long_running_tasks/task.pythis is where the cancellation was addressedservices/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.pyservices/web/server/src/simcore_service_webserver/long_running_tasks/all files in moduleservices/docker-compose.ymlsince the long_running_tasks in the webserver have to use different namespaces, because the image is used for 4 different servicesRelated issue/s
dynamic-sidecarclient using RabbitMQ (enables easier k8s migration) #7224How to test
Dev-ops⚠️ 🚨
long_running_tasksdatabase formredis-commanderwhen deploying (due to models changing)