Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow blueapi to publish to multiple stomp message busses simultanously #791

Open
noemifrisina opened this issue Jan 21, 2025 · 5 comments

Comments

@noemifrisina
Copy link

@callumforrester

Acceptance Criteria

  • Specific criteria that will be used to judge if the issue is fixed
@noemifrisina noemifrisina changed the title Allow blueapi to publich to multiple stomp message busses simultanously Allow blueapi to publish to multiple stomp message busses simultanously Jan 21, 2025
@noemifrisina
Copy link
Author

@CoePaul tagging fyi

@callumforrester
Copy link
Contributor

Per discussion with the rest of the core team, we need to decide if it's better to do this or to have two blueapis. I will schedule a chat.

@CoePaul
Copy link

CoePaul commented Jan 23, 2025 via email

@DiamondJoseph
Copy link
Contributor

Option c) would seem to only serve to educate people who won't work on i19

Education is important. I've got some questions about why 2 message busses would be necessary if blueapi is a single instance. What is being done with the messages coming off of the bus? Is this for passing information back to GDA or processing or...? I'm not sure why we couldn't use appropriate routing keys and wildcards to pass messages to specific/either/both sets of consumers?

@DiamondJoseph
Copy link
Contributor

RE: physical reality of hardware, I'd like to mock up what I think is a solution that gives you two instances of blueapi- I think parallel running plans should be limited in use, scope and explicit to prevent pitfalls of synchronisation: having one hutch that is able to operate on all its devices, using the entire bluesky plans/stubs/Msg vocabulary, and still running a subset of plans in another hutch to me seems a different use case, one already provided by two instances of bluesky and conditional dodal devices:

We're already seeing this behaviour emerging in the i24 attenuator, which is Readonly and extended and made Movable, so I've used it as an example

BL = get_beamline_name("i19-1")


def allow_moves() -> bool:
    ....

@device_factory()
def attenuator() -> ReadOnlyAttenuator:  # blueapi will still see this as a BinaryFilterAttenuator/Movable when it is so
    prefix = f"{PREFIX.beamline_prefix}-ATT:"
    return BinaryFilterAttenuator(prefix) if allow_moves() else ReadOnlyAttenuator(prefix)

And then you have a series of plans:

def testing_plan(attenuator: ReadOnlyAttenuator) -> MsgGenerator:
    ...


def data_collection(attenuator: BinaryFilterAttenuator) -> MsgGenerator:
    ...

blueapi would then only instantiate read-only devices when the beamline is not able to collect data, and would not be able to run plans using those devices if the plans required moving those devices.

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

No branches or pull requests

4 participants