QueueServer#
The Bluesky QueueServer (QS) lets operators queue and execute scan plans remotely without an interactive Python session. Each beamline has its own QS host process and configuration.
QS Configuration Files#
Beamline |
Config file |
Launch script |
|---|---|---|
4IDB |
|
|
4IDG |
|
|
4IDH |
|
|
Raman |
|
|
Shared |
|
— |
Starting / Stopping the QS Host#
Use the qs_host.sh script for your beamline. The restart command is the
normal way to (re)start — it stops any running instance first, then starts
fresh in a screen session in the background.
# 4IDB example:
./src/id4_b_qserver/qs_host.sh restart
./src/id4_b_qserver/qs_host.sh status
./src/id4_b_qserver/qs_host.sh stop
All available commands:
Usage: qs_host.sh {start|stop|restart|status|checkup|console|run} [NAME]
COMMANDS
console attach to process console if process is running in screen
checkup check that process is running, restart if not
restart restart process
run run process in console (not screen)
start start process
status report if process is running
stop stop process
Install screen (if not present)#
sudo apt install screen
GUI Client#
Launch the queue-monitor GUI from any terminal with the Conda environment activated:
queue-monitor &
Running Directly (without screen)#
cd ./src/id4_b_qserver
start-re-manager --config=./qs-config.yml
QS Context Detection#
startup.py detects when it is running inside the QueueServer and adjusts
behavior automatically (no interactive prompts, no shutter suspenders, no
%matplotlib magic):
from apsbits.utils.helper_functions import running_in_queueserver
if running_in_queueserver():
# import everything for remote plan submission
import bluesky.plans as bp
import bluesky.plan_stubs as bps
else:
# interactive session setup
...
Redis Backend#
The QS uses Redis (localhost:6379) for inter-process communication. Redis must be running before starting the QS host:
redis-server &
Or via systemd on beamline servers:
systemctl status redis
qs-config.yml Key Settings#
# IPython kernel backend
worker_class: bluesky_queueserver.manager.worker.IPythonWorker
# Startup scripts loaded by the worker
startup_script: path/to/startup.py
# Redis connection
redis_addr: localhost:6379
# Plan allow-list (empty = allow all)
allowed_plans_and_devices: []
See the Bluesky QueueServer documentation
for the full qs-config.yml reference.