Skip to content

Commit

Permalink
Move RabbitMQ startup into compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Nov 25, 2024
1 parent 86c5905 commit b778bb9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
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.
File renamed without changes.
26 changes: 17 additions & 9 deletions docs/tutorials/quickstart.md
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
```

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.

0 comments on commit b778bb9

Please sign in to comment.