Skip to content

Commit 4774245

Browse files
authored
Merge pull request #755 from wxtim/content.skip_mode
Skip Mode
2 parents a2f51ed + ea416dd commit 4774245

File tree

14 files changed

+308
-110
lines changed

14 files changed

+308
-110
lines changed

src/7-to-8/major-changes/cylc-install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ See :ref:`the user guide <RemoteInit>` for more details.
125125

126126
cylc config -i '[install][symlink dirs][<platform-name>]'
127127

128-
The recommended workaround is to use a "dummy" task that runs on the
128+
The recommended workaround is to use a :term:`dummy task` that runs on the
129129
particular platform before any such mirror tasks in order to setup symlink
130130
directories, but without running anything.
131131

src/7-to-8/summary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To upgrade your Cylc 7 suite to a Cylc 8 workflow:
5050
sure that you deal with any warnings produced by these scripts.
5151

5252
.. TODO Add ref to breaking changes section within Major changes, once created,
53-
including optional ouputs.
53+
including optional outputs.
5454
5555
.. note::
5656

src/glossary.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,3 +1766,11 @@ Glossary
17661766
:term:`incomplete outputs <output completion>`, then the workflow is
17671767
not complete and the scheduler will :term:`stall` pending manual intervention.
17681768

1769+
dummy task
1770+
A task which runs a trivially simple script such as ``sleep 1``,
1771+
``exit 0`` or ``true``, or which uses :ref:`task-run-modes.skip`
1772+
to avoid running a script at all.
1773+
1774+
dummy mode
1775+
A workflow run mode that replaces all tasks with :term:`dummy tasks <dummy task>`.
1776+
See :ref:`workflow-run-modes.dummy`.

src/user-guide/interventions/index.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,3 +488,38 @@ Hold The Workflow And Trigger Tasks One By One
488488
Task Hold
489489
When a task is :term:`held <hold>`, then it will not submit (if ready to
490490
submit) until released.
491+
492+
493+
I want to Skip a cycle of tasks and allow the workflow to continue
494+
------------------------------------------------------------------
495+
496+
:Example:
497+
498+
I want to skip a cycle (or group) of tasks and continue as if they had run
499+
and succeeded.
500+
501+
:Solution:
502+
503+
Set the run mode of the tasks to skip and Cylc will pretend that they
504+
have run (very quickly).
505+
506+
.. tab-set::
507+
508+
.. tab-item:: GUI
509+
:sync: gui
510+
511+
.. image:: skip-cycle.gui.gif
512+
:width: 75%
513+
514+
.. tab-item:: CLI
515+
:sync: cli
516+
517+
.. code-block:: console
518+
519+
cylc broadcast -p '<cycle>' -n root -s 'run mode = skip'
520+
521+
.. note::
522+
523+
``-n root`` matches all tasks in a cycle. Similarly, it is possible to
524+
broadcast this setting to the root namespace of any family, or to
525+
multiple named tasks.
736 KB
Loading

src/user-guide/running-workflows/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Running Workflows
1212
tracking-task-state
1313
workflow-completion
1414
reflow
15-
simulation-modes
15+
workflow-run-modes
1616
scheduler-log-files
1717
dynamic-behaviour
1818
authentication-files

src/user-guide/running-workflows/simulation-modes.rst

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
.. _workflow-run-modes:
2+
3+
Workflow Run Modes
4+
==================
5+
6+
Cylc can run a workflow without running the real jobs, which may be
7+
useful when developing workflows. Tasks
8+
in :ref:`workflow-run-modes.dummy` and
9+
:ref:`workflow-run-modes.simulation` can help you to understand how different outcomes
10+
and run lengths will affect the workflow.
11+
12+
To start a workflow in one of these modes:
13+
14+
.. code-block:: console
15+
16+
$ cylc play --mode=dummy <workflow-id>
17+
$ cylc play --mode=simulation <workflow-id>
18+
19+
.. admonition:: Limitations
20+
21+
* A workflow cannot be :term:`restarted <restart>` in a different run mode. Instead,
22+
install a new instance of the workflow and run it from scratch in the new mode.
23+
* Workflows run in Dummy and Simulation mode do not allow the run mode of
24+
individual tasks to be overridden by :ref:`task-run-modes.skip`
25+
26+
27+
.. _workflow-run-modes.dummy:
28+
29+
Dummy Mode
30+
----------
31+
32+
**Dummy mode** replaces real jobs with background jobs on the
33+
scheduler host which use ``sleep`` to simulate the run length according to
34+
the settings described for simulation mode.
35+
This avoids :term:`job runner` directives that request compute
36+
resources for real workflow tasks, and it allows any workflow configuration to
37+
be run locally in dummy mode.
38+
39+
.. admonition:: Limitations
40+
41+
* Dummy mode can only be applied to a whole workflow.
42+
* Dummy tasks run locally, so dummy mode does not test communication with remote
43+
job platforms. However, it is easy to write a live-mode test workflow with
44+
simple ``sleep 10`` tasks that submit to a remote platform.
45+
46+
47+
.. _workflow-run-modes.simulation:
48+
49+
Simulation Mode
50+
---------------
51+
52+
**Simulation mode** does not run real jobs, and does not generate job
53+
log files. Instead, the scheduler internally simulates task completion to evolve
54+
the workflow.
55+
56+
57+
Simulated Run Length
58+
^^^^^^^^^^^^^^^^^^^^
59+
60+
The default dummy or simulated job run length is 10 seconds. It can be
61+
changed with :cylc:conf:`[runtime][<namespace>][simulation]default run length`.
62+
63+
If :cylc:conf:`[runtime][<namespace>]execution time limit` and
64+
:cylc:conf:`[runtime][<namespace>][simulation]speedup factor` are both set,
65+
run length is computed by dividing the
66+
execution time limit by the speedup factor.
67+
68+
Simulated Failure
69+
^^^^^^^^^^^^^^^^^
70+
71+
Tasks always complete all custom outputs, and by default they will succeed.
72+
73+
If you want to test emitting only some custom outputs
74+
you can run the workflow in live mode with task run modes
75+
set to :ref:`skip mode <task-run-modes.skip>`.
76+
77+
You can set some or all instances of a task to fail using
78+
:cylc:conf:`[runtime][<namespace>][simulation]fail cycle points`,
79+
which takes either a list of cycle point strings or "all".
80+
81+
Tasks set to fail will succeed on their second or following simulated
82+
submission. If you want all submissions to fail, set
83+
:cylc:conf:`[runtime][<namespace>][simulation]fail try 1 only = False`.
84+
85+
For example, to simulate a task you know to be flaky on the half
86+
hour but not on the hour:
87+
88+
.. code-block:: cylc
89+
90+
[[get_observations]]
91+
execution retry delays = PT30S
92+
[[[simulation]]]
93+
fail cycle points = 2022-01-01T00:30Z, 2022-01-01T01:30Z
94+
95+
In another case you might not expect the retry to work, and want to test
96+
whether your failure handling works correctly:
97+
98+
.. code-block:: cylc
99+
100+
[[get_data]]
101+
execution retry delays = PT30S
102+
[[[simulation]]]
103+
fail try 1 only = false
104+
fail cycle points = 2022-01-01T03:00Z
105+
106+
.. admonition:: Limitations
107+
108+
* Simulation mode can only be applied to a whole workflow.
109+
* Alternate path branching is difficult to simulate effectively. You can
110+
configure certain tasks to fail via
111+
:cylc:conf:`[runtime][<namespace>][simulation]`, but all branches based
112+
on mutually exclusive custom outputs will run because all custom outputs get
113+
artificially completed in dummy mode and in simulation mode.

src/user-guide/task-implementation/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ job fails and the task is re-run).
1616
job-scripts
1717
job-submission
1818
ssh-job-management
19+
skip-mode

0 commit comments

Comments
 (0)