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

play: support multiple workflows #6303

Open
ColemanTom opened this issue Aug 15, 2024 · 5 comments
Open

play: support multiple workflows #6303

ColemanTom opened this issue Aug 15, 2024 · 5 comments

Comments

@ColemanTom
Copy link
Contributor

Problem

I can pause multiple workflows by doing cylc pause *pattern*. But, when I want to resume them, I have to do for w in *pattern*; do cylc play $w; done (or similar).

Proposed Solution

Should cylc play work on multiple workflows?

@oliver-sanders
Copy link
Member

At present cylc play does not support multiple workflows.

It's a slightly tricky thing to implement due to some of the options cylc play supports. The biggest issue is with --no-detach, when this option is used, runs in the terminal session rather than detaching into a new fork. As a result, if we supported multiple workflows, --no-detach would cause them to run in serial rather than parallel.

@hjoliver
Copy link
Member

hjoliver commented Aug 15, 2024

It's a valid point though. Intuitively, if you pause a bunch of workflows with a single command you should be able to un-pause them with a single command too.

--no-detach has no effect on un-pausing a running workflow.

For start-up, I suppose we could prompt for confirmation if --no-detach is used with multiple workflow IDs. Or make it an error (although we might actually be able to dream up valid use cases for running multiple small workflows serially).

It's a slightly tricky thing to implement due to some of the options cylc play supports.

Aside from --no-detach I presume you're concerned about the fact that options like --stop-cycle-point are unlikely to be valid for multiple workflows? Or is it more than that?

If that's the only issue, I think it's reasonable to assume that all options apply to all workflows on the command line, otherwise don't "play" them en masse.

@ColemanTom
Copy link
Contributor Author

Intuitively, if you pause a bunch of workflows with a single command you should be able to un-pause them with a single command too.

Yes, this is what I was expecting, as you say, intuitively. It's not a major problem or anything like that of course, low priority to consider for me, etc

@oliver-sanders
Copy link
Member

For start-up, I suppose we could prompt for confirmation if --no-detach is used with multiple workflow IDs. Or make it an error

I think it would be easier to raise an error. I don't think we should encourage using the cylc play command as a pipeline manager!

Aside from --no-detach I presume you're concerned about the fact that options like --stop-cycle-point are unlikely to be valid for multiple workflows? Or is it more than that?

Would need to go through the option properly, --upgrade is another option that will require some thinking.

There shouldn't be any fatal blockers, just needs work, it isn't a one-liner.

@oliver-sanders oliver-sanders changed the title Cylc play on multiple workflows? play: support multiple workflows Aug 20, 2024
@oliver-sanders
Copy link
Member

Another technical barrier to cross (related to #6297).

If restarting (as opposed to resuming) a workflow, the restart code must be called synchronously with no asyncio event loops running. This is a bit awkward as the code will be async up to this point (e.g. because workflow scanning is async) and effectively means that the schedulers could only be started in series (though that isn't necessarily a bad way to get this functionality started).

The easy way out is probably just to call the restart part in a new process where it is detached from the async logic of the parent process.

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

3 participants