forked from cylc/cylc-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow.cylc
More file actions
68 lines (60 loc) · 2.07 KB
/
flow.cylc
File metadata and controls
68 lines (60 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!Jinja2
[scheduler]
UTC mode = True
[[events]]
expected task failures = 1/local-fail-1, 1/local-fail-2, 1/remote-fail-1
[scheduling]
[[graph]]
R1 = """
POLLABLE:start-all => poller
POLLABLE:succeed-any # (make member success optional)
"""
[runtime]
# turn off error trapping to disable "cylc message" calls
# (this prevents the "succeeded" / "failed" messages getting through)
[[POLLABLE]]
init-script = cylc__job__disable_fail_signals ERR EXIT
# these tasks will fail (but not send the failed message or write it to the
# job.status file)
[[FAIL]]
inherit = POLLABLE
script = """
cylc__job__wait_cylc_message_started
echo 'I am failing...' >&2
exit 1
"""
[[local-fail-1, local-fail-2]]
inherit = FAIL
[[remote-fail-1]]
inherit = FAIL
platform = {{ environ['CYLC_TEST_PLATFORM'] }}
# these tasks will succeed (but not send the succeeded message or write it
# to the job.status file)
[[SUCCESS]]
inherit = POLLABLE
script = """
cylc__job__wait_cylc_message_started
echo 'I am OK.'
{
echo 'CYLC_JOB_EXIT=SUCCEEDED'
echo "CYLC_JOB_EXIT_TIME=$(date +%FT%H:%M:%SZ)"
} >>"${CYLC_TASK_LOG_ROOT}.status"
exit 1
"""
[[local-success-1]]
inherit = SUCCESS
[[remote-success-1, remote-success-2]]
inherit = SUCCESS
platform = {{ environ['CYLC_TEST_PLATFORM'] }}
# this task will poll the active jobs and hopefully detect their
# success / failure
[[poller]]
script = """
# give a bit of grace time for the job to leave the job runner queue
sleep 5
# poll the job (it should change to a final state)
cylc poll "${CYLC_WORKFLOW_ID}//*/POLLABLE"
# shut down the scheduler (there should not be any active tasks
# left to delay shutdown)
cylc stop "${CYLC_WORKFLOW_ID}"
"""