Hi @bpabla50
,
Distributed Installation
Cylc is a distributed system.
You can run a Cylc workflow locally, and have it run all of it’s jobs locally, in which case you could just pixi run cylc vip my-workflow and away you go.
However, for distributed deployments where workflows are submitting jobs to remote platforms / batch systems, it is necessary to install Cylc in multiple places and find a way to intercept cylc command calls so you can redirect them towards your Cylc deployment(s).
This “interception” is done using a “wrapper script”. Various tools use/create them, including Pixi.
Wrapper Scripts
If you’re deploying Cylc via Pixi, then a basic “wrapper script” might look like this (untested!):
#!/bin/sh
exec pixi run cylc "$@"
You would name this script cylc and place it in a directory which is included in the default $PATH. That way any cylc call from any regular shell will be directed via this command, which invokes it via the Pixi environment.
This is a basic example of a wrapper script. In addition to Cylc, you may also require wrapper scripts for the rose and isodatetime commands if you are using them in your workflows.
The Cylc Wrapper Script
Distributed Cylc deployments are a common practice, so we have written a wrapper script which is designed to cater to most circumstances.
The Cylc wrapper script:
- Can support multiple parallel Cylc installations (which means you can install new Cylc versions without breaking running workflows). Switch between them using the
CYLC_VERSION environment variable.
- Can work with Conda/Mamba environments or Python virtual environments.
- Handles some issues you might face if writing a wrapper script yourself.
- Doesn’t activate the environment, or use commands like
conda run / pixi run (which active environments implicitly). This is actually the correct way to do it with Cylc because activating the environment would cause background jobs to run within it which is generally undesireable.
There are some details in the installation guide in the documentation:
Go through the comments at the top of the file and adjust any variables as necessary, then stick the script somewhere in $PATH and you’re done. If necessary, make a copies of the wrapper script called rose and isodatetime in the same directory.
The CYLC_HOME_ROOT variable should point at the directory which contains your Pixi Cylc environments (name them cylc-<cylc-version> to enable version switching).
For example, if you get this:
$ cylc version --long
8.6.4 (/site/apps/cylc-8.6.4-2/bin/cylc)
Then you would set:
CYLC_HOME_ROOT=/site/apps
We haven’t yet added explicit support for Pixi environments in this script yes, however, I suspect these are really just Conda environments in disguise so our existing support will probably work.
If Pixi installs cylc using a different directory pattern to:
$CYLC_HOME_ROOT/cylc-<version>/bin/cylc
Let us know what it is, and we’ll guide you through adapting the wrapper script.