diff --git a/docs/how-to/just-run-blueapi-and-services-locally.md b/docs/how-to/just-run-blueapi-and-services-locally.md index 5a8303b42..3e434d35d 100644 --- a/docs/how-to/just-run-blueapi-and-services-locally.md +++ b/docs/how-to/just-run-blueapi-and-services-locally.md @@ -25,6 +25,11 @@ Before starting, ensure you have followed the [Installation instructions](../tut - `just repl`: will give you a repl with pre-configured and logged in client - `just compose down`: tear down adjacent services +6. On the Diamond network you can also run the NeXus file converter, which writes NeXus files from the documents blueapi publishes to RabbitMQ: + - `just compose-diamond`: launch the services above plus the converter + - Written files appear in `/tmp/blueapi-nexus` on the host (override with `NEXUS_OUTPUT_DIR`) + - `just compose --profile diamond down`: tear down everything, including the converter + Channel Access To log in through the BlueAPI CLI: diff --git a/justfile b/justfile index 23c5aacd6..fdf5ebd83 100644 --- a/justfile +++ b/justfile @@ -24,6 +24,9 @@ init-example-services: compose +ARGS="up -d --no-recreate": init-example-services _check-runner {{ RUNNER }} compose -f tests/system_tests/compose.yaml {{ ARGS }} +[doc('Bring up the example services plus the NeXus file converter (Diamond registry only)')] +compose-diamond: (compose "--profile diamond up -d --no-recreate") + [doc('Run the blueapi server with the system test config')] serve *OPTS: #!/usr/bin/env bash diff --git a/tests/system_tests/compose.yaml b/tests/system_tests/compose.yaml index 25570146b..573bbde0d 100644 --- a/tests/system_tests/compose.yaml +++ b/tests/system_tests/compose.yaml @@ -154,3 +154,24 @@ services: condition: service_healthy security_opt: - label=disable + + # Internal Diamond registry so not pulled in CI, enable with `--profile diamond` + nexus: + profiles: [diamond] + image: gitlab.diamond.ac.uk:5050/daq/d2acq/services/nexus-file-converter:4.1.6 + network_mode: host # Port 8084 + environment: + - BEAMLINE=adsim + # Consume the start/descriptor/event/stop documents blueapi publishes + # on /topic/public.worker.event (amq.topic exchange) + - SPRING_PROFILES_ACTIVE=rabbitmq + - SPRING_RABBITMQ_HOST=localhost + volumes: + # numtracker's data_session_directory is /tmp/, expose written files on the host + - ${NEXUS_OUTPUT_DIR:-/tmp/blueapi-nexus}:/tmp + depends_on: + - rabbitmq + # rabbitmq has no healthcheck, retry until the broker accepts connections + restart: on-failure + security_opt: + - label=disable