-
Notifications
You must be signed in to change notification settings - Fork 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
update documentation #248
base: main
Are you sure you want to change the base?
update documentation #248
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 | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -37,10 +37,17 @@ the known expectations of the plan, passes it to the ``RunEngine`` and handles a | |||||||
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. | ||||||||
Handles communications between the ``BlueskyContext`` and ``Worker`` and sets up subscriptions for | ||||||||
publishing Bluesky event documents to the message bus. This object is injected as a dependency into | ||||||||
(using the FastAPI_ dependency injection system) to all REST endpoints, exposing their methods to | ||||||||
Comment on lines
+41
to
+42
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.
Suggested change
|
||||||||
the REST API. | ||||||||
|
||||||||
The REST API | ||||||||
^^^^^^^^^^^^ | ||||||||
|
||||||||
Exposes methods of the ``Worker`` to REST endpoints, which are used by the CLI as well. | ||||||||
Written with FastAPI_, this layer also validates request and response bodies/parameters. | ||||||||
|
||||||||
.. _RunEngine: https://nsls-ii.github.io/bluesky/run_engine_api.html | ||||||||
.. _IPython: https://ipython.org/ | ||||||||
.. _FastAPI: https://fastapi.tiangolo.com/lo/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Update the openapi schema | ||
------------------------- | ||
|
||
If you change any of the code in src/blueapi/service/main, it is imperative that | ||
you update the openapi schema to reflect these changes. There is a test to check | ||
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. add reason why |
||
that this has been done. | ||
|
||
Simply type, | ||
``` | ||
blueapi schema -u | ||
``` | ||
|
||
To update. You can also specify a `-o` tag to generate the schema elsewhere - note | ||
this doesn't work in combination to the `-u` tag. |
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. check how this shows up in dark mode |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||
Use the command line interface (CLI) | ||||||
==================================== | ||||||
|
||||||
Blueapi comes pacakged with a simple click based CLI. You can start the server | ||||||
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. delete first sentence |
||||||
and then query it for plans and devices, as well as ask it to run a plan, through | ||||||
the CLI. | ||||||
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.
Suggested change
|
||||||
|
||||||
Starting the server | ||||||
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. This needs merging with the out of date cli docs in main (https://diamondlightsource.github.io/blueapi/main/user/how-to/run-cli.html) an requires a link to https://diamondlightsource.github.io/blueapi/main/user/reference/cli.html |
||||||
------------------- | ||||||
You can start the server and optionally specify configuration options (see the | ||||||
documentation section on how to :doc:`configure blueapi <./configure-app>`) with | ||||||
the following command:: | ||||||
blueapi serve | ||||||
|
||||||
The default configuration options for this command will start up the server using | ||||||
startup scripts found in `src/blueapi/startup` - this will initialise the server | ||||||
with existing plans and devices that can be run with those plans. | ||||||
|
||||||
Find devices | ||||||
------------ | ||||||
A list of all usable devices can be retrieved with the following command:: | ||||||
blueapi controller devices | ||||||
|
||||||
Find plans | ||||||
---------- | ||||||
A list of all plans runnable by the server can be queried with:: | ||||||
blueapi controller plans | ||||||
|
||||||
Run a plan | ||||||
---------- | ||||||
To run a plan, you must specify a valid name of a plan with correct parameters. | ||||||
The 'sleep' command would need to be run like so:: | ||||||
blueapi controller run sleep '{"time": 2.0}' | ||||||
|
||||||
where `2.0` can be any number. By default, the worker will try to run the plan | ||||||
until completion, but you can specify a timeout:: | ||||||
blueapi controller run sleep '{"time": 2.0}' -t 1.0 | ||||||
|
||||||
In this case, this will fail with a timeout error. |
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.
It's now called handler but maybe should have a better name