-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correct some docs manually migrate some files missed one line correct the file formatting change to a python block add index got the docs to build locally without sphinx warnings
- Loading branch information
Showing
19 changed files
with
231 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,34 @@ | ||
Architecture | ||
============ | ||
# Architecture | ||
|
||
|
||
Blueapi performs a number of tasks: | ||
|
||
* Managing the Bluesky RunEngine_, giving it instructions and handling its errors. Traditionally this job has been done by a human with an IPython_ terminal, so it requires automating. | ||
* Managing the Bluesky [RunEngine](https://nsls-ii.github.io/bluesky/run_engine_api.html), giving it instructions and handling its errors. Traditionally this job has been done by a human with an [IPython](https://ipython.org/) terminal, so it requires automating. | ||
* Maintaining a registry of plans and devices. In the aforementioned IPython_ case, these would have just been global variables. | ||
* Communicating with the outside world, accepting instructions to run plans, providing updates on plan progress etc. | ||
|
||
These responsibilities are kept separate in the codebase to ensure a clean, maintainable architecture. | ||
|
||
Key Components | ||
-------------- | ||
## Key Components | ||
|
||
.. figure:: ../images/blueapi-architecture.png | ||
:width: 600px | ||
:align: center | ||
|
||
main components | ||
 | ||
|
||
|
||
The ``BlueskyContext`` Object | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
### The `BlueskyContext` Object | ||
|
||
Holds registries of plans and devices as well as a number of helper methods for | ||
registering en-masse from a normal Python module. | ||
|
||
### The Worker Object | ||
|
||
The Worker Object | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
Wraps the Bluesky ``RunEngine`` and accepts requests to run plans. The requests include the name | ||
Wraps the Bluesky `RunEngine` and accepts requests to run plans. The requests include the name | ||
of the plan and a dictionary of parameters to pass. The worker validates the parameters against | ||
the known expectations of the plan, passes it to the ``RunEngine`` and handles any errors. | ||
the known expectations of the plan, passes it to the `RunEngine` and handles any errors. | ||
|
||
|
||
The Service Object | ||
^^^^^^^^^^^^^^^^^^ | ||
### The Service Object | ||
|
||
Handles communications and the API layer. This object holds a reference to the worker | ||
can interrogate it/give it instructions in response to messages it recieves from the message | ||
bus. It can also forward the various events generated by the worker to topics on the bus. | ||
|
||
|
||
.. _RunEngine: https://nsls-ii.github.io/bluesky/run_engine_api.html | ||
.. _IPython: https://ipython.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
3. No Queues | ||
============ | ||
# 3. No Queues | ||
|
||
Date: 2023-05-22 | ||
|
||
Status | ||
------ | ||
## Status | ||
|
||
Accepted | ||
|
||
Context | ||
------- | ||
## Context | ||
|
||
In asking whether this service should hold and execute a queue of tasks. | ||
|
||
Decision | ||
-------- | ||
## Decision | ||
|
||
We will not hold any queues. The worker can execute one task at a time and will return | ||
an error if asked to execute one task while another is running. Queueing should be the | ||
responsibility of a different service. | ||
|
||
Consequences | ||
------------ | ||
## Consequences | ||
|
||
The API must be kept queue-free, although transactions are permitted where the server | ||
caches requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
4. API Model Case | ||
================= | ||
# 4. API Model Case | ||
|
||
Date: 2023-05-23 | ||
|
||
Status | ||
------ | ||
## Status | ||
|
||
Accepted | ||
|
||
Context | ||
------- | ||
## Context | ||
|
||
Considering whether keys in JSON blobs from the API should be in snake_case or camelCase. | ||
This includes plan parameters which may be user-defined. | ||
|
||
Decision | ||
-------- | ||
## Decision | ||
|
||
The priority is not to confuse users, so we will not alias any field names defined in Python. | ||
|
||
Consequences | ||
------------ | ||
## Consequences | ||
|
||
Most code will be written with pep8 enforcers which means most field names will be snake_case. | ||
Some user defined ones may differ. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.