Skip to content

Commit de3a1ff

Browse files
authored
Merge pull request #395 from oliver-sanders/workflow-design-guide-8.0.0
design guide: update for cylc 8
2 parents e551971 + cb366c7 commit de3a1ff

File tree

3 files changed

+38
-67
lines changed

3 files changed

+38
-67
lines changed

src/workflow-design-guide/general-principles.rst

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,23 @@ Monolithic Or Interdependent Workflows
5050
When writing workflows from scratch you may need to decide between putting
5151
multiple loosely connected sub-workflows into a single large workflow, or
5252
constructing a more modular system of smaller workflows that depend on each other
53-
through inter-workflow triggering. Each approach has its pros and cons, depending
54-
on your requirements and preferences with respect to the complexity and
55-
manageability of the resulting system.
56-
57-
Inter-Workflow Triggering
58-
^^^^^^^^^^^^^^^^^^^^^^^^^
59-
60-
A task in one workflow can explicitly trigger off of a task in another workflow. The
61-
full range of possible triggering conditions is supported, including custom
62-
message triggers. Remote triggering involves repeatedly querying ("polling")
63-
the remote workflow run database, not the :term:`scheduler`, so it works even
64-
if the other workflow is down at the time.
65-
66-
There is special graph syntax to support triggering off of a task in another
67-
workflow, or you can call the underlying ``cylc workflow-state`` command
68-
directly in task scripting.
69-
70-
In real time workflows you may want to use clock-triggers to delay the onset of
71-
inter-workflow polling until roughly the expected completion time of the remote
72-
task.
53+
through :ref:`inter-workflow triggering <Built-in Workflow State Triggers>`.
54+
Each approach has its pros and cons, depending on your requirements and
55+
preferences with respect to the complexity and manageability of the resulting
56+
system.
7357

7458

7559
.. _Self-Contained Workflows:
7660

7761
Self-Contained Workflows
7862
------------------------
7963

80-
All files generated by Cylc during a workflow run are confined to the *workflow
81-
run directory* ``$HOME/cylc-run/<workflow-name>``. However, Cylc has no control
82-
over the locations of the programs, scripts, and files, that are executed,
83-
read, or generated by your tasks at runtime. It is up to you to ensure that
84-
all of this is confined to the run directory too, as far as possible.
64+
All files generated by Cylc during a workflow run are confined to the workflow
65+
:term:`run directory` ``$HOME/cylc-run/<workflow-id>``. However, Cylc has no
66+
control over the locations of the programs, scripts, and files, that are
67+
executed, read, or generated by your tasks at runtime. It is up to you to
68+
ensure that all of this is confined to the run directory too, as far as
69+
possible.
8570

8671
Self-contained workflows are more robust, easier to work with, and more portable.
8772
Multiple instances of the same workflow (with different workflow names) should be
@@ -148,19 +133,16 @@ to copy or move selected files to external locations as needed (see
148133
Task Host Selection
149134
-------------------
150135

151-
At sites with multiple task hosts to choose from, use
152-
``rose host-select`` to dynamically select appropriate task hosts
153-
rather than hard coding particular hostnames. This enables your workflow to
154-
adapt to particular machines being down or heavily overloaded by selecting
155-
from a group of hosts based on a series of criteria.
156-
``rose host-select`` will only return hosts that can be contacted by
157-
non-interactive SSH.
136+
The ``rose host-select`` command is now deprecated. Workflows should migrate
137+
to using :term:`platforms <platform>` which provide a more efficient
138+
solution.
139+
See :ref:`MajorChangesPlatforms` for details.
158140

159141

160142
Task Scripting
161143
--------------
162144

163-
Non-trivial task scripting should be held in external files rather than
145+
Non-trivial task scripting should be held in separate script files rather than
164146
inlined in :cylc:conf:`flow.cylc`. This keeps the workflow definition tidy, and it
165147
allows proper shell-mode text editing and independent testing of task scripts.
166148

@@ -274,29 +256,34 @@ development and testing.
274256
Clock-Triggered Tasks
275257
---------------------
276258

277-
Tasks that wait on real time data should use clock-triggers to delay job
278-
submission until the expected data arrival time:
259+
Tasks that wait on real time data should use
260+
:ref:`clock triggers <Built-in Clock Triggers>`
261+
to delay job submission until the expected data arrival time:
279262

280263
.. code-block:: cylc
281264
282265
[scheduling]
283266
initial cycle point = now
284-
[[special tasks]]
267+
[[xtriggers]]
285268
# Trigger 5 min after wallclock time is equal to cycle point.
286-
clock-trigger = get-data(PT5M)
269+
clock = wall_clock(offset=PT5M)
287270
[[graph]]
288-
T00 = get-data => process-data
271+
T00 = @clock => get-data => process-data
272+
273+
.. cylc-scope:: flow.cylc[runtime][<namespace>]
289274

290275
Clock-triggered tasks typically have to handle late data arrival. Task
291-
execution *retry delays* can be used to simply retrigger the task at
292-
intervals until the data is found, but frequently retrying small tasks probably
293-
should not go to a :term:`job runner`, and multiple task failures will be logged
294-
for what is a essentially a normal condition (at least it is normal until the
295-
data is really late).
276+
:cylc:conf:`execution retry delays` can be used to simply retrigger
277+
the task at intervals until the data is found, but frequently retrying small
278+
tasks is inefficient, and multiple task
279+
failures will be logged for what is a essentially a normal condition (at least
280+
it is normal until the data is really late).
281+
282+
.. cylc-scope::
296283

297284
Rather than using task execution retry delays to repeatedly trigger a task that
298285
checks for a file, it may be better to have the task itself repeatedly poll for
299-
the data (see :ref:`Rose App File Polling` for example).
286+
the data (see :ref:`Custom Trigger Functions`).
300287

301288

302289
.. _Rose App File Polling:
@@ -318,7 +305,8 @@ Task Execution Time Limits
318305
--------------------------
319306

320307
Instead of setting job wallclock limits directly in :term:`job runner`
321-
directives, use the ``execution time limit`` workflow config item.
308+
directives, use
309+
:cylc:conf:`flow.cylc[runtime][<namespace>]execution time limit`.
322310
Cylc automatically derives the correct job runner directives from this,
323311
and it is also used to run ``background`` and ``at`` jobs via
324312
the ``timeout`` command, and to poll tasks that haven't reported in

src/workflow-design-guide/portable-workflows.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Portable Workflows
44
==================
55

6-
.. TODO - platformise all the examples in here
7-
86
A *portable* or *interoperable* workflow can run "out of the box" at
97
different sites, or in different environments such as research and operations
108
within a site. For convenience we just use the term *site portability*.

src/workflow-design-guide/style-guide.rst

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,8 @@ script:
161161
Graph String Lines
162162
^^^^^^^^^^^^^^^^^^
163163

164-
Multiline ``graph`` strings can be entirely free-form:
165-
166-
.. code-block:: cylc
167-
168-
[scheduling]
169-
[[graph]]
170-
R1 = """
171-
# Main workflow:
172-
FAMILY:succeed-all => bar & baz => qux
173-
174-
# Housekeeping:
175-
qux => rose_arch => rose_prune"""
176-
177-
Whitespace is ignored in graph string parsing, however, so internal graph lines
178-
can be indented as if part of the :cylc:conf:`flow.cylc` syntax, or even out to the triple
179-
quotes, if you feel it aids readability (but watch line length with large
180-
indents; see :ref:`Line Length`):
164+
Whitespace is ignored in graph string parsing so internal graph lines
165+
should be indented as if part of the :cylc:conf:`flow.cylc` syntax:
181166

182167
.. code-block:: cylc
183168
@@ -191,8 +176,6 @@ indents; see :ref:`Line Length`):
191176
qux => rose_arch => rose_prune
192177
"""
193178
194-
Both styles are acceptable; choose one and use it consistently.
195-
196179
197180
Jinja2 Code
198181
^^^^^^^^^^^
@@ -237,6 +220,8 @@ Titles, Descriptions, And URLs
237220

238221
Document the workflow and its tasks with ``title``,
239222
``description``, and ``url`` items instead of comments.
223+
See the :cylc:conf:`flow.cylc[meta]` and
224+
:cylc:conf:`flow.cylc[runtime][<namespace>][meta]` sections.
240225

241226

242227
.. _Line Length:
@@ -313,7 +298,7 @@ domains without causing confusion.
313298
Rose Config Files
314299
-----------------
315300

316-
Use ``rose config-dump`` to load and re-save new Rose .conf files. This
301+
Use ``rose config-dump`` to load and re-save new ``rose.conf`` files. This
317302
puts the files in a standard format (ordering of lines etc.) to ensure that
318303
spurious changes aren't generated when you next use ``rose edit``.
319304

0 commit comments

Comments
 (0)