Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d94202e
Rename test_install_workflow.py to test_extract_workflow.py
jfrost-mo Jul 17, 2026
809cd31
Document return value of CSET.extract_workflow.install_workflow
jfrost-mo Jul 17, 2026
7ce597b
Port install_restricted_files.sh into python
jfrost-mo Jul 6, 2026
c155a82
Add cset install-restricted-files subcommand
jfrost-mo Jul 6, 2026
1f6b146
Update documentation to use 'cset install-restricted-files' command
jfrost-mo Jul 7, 2026
5535832
Remove test reference to install_restricted_files.sh
jfrost-mo Jul 8, 2026
33eca29
Test list_refs and clone_ref
jfrost-mo Jul 17, 2026
098c822
Test install_restricted_files
jfrost-mo Jul 17, 2026
09d4f61
Test command line interface for extracting restricted files
jfrost-mo Jul 17, 2026
81a4510
Explicitly set git commit author
jfrost-mo Jul 17, 2026
c260c0f
Document dependency on Git
jfrost-mo Jul 17, 2026
e85323e
Update error message on failed clone
Fraetor Jul 17, 2026
ad41149
Copy environment dict before modification
Fraetor Jul 17, 2026
aa2f7c4
Unconditionally unlink README
Fraetor Jul 17, 2026
5dc4c34
Correct docstring for install_restricted_files
Fraetor Jul 17, 2026
276a4ba
Tweak release branch derivation warning
Fraetor Jul 17, 2026
4f1e5fe
Install restricted files during make setup
Fraetor Jul 17, 2026
8d5d26b
Return correct exception from unpack_recipe
Fraetor Jul 17, 2026
5bc7d9d
Add test for CLI for test install_restricted_files
Fraetor Jul 17, 2026
f37a3df
Print success message after installing restricted files
jfrost-mo Jul 18, 2026
4858508
Install restricted files in default command in tutorial
jfrost-mo Jul 20, 2026
061b7c3
Add URL to install_restricted_files error message
jfrost-mo Jul 20, 2026
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ conda: prepare-lockfiles
# Prevent pip from accessing the network; we have everything in our conda env.
setup: conda .git/hooks/pre-commit ## Setup development environment.
${CONDA_EXE} run -n cset-dev pip install --no-deps --no-index --no-build-isolation --editable .
${CONDA_EXE} run -n cset-dev cset install-restricted-files src/CSET/cset_workflow || true
@echo "Run '${CONDA_EXE} activate cset-dev' to use conda environment."

docs: ## Build documentation.
Expand Down
1 change: 0 additions & 1 deletion docs/source/contributing/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ src/CSET/cset_workflow
├── site # Site-specific cylc configuration.
│   └── localhost.cylc
├── flow.cylc # Workflow definition detailing how tasks are run.
├── install_restricted_files.sh # Script for installing site-specific files.
├── README.md
├── rose-suite.conf # User configuration of workflow and diagnostics.
└── rose-suite.conf.example # Blank user configuration to be copied.
1 change: 1 addition & 0 deletions docs/source/contributing/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ requirements that must be installed separately.
* conda - Used for managing the conda environment. Alternatively mamba or micromamba can be used.
* cylc 8 - Used for running the workflow. As it typically requires significant site integration it is not installed with CSET.
* GNU find - We use the ``-printf`` option that is GNU specific.
* Git - Used for installing the restricted files, but not needed during runtime.

Requirements of a new dependency
--------------------------------
Expand Down
21 changes: 14 additions & 7 deletions docs/source/getting-started/run_full_cylc_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,19 @@ With the newly created conda environment activated, run the ``cset
extract-workflow`` command to unpack the workflow from inside the CSET package
into a directory of your choosing. A sensible choice is ``~/cylc-src``, which is
the default location where cylc will search for workflows.
If you are at a Momentum® Partnership site with restricted site specific files
you should also include the ``--restricted`` flag to install them.

.. code-block:: bash

# Create the cylc-src directory if it doesn't exist.
mkdir -p ~/cylc-src

# Extract the workflow from CSET into the chosen directory.
cset extract-workflow ~/cylc-src
# Alternatively install the restricted site-specific files at Momentum sites.
cset extract-workflow --restricted ~/cylc-src # Momentum Partners.
cset extract-workflow ~/cylc-src # Everyone else.

# Change into the freshly unpacked workflow directory.
cd ~/cylc-src/cset-workflow-vX.Y.Z

Expand All @@ -86,18 +92,19 @@ Your directory should look like this:
.. code-block:: bash

$ ls
app conda-environment includes lib opt rose-suite.conf.example
bin flow.cylc install_restricted_files.sh meta README.md site
app conda-environment includes meta README.md site
bin flow.cylc lib opt rose-suite.conf.example

If you are at a site with specific CSET integration, such as the Met Office or
Momentum Partnership, you will want to install the site specific configuration
Momentum Partnership, and did not use the ``--restricted`` option to ``cset
extract-workflow`` you will want to install the site specific configuration
files that specify where cylc will run the tasks. This is done by running the
``install_restricted_files.sh`` script. For other users, you can skip this step
and use the ``localhost`` site instead.
``cset install-restricted-files`` command. For other users, you can skip this
step and use the ``localhost`` site instead.

.. code-block:: bash

./install_restricted_files.sh
cset install-restricted-files /path/to/workflow

You have now installed the CSET workflow and are ready to use it.

Expand Down
36 changes: 33 additions & 3 deletions docs/source/reference/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,40 @@ usage see :doc:`/getting-started/run_full_cylc_workflow`.

.. code-block:: text

usage: cset extract-workflow [-h] location
usage: cset extract-workflow [-h] [--restricted]
[--restricted-url RESTRICTED_URL]
location

positional arguments:
location directory to save workflow into
location directory to save workflow into

options:
-h, --help show this help message and exit
-h, --help show this help message and exit
--restricted install restricted site-specific files during
extraction
--restricted-url RESTRICTED_URL
Alternative Git URL to fetch the restricted files
from. If omitted, defaults to trying to clone first
from 'localmirrors:', then from GitHub via SSH and
HTTPS.

cset install-restricted-files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Download and install restricted site-specific files into the CSET workflow.

.. code-block:: text

usage: cset install-restricted-files [-h] [--restricted-url RESTRICTED_URL]
location

positional arguments:
location directory containing workflow

options:
-h, --help show this help message and exit
--restricted-url RESTRICTED_URL
Alternative Git URL to fetch the restricted files
from. If omitted, defaults to trying to clone first
from 'localmirrors:', then from GitHub via SSH and
HTTPS.
4 changes: 2 additions & 2 deletions docs/source/usage/add-site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ add your site file.
If you would prefer to keep your site-specific configuration non-public, and are
a Momentum Partnership member, we have a designated `CSET site-specific config
repository`_ that contains these configurations for various Momentum Partners.
It is this repository that is installed via the ``install_restricted_files.sh``
script. Even when your file remains restricted like this you should still
It is this repository that is installed via ``cset install-restricted-files``.
Even when your file remains restricted like this you should still
contribute your rose metadata changes to the `main CSET GitHub repository`_ so
your site shows up as an option to users.

Expand Down
46 changes: 43 additions & 3 deletions src/CSET/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © Crown copyright, Met Office (2022-2025) and CSET contributors.
# © Crown copyright, Met Office (2022-2026) and CSET contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -169,8 +169,40 @@ def setup_argument_parser() -> argparse.ArgumentParser:
parser_extract_workflow.add_argument(
"location", type=Path, help="directory to save workflow into"
)
parser_extract_workflow.add_argument(
"--restricted",
action="store_true",
help="install restricted site-specific files during extraction",
)
parser_extract_workflow.add_argument(
"--restricted-url",
type=str,
help=(
"Alternative Git URL to fetch the restricted files from. "
"If omitted, defaults to trying to clone first from "
"'localmirrors:', then from GitHub via SSH and HTTPS."
),
)
parser_extract_workflow.set_defaults(func=_extract_workflow_command)

parser_install_restricted_files = subparsers.add_parser(
"install-restricted-files",
help="download and install restricted site-specific files for the CSET cylc workflow",
)
parser_install_restricted_files.add_argument(
"location", type=Path, help="directory containing workflow"
)
parser_install_restricted_files.add_argument(
"--restricted-url",
type=str,
help=(
"Alternative Git URL to fetch the restricted files from. "
"If omitted, defaults to trying to clone first from "
"'localmirrors:', then from GitHub via SSH and HTTPS."
),
)
parser_install_restricted_files.set_defaults(func=_install_restricted_files_command)

return parser


Expand Down Expand Up @@ -256,6 +288,14 @@ def _cookbook_command(args, unparsed_args):


def _extract_workflow_command(args, unparsed_args):
from CSET.extract_workflow import install_workflow
from CSET.extract_workflow import install_restricted_files, install_workflow

workflow_dir = install_workflow(args.location)
if args.restricted:
install_restricted_files(workflow_dir, args.restricted_url)


def _install_restricted_files_command(args, unparsed_args):
from CSET.extract_workflow import install_restricted_files

install_workflow(args.location)
install_restricted_files(args.location, args.restricted_url)
86 changes: 0 additions & 86 deletions src/CSET/cset_workflow/install_restricted_files.sh

This file was deleted.

Loading