Skip to content

Commit b1e430b

Browse files
authored
Merge pull request #734 from oliver-sanders/cheat-sheet
Cheat sheet
2 parents b8a521e + 144b808 commit b1e430b

File tree

9 files changed

+372
-57
lines changed

9 files changed

+372
-57
lines changed

src/7-to-8/major-changes/cli.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,17 @@ GUI. Consequently the following commands have also been removed:
113113
The ``cylc gui`` command remains, it launches a standalone version of the
114114
web GUI (providing the `Cylc UI Server`_ is installed).
115115

116-
.. seealso::
117-
118-
:ref:`CompoundCommands` - For your convenience we have
119-
provided commands which represent common working practices. For
120-
example ``cylc vip`` (Validate-Install-Play) which runs
121-
``cylc validate``, ``cylc install`` and ``cylc play``.
116+
Additionally, there are two
117+
":ref:`compound commands <installing_workflows.compound_commands>`"
118+
which automate common working practices, namely:
119+
120+
``cylc vip``
121+
Validate, install and play a workflow. This is similar to what
122+
``rose suite-run`` did.
123+
``cylc vr``
124+
Validate, reinstall, then either reload (if the workflow is running) or restart
125+
(if it is stopped) the workflow. This is similar to what
126+
``rose suite-run --reload`` and ``rose suite-run --restart`` did.
122127

123128

124129
Cylc 8 Standardised IDs

src/glossary.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Glossary
8181
- :term:`xtriggers <xtrigger>`.
8282
- :ref:`internal queues <InternalQueues>`
8383
- :ref:`runahead limit <RunaheadLimit>`
84+
8485
- ``preparing`` tasks - i.e. tasks in the process of submitting jobs
8586
- ``submitted`` and ``running`` tasks - i.e. those with active jobs
8687
- :term: `incomplete` tasks which have completed without satisfying all of their

src/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ indefinitely.
2323
workflow-design-guide/index
2424
reference/index
2525
glossary
26-
troubleshooting

src/user-guide/cheat-sheet.rst

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
.. _user-guide.cheat_sheet:
2+
3+
Cheat Sheet
4+
===========
5+
6+
A cheat sheet covering most of the major Cylc commands. For a full list see
7+
``cylc help all``.
8+
9+
See also the :ref:`Cylc 7 to 8 migration cheat sheet <728.cheat_sheet>`.
10+
11+
.. contents::
12+
:depth: 2
13+
:local:
14+
:backlinks: none
15+
16+
.. highlight:: sub
17+
18+
19+
Working with Workflows
20+
----------------------
21+
22+
``cylc validate``
23+
Validates the workflow configuration (will tell you if there are any problems).
24+
``cylc install``
25+
Install a workflow (i.e. copy its files into the ``~/cylc-run`` directory).
26+
``cylc play``
27+
Start a workflow running.
28+
29+
Install and start a workflow::
30+
31+
# validate a workflow
32+
cylc validate <name|path>
33+
34+
# install a workflow
35+
cylc install <name|path>
36+
37+
# start a workflow
38+
cylc play <id>
39+
40+
For convenience, these three operations can be combined with the ``cylc vip`` command
41+
(vip = validate + install + play)::
42+
43+
# validate, install and play a workflow
44+
cylc vip <name|path>
45+
46+
When you're done with a workflow run, remove it with ``cylc clean``::
47+
48+
# delete a workflow installation
49+
cylc clean <id>
50+
51+
52+
Starting and Stopping Workflows
53+
-------------------------------
54+
55+
Start workflows with ``cylc play``, stop them with ``cylc stop``.
56+
57+
Workflows can be started or stopped multiple times, Cylc will always continue
58+
where it left off::
59+
60+
# start a workflow
61+
cylc play <id>
62+
63+
# stop a workflow
64+
cylc stop <id>
65+
66+
# restart a workflow
67+
cylc play <id>
68+
69+
You can also "pause" a workflow. A paused workflow will not submit any new
70+
jobs. Pausing workflows can be handy if you need to perform
71+
:ref:`interventions <user-guide.interventions>` on them. Use ``cylc play`` to
72+
resume a workflow::
73+
74+
# pause a workflow
75+
cylc pause <id>
76+
77+
# resume a workflow
78+
cylc play <id>
79+
80+
The Cylc play, pause and stop commands work similarly to the play, pause and
81+
stop buttons on an old tape player. You can play, pause or stop a workflow as
82+
many times as you like; Cylc will never lose its place in the workflow.
83+
84+
85+
List Workflows
86+
--------------
87+
88+
The ``cylc scan`` command can list your installed workflows::
89+
90+
# list all running workflows
91+
cylc scan
92+
93+
# get information about running workflows
94+
cylc scan --format=rich
95+
96+
# list all installed workflows
97+
cylc scan --states=all
98+
99+
You can also view your workflows in the GUI or Tui.
100+
101+
102+
Opening the GUI/Tui
103+
-------------------
104+
105+
Cylc has an in-terminal utility for monitoring and controlling workflows::
106+
107+
# view all workflows
108+
cylc tui
109+
110+
# open a specific workflow
111+
cylc tui <id>
112+
113+
There is also a GUI which opens in a web browser::
114+
115+
# open the GUI to the homepage
116+
cylc gui
117+
118+
# open the GUI to a specific workflow
119+
cylc gui <id>
120+
121+
122+
Making Changes To Running Workflows
123+
-----------------------------------
124+
125+
You can make changes to a workflow without having to shut it down and restart it.
126+
127+
First, make your required changes to the files in the workflow's
128+
:term:`source directory`, then run the ``cylc vr`` command
129+
(:ref:`more information <interventions.edit-the-workflow-configuration>`)::
130+
131+
# validate, reinstall and reload the workflow
132+
cylc vr <id>
133+
134+
If you want to quickly edit a task's configuration, e.g. whilst developing a
135+
workflow or testing changes, the
136+
:ref:`"Edit Runtime" feature <interventions.edit-a-tasks-configuration>`
137+
in the GUI can be convenient.
138+
139+
140+
Inspecting Workflows
141+
--------------------
142+
143+
Validate the workflow configuration (good for spotting errors)::
144+
145+
cylc validate <path|id>
146+
147+
Check the workflow for common problems and code style::
148+
149+
cylc lint <path|id>
150+
151+
View the workflow configuration *before* Cylc has parsed it
152+
(but after pre-processing - good for debugging Jinja2 errors)::
153+
154+
cylc view -p <path|id>
155+
156+
View the workflow configuration *after* Cylc has parsed it
157+
(good for debugging family inheritance)::
158+
159+
cylc config <path|id>
160+
161+
# view a specific task's configuration
162+
cylc config <path|id> -i '[runtime][<task>]'
163+
164+
# view the workflow configuration with defaults applied
165+
cylc config <path|id> --defaults
166+
167+
Generate a graphical representation of the workflow's :term:`graph`
168+
(a useful tool for developing workflow graphs)::
169+
170+
cylc graph <path|id>
171+
172+
# render the graph between two cycle points
173+
cylc graph <path|id> <cycle1> <cycle2>
174+
175+
# render the graph transposed (can make it easier to read)
176+
cylc graph <path|id> --transpose
177+
178+
# group tasks by cycle point
179+
cylc graph <path|id> --cycles
180+
181+
# collapse tasks within a family (can reduce the number of tasks displayed)
182+
cylc graph <path|id> --group=<family>
183+
184+
List all tasks and families defined in a workflow::
185+
186+
cylc list <path|id>
187+
188+
189+
Running Rose Stem Workflows
190+
---------------------------
191+
192+
Currently, Rose stem workflows are installed using a different command to
193+
regular workflows::
194+
195+
# install a rose-stem workflow
196+
rose stem
197+
198+
# start a rose-stem workflow
199+
cylc play <id>
200+
201+
Once a workflow is installed you can run regular Cylc commands against it, e.g
202+
``cylc stop``.
203+
204+
We may be able to automatically activate ``rose stem`` functionality as part
205+
of ``cylc install`` in the future which would allow you to install and start
206+
a Rose Stem workflow with ``cylc vip``.
207+
208+
209+
Interventions
210+
-------------
211+
212+
You can intervene in the running a workflow, e.g. to re-run a task.
213+
214+
Interventions are written up in :ref:`user-guide.interventions`. Here is a
215+
quick summary:
216+
217+
Run or re-run a task (:ref:`more info <interventions.re-run-a-task>`)::
218+
219+
cylc trigger <id>//<cycle>/<task>
220+
221+
Mark a task as "succeeded"
222+
(:ref:`more info <interventions.set-task-outputs>`)::
223+
224+
cylc set <id>//<cycle>/<task>
225+
226+
Kill a running job::
227+
228+
cylc kill <id>//<cycle>/<task>
229+
230+
231+
Running Workflows in Debug Mode
232+
-------------------------------
233+
234+
When a workflow is in debug mode, more information gets written to the
235+
workflow's :ref:`log file <troubleshooting.log_files>`.
236+
Jobs also get run in Bash "xtrace" mode (``set -x``) which can help to diagnose
237+
the line in a task's script that caused the error.
238+
239+
Start a workflow in debug mode::
240+
241+
$ cylc vip --debug <name|path>
242+
243+
# OR
244+
$ cylc play --debug <id>
245+
246+
Switch an already running workflow into debug mode::
247+
248+
cylc verbosity DEBUG <workflow-id>
249+
250+
For more information, see :ref:`troubleshooting`.
251+
252+
253+
Managing Multiple Workflows
254+
---------------------------
255+
256+
Many Cylc commands can operate over multiple workflows::
257+
258+
# stop all workflows
259+
cylc stop '*'
260+
261+
# pause all workflows
262+
cylc pause '*'
263+
264+
# re-run all failed tasks in all workflows
265+
cylc trigger "*//*/*:failed"
266+
267+
The ``*`` characters in these examples are "globs". Make sure you put quotes
268+
around them to prevent the shell from trying to expand them.
269+
270+
For more information on globs or the Cylc ID format, run ``cylc help id``.
271+
272+
273+
Working With Cylc IDs
274+
---------------------
275+
276+
Everything in a Cylc workflow has an ID. We use these IDs on the command line
277+
and in the GUI.
278+
279+
Cylc Ids take the format::
280+
281+
<workflow-id>//<cycle>/<task>/<job>
282+
283+
E.G::
284+
285+
# a workflow
286+
my-workflow
287+
288+
# a cycle within a workflow
289+
my-workflow//20000101T00Z
290+
291+
# a task instance
292+
my-workflow//20000101T00Z/mytask
293+
294+
# a job submission
295+
my-workflow//20000101T00Z/mytask/01
296+
297+
For more information on the Cylc ID format, run ``cylc help id``.

src/user-guide/compound-commands.rst

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/user-guide/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ User Guide
88
:maxdepth: 2
99

1010
introduction
11-
examples/index
12-
interventions/index
1311
writing-workflows/index
1412
installing-workflows
1513
running-workflows/index
1614
task-implementation/index
15+
interventions/index
1716
removing-workflows
18-
compound-commands
17+
cheat-sheet
18+
examples/index
19+
troubleshooting

0 commit comments

Comments
 (0)