@@ -3,116 +3,141 @@ How to add a recipe to the |RTW|
33
44.. include :: common.txt
55
6- .. note ::
7- Before you follow these steps to add your recipe, you must be able to
8- successfully run the recipe with the latest version of ESMValTool on the
9- compute server you use at your site, as detailed by the ``platform `` option
10- in the ``[[COMPUTE]] `` section in the site-specific ``.cylc `` file in the
11- ``esmvaltool/utils/recipe_test_workflow/site/ `` directory.
6+ Overview
7+ --------
128
13- #. Open a `new ESMValTool issue `_ on GitHub, assign yourself to the issue, and
14- add the ``Recipe Test Workflow (RTW) `` label to the issue, see
15- `ESMValTool issue #3663 `_ for an example.
9+ To add a recipe to the |RTW | you will:
1610
17- #. Create a branch.
11+ * Run the recipe at your site
12+ * Note the actual duration and memory usage
13+ * Edit your site's recipe file
14+ * Create the recipe's KGOs
15+ * Request a review
1816
19- #. Obtain the duration and memory usage of the recipe from the messages printed
20- to screen, or at the end of the ``run/main_log.txt `` file in the recipe
21- output directory after running your recipe on the compute cluster you use at
22- your site; these messages will look something like::
17+ The recipe will then run at your site whenever the |RTW | is run.
2318
24- YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Time for running the recipe was: 0:02:13.334742
25- YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Maximum memory used (estimate): 2.4 GB
26- [...]
27- YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Run was successful
19+ Preparation
20+ -----------
2821
29- #. Add the recipe to the ``[task parameters] `` section in the
30- ``esmvaltool/utils/recipe_test_workflow/flow.cylc `` file.
22+ #. Open a `new ESMValTool issue `_ on GitHub. Assign yourself to the issue and
23+ add the ``Recipe Test Workflow (RTW) `` label. `ESMValTool issue #3663 `_
24+ provides an example.
3125
32- .. hint ::
33- If the recipe takes less than 10 minutes to run then it should be added
34- to the ``fast `` option. Recipes that take longer than ten minutes should
35- be added to the ``medium `` option.
26+ #. Create a branch.
27+
28+ #. Run the recipe:
29+
30+ * with the latest version of ESMValTool
31+ * on the compute server you use at your site
3632
3733 .. hint ::
38- The line added should follow the format of ``recipe_new_recipe, \ ``,
39- unless the line is the last one in the list, in which case the line added
40- should follow the format of ``recipe_new_recipe ``.
41-
42- #. If the duration of the recipe is larger than the value specified by the
43- ``execution time limit `` option in the ``[[COMPUTE]] `` section in the
44- aforementioned site-specific ``.cylc `` file, and / or the memory usage of
45- the recipe is larger than the value specified by the ``--mem `` option in the
46- ``[[[directives]]] `` section in the ``[[COMPUTE]] `` section, add a section
47- (in alphabetical order) to this file as shown below (round the duration to
48- the nearest second)::
49-
50- [[process<fast=recipe_albedolandcover>]]
51- # Actual: 0m31s, 2.5 GB on 2024-04-08.
52- execution time limit = PT2M
53- [[[directives]]]
54- --mem = 3G
34+ Your compute server is defined in the
35+ ``esmvaltool/utils/recipe_test_workflow/site/<site>.cylc `` file as
36+ follows::
37+
38+ [[COMPUTE]]
39+ platform = <your compute server>
40+
41+ #. Obtain the actual duration and memory usage of the recipe. This can be found
42+ either in the message printed to screen, or at the end of the
43+ ``run/main_log.txt `` file in the recipe output directory. The relevant lines will
44+ look something like::
45+
46+ YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Time for running the recipe was: 0:02:13.334742
47+ YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Maximum memory used (estimate): 2.4 GB
48+ [...]
49+ YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Run was successful
50+
51+ Adding the recipe
52+ -----------------
53+
54+ #. Add the recipe in alphabetical order to either ``FAST_RECIPES `` or
55+ ``MEDIUM_RECIPES `` in the ``<site>-recipes.jinja `` file. It should look
56+ something like::
57+
58+ {
59+ 'recipe_path': 'recipe_a_fast_recipe',
60+ 'actual': '2m13s, 2.4 GB on YYYY-MM-DD',
61+ 'max_time': 'PT3M',
62+ 'max_memory': '3G',
63+ }
64+
65+ .. important ::
66+ Add the recipe to ``FAST_RECIPES `` if it takes *less * than 10 mins to
67+ run at your site. Add the recipe to ``MEDIUM_RECIPES `` if it takes *more *
68+ than 10 mins.
5569
5670 .. hint ::
57- The ``fast `` key in the example task definition above
58- (``[[process<fast=recipe_albedolandcover>]] ``) should match name of the
59- option the recipe was added to in the ``[task parameters] `` section in
60- the ``esmvaltool/utils/recipe_test_workflow/flow.cylc `` file
71+ The :ref: `site/site-recipes.jinja <site_recipes_file >`.
72+ file provides more information.
6173
6274 .. hint ::
63- Set the ``execution time limit `` to 10-20% more than the actual duration.
64- For actual durations of up to ``1m45s ``, set the ``execution time limit ``
65- to ``PT2M `` (2 minutes).
75+ Set the ``max_time `` to 10-20% more than the actual duration. For actual
76+ durations of up to ``1m45s ``, set ``max_time `` to ``PT2M `` (2 minutes).
6677
6778 .. hint ::
6879 Try not to regularly waste more than 500 MiB in memory usage. Typically,
6980 rounding the actual memory usage up to the nearest integer is acceptable.
7081
71- #. Stop any running ``recipe_test_workflow `` workflows::
72-
73- cylc stop recipe_test_workflow/*
82+ Create the |KGOs |
83+ -----------------
7484
7585#. Run the |RTW |, as detailed in the :ref: `quick_start_guide `; it is expected
7686 that the ``compare `` task will fail.
7787
78- #. Update the Known Good Outputs (|KGOs |):
88+ .. important ::
89+ The ``compare `` task fails because the |KGOs | for the recipe do not yet
90+ exist. This run of the |RTW | will generate the outputs that will be
91+ used as |KGOs |.
7992
80- * Recursively copy the recipe output directory (i.e.
81- ``recipe_<recipe>_<date>_<time>/ ``) from the
82- ``${HOME}/cylc-run/recipe_test_workflow/runN/share/cycle/<cycle>/ ``
83- directory to your site-specific |KGO | directory, as detailed by the
84- ``KGO_ROOT_PATH `` option in the site-specific ``.conf `` file in the
85- ``esmvaltool/utils/recipe_test_workflow/opt/ `` directory::
93+ #. Recursively copy the recipe output directory
94+ ``recipe_<recipe>_<date>_<time>/ `` to your site-specific |KGO | directory::
8695
87- cp -r ${HOME}/cylc-run/recipe_test_workflow/runN/share/cycle/<cycle>/recipe_<recipe>_<date>_<time> <KGO_ROOT_PATH>
96+ cp -r ${HOME}/cylc-run/recipe_test_workflow/runN/share/cycle/<cycle>/recipe_<recipe>_<date>_<time> <KGO_ROOT_PATH>
8897
89- .. note ::
90- Cylc is typically configured such that
91- ``${HOME}/cylc-run/recipe_test_workflow/runN/share `` is a symbolic link
92- to a share directory located on a scratch disk; the recipe output
93- directory is not stored in ``${HOME} ``.
98+ .. hint ::
99+ ``<cycle> `` will look something like: ``20250101T0900Z ``. The recipe output
100+ directory will look something like: ``recipe_python_20250101_090000 ``
101+
102+ .. hint ::
103+ Find your site specific ``KGO_ROOT_PATH `` in the ``rose-suite-<site>.conf `` file
104+ in the ``esmvaltool/utils/recipe_test_workflow/opt/ `` directory.
105+
106+ .. note ::
107+ Cylc is typically configured such that
108+ ``${HOME}/cylc-run/recipe_test_workflow/runN/share `` is a symbolic link
109+ to a share directory located on a scratch disk; the recipe output
110+ directory is not stored in ``${HOME} ``.
94111
95- * Enable write permissions for all users on the recipe output directory in
96- your site-specific |KGO | directory::
112+ #. Enable write permissions for all users on the recipe output directory in
113+ your site-specific |KGO | directory::
97114
98- chmod -R a+w <KGO_ROOT_PATH>/recipe_<recipe>_<date>_<time>
115+ chmod -R a+w <KGO_ROOT_PATH>/recipe_<recipe>_<date>_<time>
99116
100117#. Stop any running ``recipe_test_workflow `` workflows::
101118
102- cylc stop recipe_test_workflow/*
119+ cylc stop recipe_test_workflow/*
103120
104121#. Run the |RTW | again, as detailed in the :ref: `quick_start_guide `; the
105122 ``compare `` task should now succeed.
106123
107- #. Add the recipe to the documentation:
124+ .. important ::
125+ Unless you want the |RTW | to continue running every night, repeat the
126+ previous step to stop the workflow.
108127
109- * Add a URL for the recipe in ``doc/sphinx/source/utils/RTW/common.txt ``
110- under the ``.. Links `` section in alphabetical order (follow the format
111- ``.. _<name>: <URL> ``).
128+ Request a review
129+ ----------------
112130
113- * Add the recipe to the list of :ref: `currently_tested_recipes ` in
114- alphabetical order (follow the format ``* `<name>`_ ``).
131+ #. Commit and push your changes.
115132
116- #. Commit and push your changes, create a PR, assign yourself to the PR, and
117- add the ``Recipe Test Workflow (RTW) `` label to the PR, see
133+ #. Create a PR. Assign yourself to the PR, and add the
134+ ``Recipe Test Workflow (RTW) `` label to the PR. Refer to
118135 `ESMValTool PR #3664 `_ for an example.
136+
137+ .. note ::
138+ Reviewers will automatically be assigned to your PR.
139+
140+ Congratulations!
141+ ----------------
142+
143+ The recipe will now run at your site whenever the RTW is run.
0 commit comments