|
| 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, 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 loose 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 -t 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 | +(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 with 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 or they won't do what you're expecting. |
| 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``. |
0 commit comments