-
Notifications
You must be signed in to change notification settings - Fork 0
Add architecture documentation and refresh README #6
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,159 +1,106 @@ | ||||||
| # Collaborative SLAM Exploration for Robots | ||||||
|
|
||||||
| A proof-of-concept implementation of the Saga pattern for orchestrating multi-step, distributed workflows using Celery, Redis, PostgreSQL, and Flower. The scenario simulates collaborative SLAM (Simultaneous Localization and Mapping) exploration by multiple robots, with robust rollback (compensation) logic for failures. | ||||||
| A proof-of-concept that demonstrates how Celery, Redis Streams, and async command handlers can implement the Saga pattern for collaborative robot exploration. The project coordinates mission phases—resource allocation, route planning, exploration, and map integration—while providing compensating actions and rich telemetry. | ||||||
|
|
||||||
| ## Key Features | ||||||
| - **Saga orchestration:** The Celery flow builds a canvas of mission tasks with compensations using `link_error`. 【F:app/flows/mission_start_celery/orchestrator.py†L27-L50】 | ||||||
|
||||||
| - **Saga orchestration:** The Celery flow builds a canvas of mission tasks with compensations using `link_error`. 【F:app/flows/mission_start_celery/orchestrator.py†L27-L50】 | |
| - **Saga orchestration:** The Celery flow builds a canvas of mission tasks with compensations using `link_error`. [app/flows/mission_start_celery/orchestrator.py#L27-L50](app/flows/mission_start_celery/orchestrator.py#L27-L50) |
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.
Celery/Flower aren't key features -- we have 2 backends which brings their own tools but key features are implementing with 2 different backends
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.
we have "/scripts/unit-tests.sh" script to run unit tests
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.
we still need Linting instruction
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,129 @@ | ||||||
| # High-Level Architecture | ||||||
|
|
||||||
| This document summarizes the architecture of the Collaborative SLAM Exploration proof-of-concept. The PoC demonstrates how a Celery-driven saga orchestrates Redis stream based command handlers to coordinate multi-robot exploration workflows. | ||||||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, it isn't Celery driven saga architecture, we have option based on async-await python flow. Two backend options. also it worth to mention that we use Redis for request/reply pattern. So basically Celery has the list important role here but more important are 2 patterns: Saga and Request/reply, and for Saga we have 2 options: Celery and pure async-await python. and for Request/reply we have Redis backend. |
||||||
|
|
||||||
| ## System Context | ||||||
|
|
||||||
| The solution is triggered when an external operator emits a `mission:start` command. The asynchronous command listener routes the event to the saga orchestrator, which dispatches Celery tasks and compensations through Redis. Handlers emit multi-stage progress updates so that mission control can observe state through Flower and the Redis replies stream. | ||||||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd start from request/reply first -- it happen that one of the handlers have Saga pattern, but it isn't key moment. |
||||||
|
|
||||||
| ```mermaid | ||||||
| %%{init: {'theme': 'neutral'}}%% | ||||||
| flowchart TD | ||||||
| Operator([Mission Operator]):::actor | ||||||
| Control([Mission Control Tools]):::actor | ||||||
| subgraph System[Collaborative SLAM Orchestrator] | ||||||
| Orchestrator[Saga Orchestrator] | ||||||
| CeleryWorker[Celery Task Worker] | ||||||
| RedisBroker[(Redis Streams & Broker)] | ||||||
| Pg[(PostgreSQL State)] | ||||||
| Flower[[Flower Monitoring UI]] | ||||||
| end | ||||||
| Operator -->|Trigger mission:start| Orchestrator | ||||||
| Orchestrator -->|Publish command| RedisBroker | ||||||
| RedisBroker -->|Deliver tasks| CeleryWorker | ||||||
| CeleryWorker -->|Update mission state| Pg | ||||||
| CeleryWorker -->|Emit progress replies| RedisBroker | ||||||
| RedisBroker -->|Surface telemetry| Control | ||||||
| Flower -->|Read task events| RedisBroker | ||||||
| Control -->|Inspect task timeline| Flower | ||||||
| classDef actor fill:#f6f6f6,stroke:#333,stroke-width:1px; | ||||||
| ``` | ||||||
|
|
||||||
| ### Key Responsibilities | ||||||
|
|
||||||
| - **Saga Orchestrator** – Builds the Celery canvas that sequences mission tasks and compensations. 【F:app/flows/mission_start_celery/orchestrator.py†L21-L56】 | ||||||
|
||||||
| - **Saga Orchestrator** – Builds the Celery canvas that sequences mission tasks and compensations. 【F:app/flows/mission_start_celery/orchestrator.py†L21-L56】 | |
| - **Saga Orchestrator** – Builds the Celery canvas that sequences mission tasks and compensations. [app/flows/mission_start_celery/orchestrator.py (lines 21–56)](../app/flows/mission_start_celery/orchestrator.py#L21-L56) |
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.
please do these fixes for all references provided
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.
ok, please focus on even driven patterns in this schema.
We don't need add much details about backend -- you can mention that we have 2 options for backend (async/await python, Celery) and Redis consider as tool to stream events. And request_and_reply + multi_stage_reply implement Request/reply pattern for requester, and receiver side.
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.
I guess we can have just a separate section in the document which explain details of Celery implementation without spreading these details across a document
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.
we need 2 diagrams:
- Request/Reply pattern -- just give description of one command, all commands supposed to be the same: start, progress, completed, failed.
- Saga (ignore Celery implementation focus on idea -- which looks simpler in async/await python implementation) -- here you can show all commands (but without providing details on Request/Reply pattern (just in general)
and remember that we happen to call saga pattern in one of the Request/Reply handlers ("start_mission"), but we could have similar saga for other handlers laster as well -- they just point of splitting one command handling in a series of asynchronous commands.
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.
each backend has its own compensation tactics, you can mention both
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.
I'd say redisinsight provide to us much more important details about each command execution. ideally we should add OTEL + LGTM, but it will happen later
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.
we need to fix it -- main point is Even driven development patterns Request/Reply and Saga. And we use them to split complex mission into async stages.