-
Notifications
You must be signed in to change notification settings - Fork 94
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
add example workflows #5773
add example workflows #5773
Conversation
* Document the major design patters for implementing Cylc workflows. * Along with cylc/cylc-flow#5773, this closes cylc#627 * Add some functional examples for users to play with. * The aim is to help assist workflow writers by providing them with minimal templates to flush out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, a few minor changes suggested. Lemme think about a sub-workflow example.
This took me longer than it should have, but here's a minimal subworkflow example, with documentation sufficient to understand exactly how it works: https://github.com/hjoliver/cylc-subwf-example-min Even though it is (necessarily) more complicated than the other examples, I think it probably should be added. Use of subworkflows does come up occasionally. I'll format for this PR if you agree. |
Aah, that sub-workflow example relies on no-detach mode which has caveats and conflicts with auto-restart functionality. I thought we had an example kicking around that used detaching with workflow_state polling on selected end tasks? Might leave this out for the mo as it'll take a while to write up, we should document it though. |
Unlikely to get the time to flush these out further right now so suggest going forward with this. |
6dc9443
to
8e4c41a
Compare
Yes, because that's meant to be a minimal example of sub-workflows, to illustrate the concept without the additional complexities of handling detaching sub-workflows. It does however say this:
Yes, I have a more complex example that can do it either way, but as-is probably too much for this purpose: https://github.com/hjoliver/cylc-subwf-example IMO no-detach is preferable for a minimal example that shows exactly what a sub-workflow is. But I don't mind if we do that as a follow-up. |
8e4c41a
to
319f618
Compare
Ok, best to come back to the sub-workflow example another day. FYI, my reasons for preferring the detaching solution:
|
cylc/flow/etc/examples/inter-workflow-triggers/upstream/flow.cylc
Outdated
Show resolved
Hide resolved
cylc/flow/etc/examples/inter-workflow-triggers/downstream/flow.cylc
Outdated
Show resolved
Hide resolved
319f618
to
4fb05d1
Compare
cylc/flow/etc/examples/inter-workflow-triggers/downstream/flow.cylc
Outdated
Show resolved
Hide resolved
[subworkflow example]
Non-detaching provides a simpler first example, to help users understand the workflow-level concepts. Auto-migration and early subworkflow exit really doesn't matter for that use case. For the detaching case, we'll probably have to provide the polling wrapper. Most users would struggle to understand how to do that.
FYI, my detaching examples don't require you to specify a final task: if the task pool table is empty when the scheduler shuts down, the workflow is complete. (Triggering off mid-flow tasks is another matter, but again not really appropriate for a minimal example). [UPDATE]: I guess the intention here is a template that users can adapt for use, not just a minimal example, so on that basis I'll do a follow-up PR with a minimal detaching example, polling wrapper included. |
* Partially addresses cylc/cylc-doc#627 * Add some examples of Cylc workflow implementation patterns. --- Co-authored-by: Hilary James Oliver <[email protected]>
b69bcbb
to
bf4c77c
Compare
Co-authored-by: Ronnie Dutta <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Don't know if it needs a second look by Hilary before merging
This is the diff since Hillary's last review: 457ace5 Should be uncontroversial. |
This is essentially a cut-down version of what we had at Cylc 7 - https://github.com/cylc/cylc-flow/tree/7.8.x/etc/examples
These examples will get auto-documented in the user-guide in cylc-doc.
One obvious omission, sub-workflows, @hjoliver, got a good flow.cylc to contribute?
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.