Skip to content
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

Refactor utility script to allow for future services #707

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .devcontainer/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
rabbitmq:
image: rabbitmq:management
container_name: 'rabbitmq'
ports:
- 5672:5672
- 15672:15672
- 61613:61613
volumes:
- ./rabbitmq_setup/enabled_plugins:/etc/rabbitmq/enabled_plugins
File renamed without changes.
26 changes: 17 additions & 9 deletions docs/tutorials/quickstart.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: To avoid me having to do another huge rebase, can we get #674 in first and then rebase to suit this (pleeease)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can address my comments ;P

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ Blueapi acts as a worker that can run bluesky plans against devices for a specif
laboratory setup. It can control devices to collect data and export events to tell
downstream services about the data it has collected.

## Start RabbitMQ
## Start Services

The worker requires a running instance of RabbitMQ. The easiest way to start it is
to execute the provided script:
The worker requires other infrastructure services running- these are captured in a [compose-spec](https://github.com/compose-spec/compose-spec/blob/main/spec.md) file: `.devcontainer/compose.yml`, and may later be started as part of building the devcontainer when [compatibility with podman is improved](https://github.com/devcontainers/cli/issues/863).

To run the services:
```
src/script/start_rabbitmq.sh
# with docker
docker compose -f .devcontainer/compose.yml up
# or with podman-compose
podman-compose -f .devcontainer/compose.yml up
Comment on lines +13 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: Although we gave up on autostarting these services in the devcontainer, can we make docker-compose available in the devcontainer so the developer can do it manually? Otherwise this whole section doesn't apply if you're using a devcontainer.

```

This creates and configures:
- RabbitMQ with the rabbitmq_stomp plugin exposed at localhost:61613

## Start Worker

To start the worker:
Expand All @@ -21,24 +27,26 @@ To start the worker:
blueapi serve
```

The worker can also be started using a custom config file:
The worker can also be started with additional configuration from file:

```
blueapi --config path/to/file serve
# or
blueapi -c path/to/file serve
```

An example of a config file that starts STOMP with default values can be found in:
A config file compatible with the services in the compose-spec above is included alongside it:

```
src/script/stomp_config.yml
.devcontainer/config.yml
```

## Test that the Worker is Running

Blueapi comes with a CLI so that you can query and control the worker from the terminal.
Blueapi comes with a CLI so that you can query and control the worker from the terminal, this should be passed the same config as the worker:

```
blueapi controller plans
blueapi [--config path/to/file] controller plans
```

The above command should display all plans the worker is capable of running.
Expand Down
16 changes: 0 additions & 16 deletions src/script/start_rabbitmq.sh

This file was deleted.

Loading