diff --git a/rose-stem/flow.cylc b/rose-stem/flow.cylc index c206f9a..f968aa7 100644 --- a/rose-stem/flow.cylc +++ b/rose-stem/flow.cylc @@ -30,7 +30,7 @@ {% set SITE_VARS = {} %} {#- Import variable definitions #} -%include 'include/variables.rc' +%include 'include/variables.cylc' [scheduler] UTC mode = True @@ -42,14 +42,14 @@ stall handlers = "suite_report_git.py -S $CYLC_WORKFLOW_RUN_DIR" {#- Import any Cylc task parameters #} -%include 'include/parameters.rc' +%include 'include/parameters.cylc' {#- Import the dependency graphs for the available jobs and groups #} -%include 'include/graph.rc' +%include 'include/graph.cylc' [scheduling] {#- Import any queues #} -%include 'include/queues.rc' +%include 'include/queues.cylc' [[graph]] R1 = """ @@ -103,5 +103,5 @@ export FCM_VERSION={{FCM_VERSION}} {% endfor %} {#- Import family and job definitions #} -%include 'include/runtime.rc' -%include 'runtime-common.rc' +%include 'include/runtime.cylc' +%include 'runtime-common.cylc' diff --git a/rose-stem/include/graph.rc b/rose-stem/include/graph.cylc similarity index 82% rename from rose-stem/include/graph.rc rename to rose-stem/include/graph.cylc index a8c18e9..977be57 100644 --- a/rose-stem/include/graph.rc +++ b/rose-stem/include/graph.cylc @@ -5,7 +5,7 @@ ############################################################################### {% if SITE == 'meto' %} -%include 'include/meto/graph.rc' +%include 'include/meto/graph.cylc' {% elif SITE == 'vm' %} -%include 'include/vm/graph.rc' +%include 'include/vm/graph.cylc' {% endif %} diff --git a/rose-stem/include/meto/graph.rc b/rose-stem/include/meto/graph.cylc similarity index 100% rename from rose-stem/include/meto/graph.rc rename to rose-stem/include/meto/graph.cylc diff --git a/rose-stem/include/meto/queues.rc b/rose-stem/include/meto/queues.cylc similarity index 100% rename from rose-stem/include/meto/queues.rc rename to rose-stem/include/meto/queues.cylc diff --git a/rose-stem/include/meto/runtime.rc b/rose-stem/include/meto/runtime.cylc similarity index 90% rename from rose-stem/include/meto/runtime.rc rename to rose-stem/include/meto/runtime.cylc index 14e2bc0..662cc97 100644 --- a/rose-stem/include/meto/runtime.rc +++ b/rose-stem/include/meto/runtime.cylc @@ -16,7 +16,7 @@ # Redefine site-independent SCRIPTS group -# (normally found in runtime-common.rc, Done to enforce loading of +# (normally found in runtime-common.cylc, Done to enforce loading of # scitools when running on MONSooN ; Python 3 is req'd by UMDP3 checker) [[SCRIPTS]] inherit = None, METO_AZSPICE diff --git a/rose-stem/include/parameters.rc b/rose-stem/include/parameters.cylc similarity index 65% rename from rose-stem/include/parameters.rc rename to rose-stem/include/parameters.cylc index a5a0a31..acaf661 100644 --- a/rose-stem/include/parameters.rc +++ b/rose-stem/include/parameters.cylc @@ -1,5 +1,5 @@ # Import site-specific parameter sets # {% if SITE == 'niwa' %} -# %include 'include/niwa/parameters.rc' +# %include 'include/niwa/parameters.cylc' # {% endif %} \ No newline at end of file diff --git a/rose-stem/include/queues.rc b/rose-stem/include/queues.cylc similarity index 56% rename from rose-stem/include/queues.rc rename to rose-stem/include/queues.cylc index 21c00ba..39cba7a 100644 --- a/rose-stem/include/queues.rc +++ b/rose-stem/include/queues.cylc @@ -1,7 +1,7 @@ # Import site-specific queues {% if SITE == 'meto' %} -%include 'include/meto/queues.rc' +%include 'include/meto/queues.cylc' {% elif SITE == 'vm' %} -%include 'include/vm/queues.rc' +%include 'include/vm/queues.cylc' {% endif %} diff --git a/rose-stem/include/runtime.rc b/rose-stem/include/runtime.cylc similarity index 90% rename from rose-stem/include/runtime.rc rename to rose-stem/include/runtime.cylc index 8a00688..2cca5fb 100644 --- a/rose-stem/include/runtime.rc +++ b/rose-stem/include/runtime.cylc @@ -8,11 +8,12 @@ [[SOURCE_EXTRACTION]] post-script = """ +mkdir $CYLC_WORKFLOW_RUN_DIR/bin/ cp $SOURCE_DIRECTORY/ukca/dependencies.yaml $CYLC_WORKFLOW_RUN_DIR -cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/suite_report_git.py $CYLC_WORKFLOW_RUN_DIR/bin -cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/suite_data.py $CYLC_WORKFLOW_RUN_DIR/bin -cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/git_bdiff.py $CYLC_WORKFLOW_RUN_DIR/bin -cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/get_git_sources.py $CYLC_WORKFLOW_RUN_DIR/bin +cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/suite_report_git.py $CYLC_WORKFLOW_RUN_DIR/bin/ +cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/suite_data.py $CYLC_WORKFLOW_RUN_DIR/bin/ +cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/git_bdiff.py $CYLC_WORKFLOW_RUN_DIR/bin/ +cp $SOURCE_DIRECTORY/SimSys_Scripts/github_scripts/get_git_sources.py $CYLC_WORKFLOW_RUN_DIR/bin/ """ [[[environment]]] ROSE_TASK_APP = extract_source @@ -58,7 +59,7 @@ rsync -avz --exclude=".*" $SOURCE_DIRECTORY/* $hostname:$RELATIVE_SOURCE_DIRECTO ## Site-specific runtime definitions ############################################################################### {% if SITE == 'meto' %} -%include 'include/meto/runtime.rc' +%include 'include/meto/runtime.cylc' {% elif SITE == 'vm' %} -%include 'include/vm/runtime.rc' +%include 'include/vm/runtime.cylc' {% endif %} diff --git a/rose-stem/include/variables.rc b/rose-stem/include/variables.cylc similarity index 100% rename from rose-stem/include/variables.rc rename to rose-stem/include/variables.cylc diff --git a/rose-stem/include/vm/graph.rc b/rose-stem/include/vm/graph.cylc similarity index 100% rename from rose-stem/include/vm/graph.rc rename to rose-stem/include/vm/graph.cylc diff --git a/rose-stem/include/vm/queues.rc b/rose-stem/include/vm/queues.cylc similarity index 100% rename from rose-stem/include/vm/queues.rc rename to rose-stem/include/vm/queues.cylc diff --git a/rose-stem/include/vm/runtime.rc b/rose-stem/include/vm/runtime.cylc similarity index 87% rename from rose-stem/include/vm/runtime.rc rename to rose-stem/include/vm/runtime.cylc index caec87f..cc849c4 100644 --- a/rose-stem/include/vm/runtime.rc +++ b/rose-stem/include/vm/runtime.cylc @@ -1,5 +1,5 @@ # Redefine site-independent SCRIPTS group -# (normally found in runtime-common.rc) +# (normally found in runtime-common.cylc) # Need to use python3 for this script [[SCRIPTS]] inherit = None, LINUX diff --git a/rose-stem/lib/python/read_sources.py b/rose-stem/lib/python/read_sources.py index a651ea7..5028716 100644 --- a/rose-stem/lib/python/read_sources.py +++ b/rose-stem/lib/python/read_sources.py @@ -1,3 +1,9 @@ +############################################################################## +# (c) Crown copyright 2025 Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +############################################################################## + import yaml import tempfile import os @@ -13,7 +19,7 @@ def get_dependencies_file(wc_loc): tempdir = tempfile.mkdtemp() try: - host, path = wc_loc.split(":") + host, path = wc_loc.split(":", 1) path = os.path.join(path, "dependencies.yaml") copy_command = f"scp -o StrictHostKeyChecking=no {host}:" except ValueError: diff --git a/rose-stem/lib/python/utils.py b/rose-stem/lib/python/utils.py index 8aa4b11..2f8c3d6 100644 --- a/rose-stem/lib/python/utils.py +++ b/rose-stem/lib/python/utils.py @@ -1,3 +1,9 @@ +############################################################################## +# (c) Crown copyright 2025 Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +############################################################################## + from subprocess import Popen, PIPE @@ -8,4 +14,7 @@ def get_site(): out, _ = proc.communicate() if proc.returncode or "SITE" not in out: raise Exception('Could not determine the rose-stem "SITE"') - return out.replace("SITE=", "").strip() + # At some sites there may be many variables that are returned by rose config rose-stem + # Try to just grab the thing after SITE= and then ignore anything afterwards + site = out.split("SITE=")[1].split(' ')[0].strip() + return site diff --git a/rose-stem/runtime-common.rc b/rose-stem/runtime-common.cylc similarity index 100% rename from rose-stem/runtime-common.rc rename to rose-stem/runtime-common.cylc