Skip to content

Group trigger: re-use already-completed outputs of active group start tasks.#6910

Merged
oliver-sanders merged 9 commits intocylc:8.5.xfrom
hjoliver:group-trigger-followup
Aug 26, 2025
Merged

Group trigger: re-use already-completed outputs of active group start tasks.#6910
oliver-sanders merged 9 commits intocylc:8.5.xfrom
hjoliver:group-trigger-followup

Conversation

@hjoliver
Copy link
Copy Markdown
Member

@hjoliver hjoliver commented Aug 11, 2025

Close #6858

Re-spawn in-group children of already-completed group start task outputs - because triggering is event-driven and group trigger removes in-group tasks and their already-completed prerequisites.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@hjoliver hjoliver force-pushed the group-trigger-followup branch from 0f82dea to cbdf66b Compare August 11, 2025 04:17
@hjoliver hjoliver self-assigned this Aug 11, 2025
@hjoliver hjoliver added this to the 8.6.0 milestone Aug 11, 2025
@wxtim

This comment was marked as resolved.

@hjoliver

This comment was marked as resolved.

@hjoliver

This comment was marked as resolved.

@hjoliver hjoliver force-pushed the group-trigger-followup branch from cbdf66b to 271d6df Compare August 12, 2025 05:44
@hjoliver hjoliver requested a review from wxtim August 12, 2025 05:44
@hjoliver hjoliver marked this pull request as ready for review August 12, 2025 05:44
@hjoliver

This comment was marked as resolved.

@wxtim

This comment was marked as resolved.

@hjoliver

This comment was marked as resolved.

@hjoliver hjoliver force-pushed the group-trigger-followup branch from 25b4871 to 05b439f Compare August 14, 2025 00:10
@hjoliver hjoliver changed the base branch from master to 8.5.x August 14, 2025 00:11
@hjoliver hjoliver modified the milestones: 8.6.0, 8.5.2 Aug 14, 2025
@hjoliver hjoliver added the bug Something is wrong :( label Aug 14, 2025
@hjoliver
Copy link
Copy Markdown
Member Author

hjoliver commented Aug 14, 2025

Rebased to 8.5.x and labelled as a bug fix (which it really is).

@oliver-sanders - this was easier than anticipated because rather than respawning on the already-completed outputs we can just set the corresponding prerequisites on in-group downstream tasks (thus naturally avoiding off-group effects).

@wxtim
Copy link
Copy Markdown
Member

wxtim commented Aug 14, 2025

I like what you did with the test.

Comment on lines +38 to +40
How live (preparing, submitted, or running) tasks are handled:
* Live in-group tasks are killed and removed, to rerun in the triggered flow.
* Live group-start tasks are left alone; they don't need to be retriggered.
Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders Aug 14, 2025

Choose a reason for hiding this comment

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

Technical and correct, but I don't think users are going to make much sense of this.

I would recommend explaining group trigger in terms of its behaviours rather than the details of its implementation.

Here's how I explained it in the changes section:

  • Prerequisites on any tasks that are outside of the group of tasks being triggered are automatically satisfied.
  • Any tasks which have already run within the group will be automatically removed (i.e. cylc remove) to allow them to be re-run without intervention.
  • Any preparing, submitted or running tasks within the group will also be removed if necessary to allow the tasks to re-run in order.

This avoids using the terms "gruop-start", "in-group", "flow" and "run history" but is much more likely to be read and understood.

Copy link
Copy Markdown
Member Author

@hjoliver hjoliver Aug 15, 2025

Choose a reason for hiding this comment

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

I'll put a general note on approaches to documentation on Element, but for now:

I don't really agree that terms like "in-group" are technical in this context: i.e., in a section entitled "triggering a group of tasks at once", and where "group" here is perfectly compatible with normal colloquial usage of the word.

And we should be using "flow" to describe (intuitively, not technically) workflow activity flowing through the graph. Without a good name for concepts like this we end up having to repeat verbose descriptions all over the place.

That said, in this case maybe I have overcooked it, and I do quite like your description, so I'm considering a re-do ...

Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders Aug 15, 2025

Choose a reason for hiding this comment

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

One to take off issue.


I don't really agree that terms like "in-group" are technical [...] in a section entitled "triggering a group of tasks at once"

I agree! These aren't especially technical terms so long as they are contextualised in a section as you say.

But if we can explain the behaviours more simply (without using these terms), we should.


And we should be using "flow" to describe (intuitively, not technically) workflow activity flowing through the graph.

I understand why you want to use the term "flow" and convey the flow model in documentation.

However, the "flow" term is only really necessary to explain concurrent flows. I don't think it is helpful outside of this context, we can explain single-flow behaviour more clearly without this term/model (just like we did at Cylc 7).

Concurrent flows are an advanced feature, the terminology and models associated with it should be constrained to the documentation for concurrent flows (we asked for this at proposal time). The default single-flow cases can and should be more simply explained without invoking this model.

Copy link
Copy Markdown
Member Author

@hjoliver hjoliver Aug 15, 2025

Choose a reason for hiding this comment

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

I understand why you want to use the term "flow" and convey the flow model in documentation. ...

That's really not what I'm doing. I certainly agree that our recent intervention improvements have relegated concurrent flows to an advanced feature that won't need to be used much. By "flow" I simply mean when I trigger a task (or set its prerequisites or whatever) activity "flows on from" that intervention through the graph. That's very much an intuitive concept, and IMO it's the most natural way to explain what Cylc does. Even with the new group trigger feature, which erases run history so that a "concurrent flow" is not needed, the activity that results from the trigger still "flows" through the graph in this way and as such is most simply described as triggering a flow.

Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders Aug 15, 2025

Choose a reason for hiding this comment

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

By "flow" I simply mean when I trigger a task (or set its prerequisites or whatever) activity "flows on from" that intervention through the graph

I understand this, and I do get where you are coming from. Of course "flow on" is reasonable, but there shouldn't be any need to talk about "flows" outside of concurrent flows IMO.

Outside of concurrent flows, I don't think the "flow" model / terminology is particularly helpful and can make docs confusing for users. We can explain Cylc things clearly without introducing this term (e.g. we don't use it once in the tutorial).

Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Code makes sense, tested as working, 👍.

@hjoliver
Copy link
Copy Markdown
Member Author

@wxtim - if you approve today, don't merge - I will try to dumb down the CLI help a bit first 😁

@hjoliver hjoliver force-pushed the group-trigger-followup branch from 4c16093 to 683a8f1 Compare August 25, 2025 04:55
@hjoliver hjoliver force-pushed the group-trigger-followup branch from 683a8f1 to c22dbc7 Compare August 25, 2025 04:56
@hjoliver
Copy link
Copy Markdown
Member Author

hjoliver commented Aug 25, 2025

OK I did CLI help rewrite from scratch, but based on your description @oliver-sanders - and IMO managed to pare it down to the essentials and improve clarity.

Annotated to explain my thinking:

Trigger a group of one or more tasks, respecting dependencies among them.

Prerequisites on tasks outside of the group will be satisfied automatically.

Refers to "outside of the group", but "group" is now defined in the first line (and it applies to both to single and multiple tasks).

Tasks will be removed if necessary to allow re-run without intervention, so
triggered tasks that are preparing, submitted, or running may be killed.

Note that "removed if necessary to allow rerun" covers all bases; but I explicitly that some may be killed (because killing tasks is important):

  • live group-start tasks will not be removed - not necessary to allow rerun
  • live in-group tasks will be removed, which kills them - necessary to allow rerun
  • finished tasks will be removed - necessary to allow rerun

(In the interests of describing things simply to users, we probably don't need to give those details explicitly)

Tasks that lead into a group will run immediately even if the workflow is
paused; activity will flow on from them once the workflow is resumed.

(This also covers the previous separate mention of triggering single tasks when paused, because group is defined as "one or more" tasks in the top line).

Triggering an unqueued task queues it; triggering a queued task runs it.

This is a standalone point, so I moved it down the page, out of the way of the above bits which are all more or less inter-related.

@hjoliver
Copy link
Copy Markdown
Member Author

(N.B. two approvals already, but we need to agree on the trigger CLI help text).

Comment on lines +20 to +33
Trigger a group of one or more tasks, respecting dependencies among them.

Prerequisites on tasks outside of the group will be satisfied automatically.

Tasks will be removed if necessary to allow re-run without intervention, so
triggered tasks that are preparing, submitted, or running may be killed.

Tasks that lead into a group will run immediately even if the workflow is
paused; activity will flow on from them once the workflow is resumed.

Triggering an unqueued task queues it; triggering a queued task runs it.

How flow numbers are assigned to triggered tasks:
Active tasks (n=0) already have assigned flows; inactive tasks (n>0) do not.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Much simpler!

@oliver-sanders oliver-sanders merged commit 33c5035 into cylc:8.5.x Aug 26, 2025
28 checks passed
@hjoliver hjoliver deleted the group-trigger-followup branch August 26, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is wrong :(

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group trigger follow-up for "live" start tasks with completed outputs

3 participants