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

Workflow creation #245

Open
SimonHeybrock opened this issue Oct 10, 2024 · 1 comment
Open

Workflow creation #245

SimonHeybrock opened this issue Oct 10, 2024 · 1 comment

Comments

@SimonHeybrock
Copy link
Member

We recently converged on a new (stateful) protocol for live workflows:

@runtime_checkable
class LiveWorkflow(Protocol):
def __init__(self, nexus_filename: Path) -> None:
"""Initialize the workflow with all static information.
The only argument we need is the path to the nexus file or
a file object that workflow can read from,
since the file carrys all the static information.
"""
...

This works, but while working on scipp/esssans#179 it became clear that something is missing: We will have to configure the underlying (non-streaming) workflow with parameters, typically given by a user, before fully creating and running the live workflow. In the linked PR this is circumvented by hard-coding for a specific run, but this is only possible because we a testing with and event stream generated from a fixed file.

I think we will want to make the base workflow (a sciline.Pipeline) somehow injectable into the live workflow, e.g., as in make_sample_run_workflow from scipp/esssans#179. As the users will need to provide parameters we should design this in a way that allows for using our existing workflow widgets module for this. The building blocks we need are:

  1. The live workflow.
  2. The base workflow.
  3. Parameters for the live workflow.
  4. Parameters for the base workflow.

There is no 1:1 mapping between these. For example, we may have:

  • Live workflow chosen from (transmission-run, sample-run).
  • Base workflow chosen from (loki, skadi)

I don't know yet if this will be freely composable or if we need to define a per-workflow list (for example, a live workflow could expose a property that defines all supported base workflows).

It is probably easiest to sit down together and just play with a few options, to see what works, then update the live workflow protocol accordingly.

@SimonHeybrock
Copy link
Member Author

SimonHeybrock commented Nov 5, 2024

I think scipp/sciline#92 could be valuable for this: We could use widgets to setup a pipeline, save the pipeline with params, the run Beamlime which can restore the pipeline. This would decouple the running of Beamlime from the widgets (which currently run only in a Jupyter Notebook).

The other option would be to make a more final decision on the front-end (visualization), so pipeline config can be implemented there. I feel this design would be troublesome though, since it would lock us more into a given front-end, making switching it out later harder. I think we should therefore try to find a solution in which configuration of workflows can be split from running the dashboard. Maybe a pragmatic approach could be to simply write such "config" in a Python file for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant