-
Notifications
You must be signed in to change notification settings - Fork 13
docs: restructure how-to and tutorial pages #1564
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
Open
shree-iyengar-dls
wants to merge
46
commits into
main
Choose a base branch
from
1468_restructure_blueapi_docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
6c82b8c
docs: restructure how-to and tutorial pages
shree-iyengar-dls 7145c06
docs: change relative paths for cross-referencing
shree-iyengar-dls c598238
Merge branch 'main' into 1468_restructure_blueapi_docs
shree-iyengar-dls b7d552f
docs: addition to start rabbitmq section of run-bus.md
shree-iyengar-dls ddcb178
docs: add info on how to run a plan from docs page
shree-iyengar-dls 65ebde1
docs: add details on how to run a plan from the docs page
shree-iyengar-dls f2a670f
docs: finish off writing docs to run a plan through docs page
shree-iyengar-dls e7f9688
docs: fix reference in run-cli.md file
shree-iyengar-dls 417ed4a
chore: change image in docs from jpeg to png
shree-iyengar-dls 2e9099b
docs: update based on PR comments
shree-iyengar-dls 77a3ee1
style: reword Run Auth locally docs page
shree-iyengar-dls 4abb4d8
docs: add note about needing access to namespaces
shree-iyengar-dls 9f1ce6a
docs: add details to troubleshooting section
shree-iyengar-dls ad72bc7
Merge branch 'main' into 1468_restructure_blueapi_docs
shree-iyengar-dls 94c2586
change working in step 3 of run plan through docs page
shree-iyengar-dls 1d3ec09
style: fix typo in step 3 of run plan through docs page
shree-iyengar-dls 67ae317
docs: number and restructure tutorials section
shree-iyengar-dls 3f2dfec
docs: restructure how tos section
shree-iyengar-dls 8658cec
docs: move a couple of pages to how-to section
shree-iyengar-dls 4aeed5a
Update docs/how-to/local-auth.md
shree-iyengar-dls f99328a
docs: reorder files in tutorials folder
shree-iyengar-dls de79db7
docs: change file path in config docs page
shree-iyengar-dls 0ee422b
docs: rewrite tutorials section such that it walks through additions …
shree-iyengar-dls 7d6aa6a
chore: improve one of the error messages in def run_plan
shree-iyengar-dls d1bef1c
docs: add extra detail to top of Run a Plan from Docs page page
shree-iyengar-dls 8882fe2
docs: address comments for adding plns to init file
shree-iyengar-dls 6ca878a
style: fix typo
shree-iyengar-dls b3f08bc
docs: updates to tutorial pages after testing
shree-iyengar-dls 979405f
docs: update how-to pages
shree-iyengar-dls 1b3ffb0
chore: resolve issues due to CI failing
shree-iyengar-dls ccccaed
tests: fix test_run_plan_feedback unit test
shree-iyengar-dls 7d0a1df
docs: add detail on how to add extra config components and link to ho…
shree-iyengar-dls 6db9c97
docs: restructure how-to section for config details
shree-iyengar-dls 412bca8
docs: update myst cross references
shree-iyengar-dls c8e42ea
docs: fix typos and add links for blueapi deployment
shree-iyengar-dls f5b0dda
docs: add docs for dev tooling
shree-iyengar-dls 193333e
Merge branch 'main' into 1468_restructure_blueapi_docs
shree-iyengar-dls d96757c
chore: add back disable worker restart
shree-iyengar-dls 7e055e4
docs: update run system test docs
shree-iyengar-dls c3366d4
docs: rename one of the pages in how-to section
shree-iyengar-dls 0c60f57
Merge branch 'main' into 1468_restructure_blueapi_docs
shree-iyengar-dls 18ecf5c
Merge branch 'main' into 1468_restructure_blueapi_docs
shree-iyengar-dls 8e72cfc
docs: add just notes to run blueapi and services locally
shree-iyengar-dls e09e32d
docs: rename docs page
shree-iyengar-dls 854d781
docs: update to tutorials section with websockets info
shree-iyengar-dls 8e404bc
docs: add troubleshooting section to installation page
shree-iyengar-dls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
docs/how-to/integrate-with-numtracker.md → docs/how-to/1.4 integrate-with-numtracker.md
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # 1.6 Tiled | ||
|
|
||
| Tiled is a server and data management system used to store and organise experimental data through a web API. It is run as a (mostly) centralised service. The RunEngine inserts bluesky documents directly into Tiled. At the moment, NeXus files are written from the messages published on the message bus. Tiled should contain the same information that is in the NeXus files but in due course, Tiled should be the one source of truth. | ||
|
|
||
| ## Configuration | ||
|
|
||
| An example configuration to enable tiled is shown in this `config.yaml` file. | ||
|
|
||
| ```{literalinclude} ../../tests/system_tests/config.yaml | ||
| :language: yaml | ||
| ``` | ||
|
|
||
| The options to configure Tiled are in the `TiledConfig` model which can be found in the [config.py file](../../src/blueapi/config.py). Apart from the url, the main aspect is authentication. This is either an ApiKey: | ||
|
|
||
| ``` | ||
| authentication: secret-key | ||
| ``` | ||
|
|
||
| or service account details: | ||
|
|
||
| ``` | ||
| authentication: | ||
| client_id: "client-id" | ||
| client_secret: "secret" | ||
| token_url: "url" | ||
| ``` | ||
|
|
||
| The values in the `config.yaml` are the default ones use if the user doesn't provide them. |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Deploying a new version of BlueAPI | ||
|
|
||
| Follow these [instructions](https://gitlab.diamond.ac.uk/sscc-docs/developer-guide/-/blob/4f28b0c4b17e34ae19faf698024bceb6e20992c9/topics/kubernetes/docs/tutorials/local_helm_on_argocd.md) for changing/testing new Blueapi deployments. | ||
|
|
||
|
|
||
| Links to the relevant services and deployment repositories: | ||
| - Testing (pxx) beamlines: [epics-containers](https://github.com/epics-containers) | ||
| - Other beamlines: [GitLab folder](https://gitlab.diamond.ac.uk/controls/containers/beamline) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Run BlueAPI and connect to services locally | ||
|
|
||
| For development purposes, it can be useful to run BlueAPI and adjacent services (Numtracker, Tiled, OPA etc.) locally, i.e. not in a devcontainer. Following the steps in this page will allow you to launch an instance of NumTracker, RabbitMQ, Keycloak, Tiled, OPA and a number of IOCs, in detached mode. This can be useful for learning about the stack, running system tests checking if changes during development propagate as expected etc. | ||
|
|
||
| Before starting, ensure you have followed the [Installation instructions](../tutorials/1.%20installation.md). | ||
|
|
||
| 1. Before starting, run: `module load uv just docker-compose/5.4.0` in the terminal. This will ensure you have the required packages. | ||
|
|
||
| 2. The default command `just` into the terminal will do the following: | ||
| - A. initialise the example-services repo | ||
| - B. launch an instance of NumTracker, RabbitMQ, Keycloak, Tiled, OPA and a number of IOCs in detached mode | ||
| - C. set required EPICS environmental variables | ||
| - D. start the BlueAPI server using the the config in `tests/system_tests/config.yaml` | ||
|
|
||
| 3. To run the above separately use the following commands: | ||
| - 2A and 2B: `just compose` | ||
| - 2C and 2D: `just serve` | ||
|
|
||
| 4. In a new terminal window, to run unit and system tests respectively: `just unit` and `just system` | ||
|
|
||
| 5. Other commands available (use `just --list` to see them) | ||
| - `just run PLAN PARAMS`: provide session, plan and parameter details to run a plan | ||
| - `just lint`: will run all the precommit checks, update the BlueAPI schema, run pyright | ||
| - `just coverage`: generate code coverage report | ||
| - `just repl`: will give you a repl with pre-configured and logged in client | ||
| - `just compose down`: tear down adjacent services | ||
|
|
||
| Channel Access | ||
|
|
||
| To log in through the BlueAPI CLI: | ||
|
|
||
| 1. Run `blueapi login` (if you want to run a plan with stomp config, add the `-c tests/system_tests/config.yaml` parameter) | ||
| 2. Follow the login prompted to Keycloak, then log in with the username `admin` and password `admin` | ||
| 3. When prompted by Keycloak, grant BlueAPI access to the listed privileges | ||
| 4. Run `blueapi controller plans` to check that the log in has succeeded | ||
|
|
||
| By default the BlueAPI instance will be available via the OAuth2 proxy at `localhost:4180`, and Tiled through its OAuth2 proxy at `localhost:4181`. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Commands for dev tooling | ||
|
|
||
| This page outlines useful commands for dev tooling. More information can be found in the [python-copier-template docs](https://github.com/DiamondLightSource/python-copier-template/tree/main/docs). | ||
|
|
||
| The table below outlines useful commands with instructions for download on Diamond workstations. | ||
|
|
||
| | Command | Installation | Example of use| | ||
| | ------------- | ------------- | ------------- | | ||
| | `podman` | [Dev-Guide link](https://dev-guide.diamond.ac.uk/containers/tutorials/podman/) | `podman run ghcr.io/diamondlightsource/blueapi:latest` to pull the blueapi container from the GitHub container registry | | ||
| | `docker-compose` | [Dev-Guide link](https://dev-guide.diamond.ac.uk/epics-containers/reference/setup/#docker-compose) | `docker compose -f tests/system_tests/compose.yaml up -d` to spin up dummy versions of blueapi associated services | | ||
| | `uv` | `module load uv` | `uv run --with blueapi path/to/script.py` to run a standalone script | | ||
| | `prek` | Run `uv run prek install` the first time the repo is cloned to set up pre-commit checks | `uv run prek` or `uv run prek --all-files` | | ||
| | `tox` | `uv tool install tox` | `tox -e tests -- tests/unit_tests/test_config.py::test_config_yaml_parsed` is an example of running a specific test and `tox -e tests` will run all unit tests| | ||
| | `just` | `uv tool rust-just` | `just lint` will run all pre-commit checks| |
File renamed without changes.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [rabbitmq_stomp]. |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # 2. Quickstart guide | ||
|
|
||
| Blueapi acts as a worker that can run Bluesky plans against devices for a specific laboratory setup. It can control devices to collect data and export events to tell downstream services about the data it has collected. | ||
|
|
||
| You should be in the blueapi directory that you have cloned. From here, if you open VSCode, you will probably be prompted to 'Reopen in Container' which you can do and then run the following commands to start the worker. | ||
|
|
||
| If you not, you can still run the following from the venv created in page 1 but you may need to run the command below to have the dependencies required for this tutorial. | ||
|
|
||
| ``` | ||
| pip install .[demo] | ||
| ``` | ||
|
|
||
| ## Start Worker | ||
|
|
||
| To start the worker: | ||
| ``` | ||
| blueapi serve | ||
| ``` | ||
| This will use all the defaults in `src/blueapi/config.py` | ||
|
|
||
| ## Basic Introspection | ||
|
|
||
| Blueapi comes with a minimal CLI client for basic control/debugging. We can use this to see which plans and devices are available. In a new terminal window, run the following commands. | ||
|
|
||
| If working in a venv, you may need to reactivate it. To do this, assuming you are still in the blueapi repo in your terminal, use: | ||
| ``` | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| Now, run the following to see what plans and devices are available: | ||
|
|
||
| ``` | ||
| blueapi controller plans | ||
| blueapi controller devices | ||
| ``` | ||
|
|
||
| We should now have an empty context. | ||
|
|
||
| See also [Full CLI reference](../reference/cli.md) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
Worker or server?
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.
Hmm is it better to say 'Blueapi contains a worker that can run ...' ?