MX task architecture: AareBec service, tasks, queues and widgets
Brings the AareBec task architecture into mx_bec
Components
AareBec service (service.py, main.py): custom BEC client that owns the task queue,
the actor manager and the external API clients.
Task framework (tasks/core.py): @task decorator and TaskManager with Server and Client roles. The server runs tasks one at a time and pauses the queue on failure; clients
request tasks over Redis. MxTaskQueue works off the execution list.
MX tasks (tasks/mx_tasks.py): sample mount, optical centering, raster and multi-raster
scans, X-ray centering, rotation data collection, beamline state change and cleanup.
Automation actors (actors/, actor_manager.py): actors that react to sequence
milestones and queue the next task, each switchable through a Redis config value.
External clients: AareDaq REST client (Kerberos token, baton handling), JFJoch
raster client, OpticalPrediction (AareLC). The AareDaq client is to be replaced with native BEC
implementations.
Devices (devices/): Aerotech, Smargon (smargopolo), HTTP device base, simulated stages
and sample changer, plus a demo config.
Widgets (bec_widgets/widgets/aare_bec/): actor config, task queue, task panel, sample
queue and sample spreadsheet display - for development and admin use.
Endpoints and messages for task requests, the execution list, queue-change
notifications and sequence state.
Self-driving and maths helpers (self_driving.py, math.py): records and plans for
self-driving collection, Smargon lab-frame nudge maths.
Notes
BEC-driven optical centering was removed; it will be reimplemented from scratch.
The sample spreadsheet is copied between Redis instances by a hack in the service, to be
replaced by the sample database connection module.
CI installs from the MX Gitea package index (jfjoch_client is pre-release only).
# MX task architecture: AareBec service, tasks, queues and widgets
Brings the AareBec task architecture into `mx_bec`
## Components
- **AareBec service** (`service.py`, `main.py`): custom BEC client that owns the task queue,
the actor manager and the external API clients.
- **Task framework** (`tasks/core.py`): `@task` decorator and `TaskManager` with `Server` and
`Client` roles. The server runs tasks one at a time and pauses the queue on failure; clients
request tasks over Redis. `MxTaskQueue` works off the execution list.
- **MX tasks** (`tasks/mx_tasks.py`): sample mount, optical centering, raster and multi-raster
scans, X-ray centering, rotation data collection, beamline state change and cleanup.
- **Automation actors** (`actors/`, `actor_manager.py`): actors that react to sequence
milestones and queue the next task, each switchable through a Redis config value.
- **External clients**: `AareDaq` REST client (Kerberos token, baton handling), `JFJoch`
raster client, `OpticalPrediction` (AareLC). The `AareDaq` client is to be replaced with native BEC
implementations.
- **Devices** (`devices/`): Aerotech, Smargon (smargopolo), HTTP device base, simulated stages
and sample changer, plus a demo config.
- **Widgets** (`bec_widgets/widgets/aare_bec/`): actor config, task queue, task panel, sample
queue and sample spreadsheet display - for development and admin use.
- **Endpoints and messages** for task requests, the execution list, queue-change
notifications and sequence state.
- **Self-driving and maths helpers** (`self_driving.py`, `math.py`): records and plans for
self-driving collection, Smargon lab-frame nudge maths.
## Notes
- BEC-driven optical centering was removed; it will be reimplemented from scratch.
- The sample spreadsheet is copied between Redis instances by a hack in the service, to be
replaced by the sample database connection module.
- CI installs from the MX Gitea package index (`jfjoch_client` is pre-release only).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
MX task architecture: AareBec service, tasks, queues and widgets
Brings the AareBec task architecture into
mx_becComponents
service.py,main.py): custom BEC client that owns the task queue,the actor manager and the external API clients.
tasks/core.py):@taskdecorator andTaskManagerwithServerandClientroles. The server runs tasks one at a time and pauses the queue on failure; clientsrequest tasks over Redis.
MxTaskQueueworks off the execution list.tasks/mx_tasks.py): sample mount, optical centering, raster and multi-rasterscans, X-ray centering, rotation data collection, beamline state change and cleanup.
actors/,actor_manager.py): actors that react to sequencemilestones and queue the next task, each switchable through a Redis config value.
AareDaqREST client (Kerberos token, baton handling),JFJochraster client,
OpticalPrediction(AareLC). TheAareDaqclient is to be replaced with native BECimplementations.
devices/): Aerotech, Smargon (smargopolo), HTTP device base, simulated stagesand sample changer, plus a demo config.
bec_widgets/widgets/aare_bec/): actor config, task queue, task panel, samplequeue and sample spreadsheet display - for development and admin use.
notifications and sequence state.
self_driving.py,math.py): records and plans forself-driving collection, Smargon lab-frame nudge maths.
Notes
replaced by the sample database connection module.
jfjoch_clientis pre-release only).56cb795b65to1640ef9657b812a91d8bto2c23ce6d872c23ce6d87to7eb7854165