Debian Codegraph @

tests/f/platforms/13-ping-pong-host/flow.cylc

raw
1 #!jinja2
2 [scheduler]
3 [[events]]
4 stall timeout = PT0S
5
6 [scheduling]
7 cycling mode = integer
8 final cycle point = 2
9 [[graph]]
10 P1 = remote_task[-P1] => toggler => remote_task
11
12 [runtime]
13 [[remote_task]]
14 [[[remote]]]
15 host = $(cat ${CYLC_WORKFLOW_RUN_DIR}/pretend-hall-info)
16
17 [[toggler]]
18 script = """
19 # Toggle the platform between localhost and the remote host
20 # using the content of a file, ${CYLC_WORKFLOW_RUN_DIR}/pretend-hall-info.
21 # between localhost and the remote.
22
23 if (( $CYLC_TASK_CYCLE_POINT % 2 == 1 )); then
24 echo ${REMOTE_HOST} > ${CYLC_WORKFLOW_RUN_DIR}/pretend-hall-info
25 cylc message -- "changing platform to ${REMOTE_HOST}"
26 else
27 echo "localhost" > ${CYLC_WORKFLOW_RUN_DIR}/pretend-hall-info
28 cylc message -- "changing platform to localhost"
29 fi
30 """
31 [[[environment]]]
32 REMOTE_HOST = {{ CYLC_TEST_HOST }}