@@ -61,6 +61,23 @@ for debugging some specific issues:
61
61
These files can allow you to see how the configuration was changed between
62
62
restarts and reloads.
63
63
64
+ Each time a workflow is started, restarted or reloaded,
65
+ the configuration used is recorded in a file in ``log/config ``.
66
+ This provides a series of snapshots of the configuration.
67
+ These files are named:
68
+
69
+ ``<LOG FILE NUMBER>-<EVENT>-<(RE)START NUMBER> ``.
70
+
71
+ If for example we did:
72
+
73
+ .. code-block :: console
74
+
75
+ # Command # File created
76
+ cylc play workflow # 01-start-01.cylc
77
+ cylc vr workflow # 02-reload-01.cylc
78
+ cylc stop workflow
79
+ cylc play workflow # 03-restart-02.cylc
80
+
64
81
65
82
Shell Login/Profile Files
66
83
-------------------------
@@ -219,7 +236,7 @@ To find out more, see the ``job.err`` file.
219
236
.. note ::
220
237
221
238
To ensure Cylc jobs fail when they are supposed to, Cylc configures Bash
222
- to be a bit stricter than it is by default by running ``set -euo pipefail ``.
239
+ to be stricter than it is by default by running ``set -euo pipefail ``.
223
240
224
241
.. cylc-scope :: flow.cylc[runtime][<namespace>]
225
242
@@ -229,6 +246,11 @@ To find out more, see the ``job.err`` file.
229
246
230
247
.. cylc-scope ::
231
248
249
+ .. tip ::
250
+
251
+ One particularly common issue when developing a workflow is failure
252
+ to make a script executable. Use ``ls -l `` to check.
253
+
232
254
If you're struggling to track down the error, you might want to put the
233
255
workflow into debug mode::
234
256
@@ -470,6 +492,115 @@ environments. If you encounter this issue in combination with containers,
470
492
please let us know.
471
493
472
494
495
+ Debugging Workflow Configurations
496
+ ---------------------------------
497
+
498
+ Cylc Debugging Utilities
499
+ ^^^^^^^^^^^^^^^^^^^^^^^^
500
+
501
+ .. seealso ::
502
+
503
+ :ref: `user-guide.cheat_sheet `
504
+
505
+
506
+ Cylc comes with a number of utilities designed to allow inspection of
507
+ workflows:
508
+
509
+ ``cylc view ``
510
+ Prints workflow configurations before full parsing by Cylc. This
511
+ can include :ref: `Jinja2 <troubleshooting.jinja2 >` (use ``-j ``)
512
+ or Empy template processing.
513
+
514
+ Include files can be inlined (use ``-i ``).
515
+
516
+ ``cylc config ``
517
+ Prints all or part of the workflow configuration after Cylc has parsed the file
518
+ and expanded the runtime inheritance hierarchy. For example:
519
+
520
+ .. code-block :: cylc
521
+
522
+ [runtime]
523
+ [[root]]
524
+ execution time limit = PT5S
525
+ [[FAMILY]]
526
+ pre-script = sleep 15
527
+ [[foo, bar]]
528
+ script = echo 'Hello'
529
+ [[bar]]
530
+ inherit = FAMILY
531
+ post-script = echo 'World'
532
+
533
+ would be shown as (revealing in this example why task ``bar ``
534
+ always fails):
535
+
536
+ .. code-block :: cylc
537
+
538
+ [runtime]
539
+ [[root]]
540
+ execution time limit = PT5S
541
+ [[FAMILY]]
542
+ execution time limit = PT5S
543
+ pre-script = sleep 15
544
+ [[foo]]
545
+ execution time limit = PT5S
546
+ script = echo 'Hello'
547
+ [[bar]]
548
+ execution time limit = PT5S
549
+ pre-script = sleep 15
550
+ script = echo 'Hello'
551
+ inherit = FAMILY
552
+ post-script = echo 'World'
553
+
554
+
555
+ ``cylc lint ``
556
+ #. Checks the config against the :ref: `style_guide `.
557
+ #. Looks for deprecated Cylc 7 configurations and recommends
558
+ Cylc 8 configurations to replace them.
559
+
560
+ .. seealso ::
561
+
562
+ :ref: `cylc_lint_script `
563
+
564
+ ``cylc validate ``
565
+
566
+ Validates the workflow configuration.
567
+
568
+ .. seealso ::
569
+
570
+ :ref: `Validation `
571
+
572
+ .. _troubleshooting.jinja2 :
573
+
574
+ See what the Jinja2 is doing
575
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
576
+
577
+ It can sometimes be difficult to understand what Jinja2
578
+ templating is doing to a workflow configuration.
579
+
580
+ ``cylc view --process `` (or ``-p ``) shows you what the
581
+ configuration will look like after Jinja2 processing.
582
+
583
+ For example:
584
+
585
+ .. code-block ::
586
+
587
+ {% for n in my_function(3) %}
588
+ R/1983/P{{n}}Y = cicada_{{n}}[-P{{n}}Y] => cicada_{{n}}
589
+ {% endfor %}
590
+
591
+ is much easier to understand as:
592
+
593
+ .. code-block :: cylc-graph
594
+
595
+ R/1983/P2Y = cicada_2[-P2Y] => cicada_2
596
+ R/1983/P3Y = cicada_3[-P3Y] => cicada_3
597
+ R/1983/P5Y = cicada_5[-P5Y] => cicada_5
598
+
599
+ If you have installed and played a workflow
600
+ (even using ``play --pause ``) this processed content
601
+ is shown in ``log/config/flow-processed.cylc ``.
602
+
603
+
473
604
Getting Help
474
605
------------
475
606
0 commit comments