| 1 |
[meta] |
| 2 |
title = "Test workflow for task state change on poll result." |
| 3 |
description = """ |
| 4 |
Task run_kill fails silently - it will be stuck in 'running' |
| 5 |
unless polled. Task run_kill goes to Task submit_hold. Task poll_check_kill |
| 6 |
then polls all to find if any tasks have failed, allowing run_kill to suicide |
| 7 |
via a :fail trigger. Task submit_hold is an idle task which is killed after |
| 8 |
Task poll_check_kill succeeds by Task poll_now. Task poll_now then polls all |
| 9 |
to find if any tasks, allowing submit_hold to suicide via a :submit-fail |
| 10 |
trigger, and the workflow to shut down successfully. |
| 11 |
""" |
| 12 |
|
| 13 |
[scheduler] |
| 14 |
UTC mode = True |
| 15 |
[[events]] |
| 16 |
abort on inactivity timeout = True |
| 17 |
inactivity timeout = PT2M |
| 18 |
expected task failures = 20141207T0000Z/run_kill, \ |
| 19 |
20141208T0000Z/run_kill, \ |
| 20 |
20141207T0000Z/submit_hold, \ |
| 21 |
20141208T0000Z/submit_hold |
| 22 |
|
| 23 |
[scheduling] |
| 24 |
initial cycle point = 20141207T0000Z |
| 25 |
final cycle point = 20141208T0000Z |
| 26 |
[[graph]] |
| 27 |
T00 = """ |
| 28 |
run_kill[-P1D]:fail? => run_kill? |
| 29 |
run_kill:start => submit_hold? |
| 30 |
run_kill:fail? => !run_kill |
| 31 |
submit_hold:submit? => poll_check_kill => poll_now |
| 32 |
submit_hold:submit-fail? => !submit_hold |
| 33 |
""" |
| 34 |
|
| 35 |
[runtime] |
| 36 |
[[run_kill]] |
| 37 |
init-script = cylc__job__disable_fail_signals ERR EXIT |
| 38 |
script = exit 1 |
| 39 |
[[poll_check_kill]] |
| 40 |
script = """ |
| 41 |
cylc poll "${CYLC_WORKFLOW_ID}//*" |
| 42 |
|
| 43 |
cylc__job__poll_grep_workflow_log \ |
| 44 |
"${CYLC_TASK_CYCLE_POINT}/submit_hold/01:preparing.* => submitted" |
| 45 |
|
| 46 |
st_file="${CYLC_WORKFLOW_RUN_DIR}/log/job/${CYLC_TASK_CYCLE_POINT}/submit_hold/NN/job.status" |
| 47 |
pkill -g "$(awk -F= '$1 == "CYLC_JOB_ID" {print $2}' "${st_file}")" |
| 48 |
""" |
| 49 |
[[poll_now]] |
| 50 |
script = cylc poll "${CYLC_WORKFLOW_ID}//*" |
| 51 |
|
| 52 |
[[submit_hold]] |
| 53 |
init-script = sleep 120 |