Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how to add a recipe documentation #3614

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1f52310
#3074: First draft of adding recipe documentation.
mo-gill May 23, 2024
cbe5a9c
#3074: Add process resource instructions.
mo-gill May 24, 2024
3c6bc26
#3074: Fix project title due to visual overlap.
mo-gill May 24, 2024
06f79f2
#3074: Corrections to documentation.
mo-gill May 27, 2024
8c82530
#3074: Add pydata sphinx theme to environment.
mo-gill May 27, 2024
fd81290
Merge branch 'recipe_test_workflow_prototype' into 3074_create_how_to…
mo-gill May 28, 2024
b0ad4cc
#3074: Remove criteria and specify naming convention.
mo-gill May 28, 2024
d3f1c3f
#3074: Correction to please note section.
mo-gill May 28, 2024
829f3da
#3074: Correction of run folder and formatting directions.
mo-gill May 28, 2024
8aa23fa
#3074: Correction to docs on adding recipes to tested_recipes.rst
mo-gill May 28, 2024
936368c
#3074: Change unordered to ordered list.
mo-gill May 28, 2024
047a480
#3074: Changing order of steps.
mo-gill May 29, 2024
1f0f27e
#3074: Attempting to amend steps of docs.
mo-gill May 29, 2024
b0ea76e
#3074: Recorrect order.
mo-gill May 29, 2024
36be254
#3074: Re-add please note section and alter last points.
mo-gill May 29, 2024
c3902e4
:3074: Improve formatting.
mo-gill May 29, 2024
9af34bf
#3074: further adjustments to docs.
mo-gill May 29, 2024
c4ad8d3
#3074: Add details about mem/time usage in docs.
mo-gill Jun 4, 2024
9f8d5da
#3074: Reword and reformat docs.
mo-gill Jun 4, 2024
13db053
#3074: correction of example command.
mo-gill Jun 4, 2024
8cc5e53
#3074: Amend docs.
mo-gill Jun 4, 2024
0cd3f91
#3074: Change some commands in docs into a sub-list.
mo-gill Jun 4, 2024
d236a32
#3074: Improve docs.
mo-gill Jun 4, 2024
f89dc7e
#3074: Resole merge conflicts by removing rtw env files.
mo-gill Jun 18, 2024
d01a94f
#3074: Documentation amendments.
mo-gill Jun 18, 2024
2be0d9c
#3074: Add to docs regarding execution limits.
mo-gill Jun 18, 2024
8c9f0e1
#3074: Correction of formatting in docs.
mo-gill Jun 18, 2024
f341fe1
#3074: Correct indentation.
mo-gill Jun 18, 2024
615b4a2
#3074: Move adding_a_recipe out of user guide.
mo-gill Jun 18, 2024
7e4c985
#3074: Make wording more specific.
mo-gill Jun 18, 2024
59991c3
#3074: Fix failing doc build.
mo-gill Jun 18, 2024
d29e76c
#3074: Add step to create branch and open issue.
mo-gill Jun 18, 2024
5569fb0
#3074: Add guidance on recipe names in flow.cylc.
mo-gill Jun 19, 2024
ac585d2
#3074: Add command to run RTW to docs.
mo-gill Jun 19, 2024
7b466c9
#3074: Attempt to correct indentation.
mo-gill Jun 19, 2024
404b0f8
#3074: Another attempt to fix indentation.
mo-gill Jun 19, 2024
a648f6a
#3074: Fixed sub bullet points.
mo-gill Jun 19, 2024
cd4d187
#3074: Correction to run RTW sentence.
mo-gill Jun 19, 2024
d9c4fc2
#3074: Add KGO documentation.
mo-gill Jun 19, 2024
0c4c284
#3074: Fix quotation of bullets.
mo-gill Jun 20, 2024
f707f0d
#3074: Use rst admonition.
mo-gill Jun 21, 2024
43c65f0
#3074: Add more admonitions.
mo-gill Jun 21, 2024
407017b
#3074: Correct cylc stop commands.
mo-gill Jun 21, 2024
18837ab
#3074: Add link to quick start guide.
mo-gill Jun 21, 2024
e26261b
#3074: Amend copy output instructions.
mo-gill Jun 21, 2024
a2d7dab
#3074: Consolidate enable write permissions instruction.
mo-gill Jun 21, 2024
2758b15
#3074: Add another link to quick start guide.
mo-gill Jun 21, 2024
90f970c
#3074: Add two sub-bullets.
mo-gill Jun 21, 2024
f14ea6c
#3074: amend KGO section in glossary.
mo-gill Jun 21, 2024
d302e86
#3074: Add example issue links.
mo-gill Jun 24, 2024
8863f6b
#3074: Restore compare task sentence.
mo-gill Jun 24, 2024
4cd1e16
#3074: Fix sentence.
mo-gill Jun 24, 2024
91384c9
#3074: Use reference-style links and add comment.
mo-gill Jun 24, 2024
63b93a1
#3074: Add to final instruction.
mo-gill Jun 24, 2024
50a6ecc
#3074: Rename referenced links.
mo-gill Jun 24, 2024
e9aae27
#3074: Remove comment about URLs.
mo-gill Jun 25, 2024
433e0b6
#3074: Hopefully final formatting changes to documentation
ehogan Jun 25, 2024
545ff13
#3074: Rename rst file
ehogan Jun 25, 2024
db84f25
#3074: Update index.rst to use the newly named rst file
ehogan Jun 25, 2024
23ce8d0
Merge branch 'recipe_test_workflow_prototype' into 3074_create_how_to…
ehogan Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions esmvaltool/utils/recipe_test_workflow/doc/source/add_a_recipe.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
How to add a recipe to the |RTW|
================================

.. include:: common.txt

.. note::
Before you follow these steps to add your recipe, you must be able to
successfully run the recipe with the latest version of ESMValTool on the
compute server you use at your site, as detailed by the ``platform`` option
in the ``[[COMPUTE]]`` section in the site-specific ``.cylc`` file in the
``esmvaltool/utils/recipe_test_workflow/recipe_test_workflow/site/``
directory.

#. Open a `new ESMValTool issue`_ on GitHub, assign yourself to the issue, and
add the ``Recipe Test Workflow (RTW)`` label to the issue, see
`ESMValTool issue #3663`_ for an example.

#. Create a branch.

#. Obtain the duration and memory usage of the recipe from the messages printed
to screen, or at the end of the ``run/main_log.txt`` file in the recipe
output directory after running your recipe on the compute cluster you use at
your site; these messages will look something like::

YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Time for running the recipe was: 0:02:13.334742
YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Maximum memory used (estimate): 2.4 GB
[...]
YYYY-MM-DD HH:MM:SS:sss UTC [12345] INFO Run was successful

#. Add the recipe to the ``[task parameters]`` section in the
``esmvaltool/utils/recipe_test_workflow/recipe_test_workflow/flow.cylc``
file.

.. hint::
If the recipe takes less than 10 minutes to run then it should be added
to the ``fast`` option. Recipes that take longer than ten minutes should
be added to the ``medium`` option.

.. hint::
The line added should follow the format of ``recipe_new_recipe, \``,
unless the line is the last one in the list, in which case the line added
should follow the format of ``recipe_new_recipe``.

#. If the duration of the recipe is larger than the value specified by the
``execution time limit`` option in the ``[[COMPUTE]]`` section in the
aforementioned site-specific ``.cylc`` file, and / or the memory usage of
the recipe is larger than the value specified by the ``--mem`` option in the
``[[[directives]]]`` section in the ``[[COMPUTE]]`` section, add a section
(in alphabetical order) to this file as shown below (round the duration to
the nearest second)::

[[process<fast=recipe_albedolandcover>]]
# Actual: 0m31s, 2.5 GB on 2024-04-08.
execution time limit = PT2M
[[[directives]]]
--mem = 3G

.. hint::
The ``fast`` key in the example task definition above
(``[[process<fast=recipe_albedolandcover>]]``) should match name of the
option the recipe was added to in the ``[task parameters]`` section in
the
``esmvaltool/utils/recipe_test_workflow/recipe_test_workflow/flow.cylc``
file

.. hint::
Set the ``execution time limit`` to 10-20% more than the actual duration.
For actual durations of up to ``1m45s``, set the ``execution time limit``
to ``PT2M`` (2 minutes).

.. hint::
Try not to regularly waste more than 500 MiB in memory usage. Typically,
rounding the actual memory usage up to the nearest integer is acceptable.

#. Stop any running ``recipe_test_workflow`` workflows::

cylc stop recipe_test_workflow/*

#. Run the |RTW|, as detailed in the
:doc:`Quick Start Guide <user_guide/quick_start>`; it is expected that the
``compare`` task will fail.

#. Update the Known Good Outputs (|KGOs|):

* Recursively copy the recipe output directory (i.e.
``recipe_<recipe>_<date>_<time>``) from the
``${HOME}/cylc-run/recipe_test_workflow/run1/share/cycle/<cycle>``
directory to your site-specific KGO directory, as detailed by the
``KGO_ROOT_PATH`` option in the site-specific ``.conf`` file in the
``esmvaltool/utils/recipe_test_workflow/recipe_test_workflow/opt/``
directory::

cp -r ${HOME}/cylc-run/recipe_test_workflow/run1/share/cycle/<cycle>/recipe_<recipe>_<date>_<time> <KGO_ROOT_PATH>

* Enable write permissions for all users on the recipe output directory in
your site-specific KGO directory::

chmod -R a+w <KGO_ROOT_PATH>/recipe_<recipe>_<date>_<time>

#. Stop any running ``recipe_test_workflow`` workflows::

cylc stop recipe_test_workflow/*

#. Run the |RTW| again, as detailed in the
:doc:`Quick Start Guide <user_guide/quick_start>`; the ``compare`` task
should now succeed.

#. Add the recipe to the documentation; add a link to the recipe to the list of
"Currently tested recipes" in ``doc/source/tested_recipes.rst`` in
alphabetical order:

* Add a link to the recipe in ``doc/source/common.txt`` under the
``.. Links`` section in alphabetical order (follow the format
``.. _<name>: <URL>``).

* Add the link to the list of "Currently tested recipes" in
``doc/source/tested_recipes.rst`` in alphabetical order (follow the
format ``* `<name>`_``).

#. Commit and push your changes, create a PR, assign yourself to the PR, and
add the Recipe Test Workflow (RTW) label to the PR, see
`ESMValTool PR #3664`_ for an example.
4 changes: 4 additions & 0 deletions esmvaltool/utils/recipe_test_workflow/doc/source/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.. |ESMs| replace:: :term:`ESMs <ESM>`
.. |ESMValCore| replace:: :term:`ESMValCore`
.. |ESMValTool| replace:: :term:`ESMValTool`
.. |KGOs| replace:: :term:`KGOs`
.. |Rose| replace:: :term:`Rose`

.. Links
Expand All @@ -19,9 +20,12 @@
.. _Cylc Review: https://cylc.github.io/cylc-doc/7.9.3/html/tutorial.html#viewing-suite-logs-in-a-web-browser-cylc-review
.. _Ensclus: https://docs.esmvaltool.org/en/latest/recipes/recipe_ensclus.html
.. _ESMValTool Documentation: https://esmvaltool.org/
.. _ESMValTool issue #3663: https://github.com/ESMValGroup/ESMValTool/issues/3663
.. _ESMValTool PR #3664: https://github.com/ESMValGroup/ESMValTool/pull/3664
.. _Examples python: https://docs.esmvaltool.org/en/latest/recipes/recipe_examples.html
.. _Heatwaves coldwaves: https://docs.esmvaltool.org/en/latest/recipes/recipe_heatwaves_coldwaves.html
.. _Landcover - Albedo: https://docs.esmvaltool.org/en/latest/recipes/recipe_albedolandcover.html#landcover-albedo
.. _new ESMValTool issue: https://github.com/ESMValGroup/ESMValTool/issues/new
.. _Ocean multimap: https://docs.esmvaltool.org/en/latest/recipes/recipe_oceans.html#recipe-ocean-multimap-yml
.. _Radiation budget: https://docs.esmvaltool.org/en/latest/recipes/recipe_radiation_budget.html
.. _Rose Documentation: https://metomi.github.io/rose/doc/html/index.html
2 changes: 1 addition & 1 deletion esmvaltool/utils/recipe_test_workflow/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# -- Project information -----------------------------------------------------

project = 'Recipe Test Workflow (RTW)'
project = 'RTW'
version = "0.1.0"

# -- General configuration ---------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions esmvaltool/utils/recipe_test_workflow/doc/source/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ Glossary
routine evaluation of |ESMs| in |CMIP|, see the
`ESMValTool Documentation`_.

KGOs
Known Good Outputs (KGOs) are outputs from an ESMValTool recipe that have
been confirmed (typically by a scientist) to be as expected. KGOs are used
in the compare task in the |RTW| to check whether any changes have been
introduced to the outputs from an ESMValTool recipe after changes are made
to either ESMValCore or ESMValTool.

Rose
Rose is a toolkit for writing, editing and running application
configurations, see the `Rose Documentation`_.
Expand Down
2 changes: 2 additions & 0 deletions esmvaltool/utils/recipe_test_workflow/doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ Welcome to the Recipe Test Workflow's documentation!
about
tested_recipes
user_guide/index.rst
add_a_recipe

glossary
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
UTC mode = True

[task parameters]
# `fast` recipes are those taking less than 10 mins.
# Other recipes should be included in `medium`.
ehogan marked this conversation as resolved.
Show resolved Hide resolved
# See "How to add a recipe to the RTW" documentation for more information.
# Recipe paths are specified relative to esmvaltool/recipes. For recipes in
# subdirectories, `--` stands for `/` since the latter is an illegal char.
fast = recipe_radiation_budget, \
Expand Down