AareBec task service #2

Merged
perl_d merged 46 commits from feat/mx_tasks_arch into main 2026-11-24 14:41:31 +01:00
Owner

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).
perl_d added 40 commits 2026-11-24 11:10:32 +01:00
WIP: copy everything from aare_bec_proto
CI for mx_bec / test (push) Failing after 41s
d807f8219c
WIP continue integration
CI for mx_bec / test (push) Failing after 42s
ebb4e1f08a
feat: add queue widget
CI for mx_bec / test (push) Failing after 46s
bd445867ac
feat: add task panel widget
CI for mx_bec / test (push) Failing after 40s
797f29e1fc
feat: add raster to task table
CI for mx_bec / test (push) Failing after 46s
f1be7d39ed
feat: hack in state change
CI for mx_bec / test (push) Failing after 49s
d0cfcac249
feat: add sample info holder
CI for mx_bec / test (push) Failing after 48s
71cd3ac6b4
feat: add aaredaq api client
CI for mx_bec / test (push) Failing after 47s
75b51fc314
feat: add tasks for aaredaq scans
CI for mx_bec / test (push) Failing after 49s
02be72d885
wip
CI for mx_bec / test (push) Failing after 48s
876f17edd1
feat: aaredaq grabs baton
CI for mx_bec / test (push) Failing after 48s
6854f2d15f
progress 261104
CI for mx_bec / test (push) Failing after 47s
406a2ee2d8
docs: add todo
CI for mx_bec / test (push) Failing after 51s
f0ea2153f1
feat: add aaredaq optical task
CI for mx_bec / test (push) Failing after 54s
66105af285
feat: add spreadsheet display hax
CI for mx_bec / test (push) Failing after 47s
04c76ac0f0
add html table
CI for mx_bec / test (push) Failing after 47s
c8cab28daf
fix display
CI for mx_bec / test (push) Failing after 58s
57738e98f8
integrate stuff
CI for mx_bec / test (push) Failing after 49s
9c4d7566cf
add smargon math
CI for mx_bec / test (push) Failing after 51s
78fe7ae11a
apply smargon nudge math to gridscan
CI for mx_bec / test (push) Failing after 48s
49b699434e
fix multi grid scan and take args
CI for mx_bec / test (push) Failing after 50s
5475503238
move stuff to maths, factorise
CI for mx_bec / test (push) Failing after 46s
1e2d14c55e
add refresh to spreadsheet
CI for mx_bec / test (push) Failing after 47s
48bf914a00
use gridscan params from config
CI for mx_bec / test (push) Failing after 49s
de57281d82
continue
CI for mx_bec / test (push) Failing after 47s
0ac00bd60d
...
CI for mx_bec / test (push) Failing after 50s
0870ac898a
add clear task queue button
CI for mx_bec / test (push) Failing after 48s
b9709b2fd4
add sample queue
CI for mx_bec / test (push) Failing after 50s
34693dff7c
...
CI for mx_bec / test (push) Failing after 57s
173a710ffb
qol of queue usage
CI for mx_bec / test (push) Failing after 48s
745e73fa90
add many to queue
CI for mx_bec / test (push) Failing after 48s
5a02d9d8fb
task architecture with requesting client
CI for mx_bec / test (push) Failing after 52s
48a5efa56b
fix: clean up stuff
CI for mx_bec / test (push) Failing after 54s
CI for mx_bec / test (pull_request) Failing after 56s
7656b45dcb
perl_d added 1 commit 2026-11-24 11:14:55 +01:00
fix: use coverage rather than pytest-cov
CI for mx_bec / test (push) Failing after 1m15s
CI for mx_bec / test (pull_request) Failing after 1m15s
1640ef9657
perl_d force-pushed feat/mx_tasks_arch from 56cb795b65 to 1640ef9657 2026-11-24 11:14:55 +01:00 Compare
perl_d added 1 commit 2026-11-24 11:40:17 +01:00
fix: tidy math module
CI for mx_bec / test (push) Failing after 1m8s
CI for mx_bec / test (pull_request) Failing after 1m8s
f6271b06e8
perl_d added 1 commit 2026-11-24 12:32:56 +01:00
fix: actually add decisions module
CI for mx_bec / test (push) Failing after 1m6s
CI for mx_bec / test (pull_request) Failing after 1m7s
3b8fe99403
perl_d force-pushed feat/mx_tasks_arch from b812a91d8b to 2c23ce6d87 2026-11-24 13:18:35 +01:00 Compare
perl_d added 2 commits 2026-11-24 14:04:19 +01:00
feat: use mx_bec planner
CI for mx_bec / test (push) Failing after 1m43s
CI for mx_bec / test (pull_request) Failing after 1m44s
7eb7854165
perl_d force-pushed feat/mx_tasks_arch from 2c23ce6d87 to 7eb7854165 2026-11-24 14:04:19 +01:00 Compare
perl_d added 1 commit 2026-11-24 14:33:40 +01:00
feat: run tests against all beamlines
CI for mx_bec / e2e tests with pxi_bec (push) Failing after 1m30s
CI for mx_bec / e2e tests with pxii_bec (pull_request) Failing after 1m29s
CI for mx_bec / e2e tests with pxi_bec (pull_request) Failing after 1m30s
CI for mx_bec / e2e tests with pxiii_bec (push) Failing after 1m33s
CI for mx_bec / e2e tests with pxii_bec (push) Failing after 1m33s
CI for mx_bec / unit tests with pxi_bec (pull_request) Failing after 2m9s
CI for mx_bec / unit tests with pxii_bec (pull_request) Failing after 2m9s
CI for mx_bec / unit tests with pxi_bec (push) Failing after 2m13s
CI for mx_bec / unit tests with pxii_bec (push) Failing after 2m13s
CI for mx_bec / unit tests with pxiii_bec (push) Failing after 2m12s
CI for mx_bec / e2e tests with pxiii_bec (pull_request) Failing after 1m5s
CI for mx_bec / unit tests with pxiii_bec (pull_request) Failing after 1m36s
c237f0b730
perl_d merged commit d18c33f3b6 into main 2026-11-24 14:41:31 +01:00
Sign in to join this conversation.