| 1 |
# Spawn on Demand variant of 00-recovery |
| 2 |
# No need for suicide triggers. |
| 3 |
|
| 4 |
[meta] |
| 5 |
title = "automated failure recovery example" |
| 6 |
description = """ |
| 7 |
Model task failure triggers diagnosis and recovery tasks, which |
| 8 |
otherwise take themselves out of the workflow if model succeeds. |
| 9 |
Model post processing triggers off model or recovery tasks. |
| 10 |
""" |
| 11 |
|
| 12 |
[scheduler] |
| 13 |
UTC mode = True |
| 14 |
allow implicit tasks = True |
| 15 |
[[events]] |
| 16 |
expected task failures = 20110101T1200Z/model |
| 17 |
|
| 18 |
[scheduling] |
| 19 |
initial cycle point = 20110101T00 |
| 20 |
final cycle point = 20110101T12 |
| 21 |
[[graph]] |
| 22 |
T00,T12 = """ |
| 23 |
pre:finish => model? # finish trigger |
| 24 |
model:fail? => diagnose => recover # fail trigger |
| 25 |
model:succeed? | recover => post # conditional and explicit success |
| 26 |
""" |
| 27 |
|
| 28 |
[runtime] |
| 29 |
[[root]] |
| 30 |
script = "true" # fast |
| 31 |
[[model]] |
| 32 |
script = """ |
| 33 |
echo Hello from $CYLC_TASK_ID |
| 34 |
if [[ $(cylc cycletime --print-hour) == 12 ]]; then |
| 35 |
echo "FAILING NOW!" |
| 36 |
false |
| 37 |
else |
| 38 |
echo "Succeeded" |
| 39 |
true |
| 40 |
fi |
| 41 |
""" |
| 42 |
[[[meta]]] |
| 43 |
description = A task that succeeds at 0 UTC and fails at 12 UTC |