Skip to content

Feat/add procedure api#647

Merged
d-perl merged 10 commits intomainfrom
feat/add_procedure_API
Dec 4, 2025
Merged

Feat/add procedure api#647
d-perl merged 10 commits intomainfrom
feat/add_procedure_API

Conversation

@d-perl
Copy link
Contributor

@d-perl d-perl commented Nov 12, 2025

Adds functionality to the procedure manager and associated tooling:

  • a helper class for Redis interactions, separated for frontend and backend use
  • get statuses of running procedures
  • abort procedures, reschedule aborted procedures, delete aborted procedures
  • new messages for the above
  • a builtin procedure for running user scripts
  • tests

Helpful for testing:

  • run the _dev_runner.py

  • Make sure you have a pod created with podman pod create --add-host redis:host-gateway local_bec

  • In a bec console:

from bec_server.scan_server.procedures.helper import BackendProcedureHelper
from bec_lib import messages
helper = BackendProcedureHelper(bec.connector)
msg = messages.ProcedureRequestMessage( identifier="sleep", queue="queue1", args_kwargs=((), {"time_s":5}) )
helper.request_procedure(msg)

bec-project/bec_widgets#902 can be used to monitor queues, abort and reschedule procedures, as well as run scripts as procedures

@d-perl d-perl force-pushed the feat/add_procedure_API branch from d93fb70 to e7f1f77 Compare November 12, 2025 12:31
@d-perl d-perl force-pushed the feat/add_procedure_API branch 2 times, most recently from 50975d5 to ea5bb22 Compare November 12, 2025 13:16
@d-perl d-perl requested review from cappel89 and wakonig and removed request for cappel89 November 12, 2025 13:56
@d-perl d-perl force-pushed the feat/add_procedure_API branch 3 times, most recently from 1e83293 to 025765e Compare November 18, 2025 12:23
@d-perl d-perl requested a review from wakonig November 18, 2025 12:47
@d-perl
Copy link
Contributor Author

d-perl commented Nov 18, 2025

@wakonig I just undid the logging commit, we should maybe discuss it in more detail sometime outside of this PR

@d-perl d-perl force-pushed the feat/add_procedure_API branch from 025765e to 5aba36e Compare November 19, 2025 14:03
@wakonig
Copy link
Member

wakonig commented Nov 25, 2025

@d-perl sorry for the delay. I just tried to run it but it first got stuck and never picked it up. After a restart of the _dev_runner everything was fine.

We should have a quick discussion about the logs tomorrow though. I used the companion branch in BW but I wasn't able actually see the scan table from the procedure.

@d-perl d-perl force-pushed the feat/add_procedure_API branch 3 times, most recently from 19f8cf9 to f3f6e6f Compare November 26, 2025 13:52
Copy link
Member

@wakonig wakonig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works great! 🚀

@wakonig
Copy link
Member

wakonig commented Nov 30, 2025

just out of curiosity... could you rebase your branch on main and see if the coverage report is fixed? Also fine if you don't want to do this on this branch ;)

@d-perl d-perl force-pushed the feat/add_procedure_API branch from f3f6e6f to cae0c5d Compare December 4, 2025 07:51
@d-perl d-perl enabled auto-merge (rebase) December 4, 2025 08:54
@d-perl d-perl merged commit 56c65d6 into main Dec 4, 2025
53 of 77 checks passed
@d-perl d-perl deleted the feat/add_procedure_API branch December 4, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants