-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Inter-cycling triggering | ||
|
||
A demo of using `cylc workflow-state` in other workflows. | ||
|
||
This workflow doesn't do much because it's there for the others | ||
to trigger off from: | ||
|
||
# xtrigger | ||
|
||
The most up-to-date way of doing inter-workflow triggering | ||
using the provided workflow_state xtrigger. | ||
|
||
--- | ||
|
||
# old notation | ||
|
||
classic offset notation. | ||
|
||
Included in example for reference only - in general | ||
you should prefer xtriggers. | ||
|
||
--- | ||
|
||
# CLI script | ||
|
||
Use the CLI ``cylc workflow-state`` command to poll | ||
for the state of the "first" workflow. | ||
|
||
--- | ||
|
||
Written for Cylc Version: 8 | ||
Tested with Cylc Version: 8.3.0.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
[meta] | ||
title = the first workflow of which others are triggered | ||
title = Inter-cycling triggering | ||
description = """ | ||
A demo of using `cylc workflow-state` in other workflows. | ||
This workflow doesn't do much because it's there for the others | ||
to trigger off from. | ||
to trigger off from: | ||
""" | ||
written for cylc = 8 | ||
tested with cylc = 8.3.0.dev@f41602137 | ||
written for cylc version = 8 | ||
tested with cylc version = 8.3.0.dev | ||
|
||
[scheduler] | ||
allow implicit tasks = true | ||
# cycle point format = %Y | ||
cycle point format = %Y | ||
|
||
[scheduling] | ||
initial cycle point = 1060 | ||
final cycle point = 1070 | ||
[[graph]] | ||
P1Y = anglo_saxon_chronicle | ||
P1Y = anglo_saxon_chronicle[-P1Y] => anglo_saxon_chronicle | ||
|
||
[runtime] | ||
[[anglo_saxon_chronicle]] | ||
script = cylc message -- hardrada | ||
script = """ | ||
sleep 5 | ||
cylc message -- "Six foot of English ground" | ||
""" | ||
[[[outputs]]] | ||
hardrada = 'Six foot of English ground' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[meta] | ||
title = "CLI script" | ||
description = """ | ||
Use the CLI ``cylc workflow-state`` command to poll | ||
for the state of the "first" workflow. | ||
""" | ||
|
||
[scheduler] | ||
allow implicit tasks = true | ||
cycle point format = %Y | ||
|
||
[scheduling] | ||
initial cycle point = 1066 | ||
[[graph]] | ||
R1 = """ | ||
is_in_normandie:succeeded? => swear_an_oath | ||
is_insult:succeeded? => send_insult | ||
""" | ||
|
||
[runtime] | ||
[[HAND_ROLLED_WORKFLOW_STATE_TRIGGER]] | ||
script = """ | ||
cylc workflow-state \ | ||
first//1065/anglo_saxon_chronicle:${OUTPUT} \ | ||
--max-polls=50 | ||
""" | ||
|
||
[[is_in_normandie]] | ||
inherit = HAND_ROLLED_WORKFLOW_STATE_TRIGGER | ||
[[[environment]]] | ||
OUTPUT="succeeded" | ||
|
||
[[is_insult]] | ||
inherit = HAND_ROLLED_WORKFLOW_STATE_TRIGGER | ||
[[[environment]]] | ||
OUTPUT="hardrada" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
[meta] | ||
title = the first workflow of which others are triggered | ||
title = xtrigger | ||
description = """ | ||
A demo of using `cylc workflow-state` in other workflows. | ||
This workflow triggers a series of events, if and only | ||
if, the year is 1068. | ||
It uses xtriggers to achieve this. | ||
The most up-to-date way of doing inter-workflow triggering | ||
using the provided workflow_state xtrigger. | ||
""" | ||
written for cylc = 8 | ||
tested with cylc = 8.3.0.dev@f41602137 | ||
|
||
[scheduler] | ||
allow implicit tasks = true | ||
# cycle point format = %Y | ||
cycle point format = %Y | ||
|
||
[scheduling] | ||
# initial cycle point = 1066 | ||
[[graph]] | ||
R1 = @is_1068 => domesday & tapestry # It's an embroidery | ||
[[xtriggers]] | ||
# is_1068 = workflow_state(workflow_task_id=first//1068/anglo_saxon_chronicle:succeeded, offset=None, alt_cylc_run_dir=None) | ||
is_1068 = workflow_state('first', task='anglo_saxon_chronicle', point='1068', status='succeeded') |