Rose User Guide: Suite Control

Introduction

This chapter of the user guide discusses the Rose utilities for controlling and monitoring Rose/cylc suites.

rose suite-run

If you have been following this user guide, you will have used the rose suite-run command in previous chapters. In normal usage, the command sets up the environment of a Rose/cylc suite, installs and runs it. We shall discuss the detail in this section.

See Rose Reference Guide: CLI > rose suite-run for a full command reference.

See Rose Reference Guide: Configuration > Configuration Format for more information on the Rose configuration format.

See Rose Reference Guide: Configuration > Suite Configuration for more information on how to set up a Rose suite configuration.

Locations

The main functionality of rose suite-run is to install a suite from the configuration directory to its runtime location.

The configuration directory
This is set to $PWD by default, but can be modified using the --config=DIR or -C DIR option of the rose suite-run command.
The runtime location
This is $HOME/cylc-run/$NAME/ where $NAME is the name of the suite. The name of the suite is the base name of the configuration directory by default, but it can be modified using the --name=NAME or -n NAME option of the rose suite-run command. The same runtime location allows users to be able to easily look for their installed suites. It also allows for simple logic in Rose. However, Rose allows the actual root location of each $HOME/cylc-run/$NAME/ to be configured to suit the need for sites or users, which may have very little disk space in $HOME. In which case, $HOME/cylc-run/$NAME would become a symbolic link to the actual physical location. We'll discuss this functionality in more detail later in this section.

Install Items

What does rose suite-run install in the runtime location? Here is a list:

  • The runtime directory structure of the suite, including the log/, the share/, and the work/ directories. (See also Log Rotation and Configuring the Install Root Locations.)
  • Everything in the suite configuration directory, except hidden files and directories.
  • log/rose-conf/DATETIME-RUNMODE.conf <- log/rose-suite-run.conf A copy of the rose-suite.conf with any added optional configurations and command line settings set via --define=[SECTION]NAME=VALUE.
  • log/rose-conf/DATETIME-RUNMODE.version <- log/rose-suite-run.version Version control information file of the configuration directory. If the configuration directory is a Subversion working copy, the file would contain the output from svn info, svn status and svn diff. If the configuration is a Git clone, the file would contain the output from git describe, git status and git diff.
  • log/rose-suite-run.log The --verbose --verbose (or -v -v) output of the rose suite-run command.
  • log/rose-job-logs.db The job logs database for Rose Bush.
  • Any files specified in [file:*] sections of the rose-suite.conf file. (See Rose Reference Guide: Configuration > Appendix: File Creation Mode.) This functionality can be used to install essential files for the suite to start up. It can also be used to install files that are used on the majority of remote task hosts. For large files used only on specific tasks hosts, we would recommend against using this functionality. Instead, the suite should have a run-once (R1) task at the initial cycle point to install those files on the intended task hosts.
  • For suites with tasks running on an alternate host (or as a different user on localhost), rose suite-run will cylc register and cylc validate the suite before creating the runtime directory structure and mirroring its items to these alternate host.
  • log/rose-suite-run.locs Contains the configuration of the install root location on the suite host and any remote task job hosts. This file is used by rose suite-clean. (See Configuring the Install Root Locations.)

Install Modes

The rose suite-run command will normally install from the configuration directory into the runtime location incrementally. N.B. The command does not remove items that are not in the configuration directory but exist in the runtime locations.

If incremental mode is not desirable, the --new or -N option can be used to remove and re-create all runtime locations. N.B. the --new option is equivalent to running rose suite-clean -y && rose suite-run, so you may want to take extra care when using this option.

There are times when you only want to install the suite but not (re-)run it, (e.g. during development, for analysing its structure, or to modify an application configuration during runtime, etc), you can use the --install-only or -i option or even the --local-install-only or -l option. The former will stop after validating the suite and installing it to the task hosts. The latter will stop after validating the suite.

Environment and Jinja2 Settings

Environment variables defined in the [env] section of the rose-suite.conf file are exported to the environment before the [file:*] and [jinja2:*] sections of the rose-suite.conf file are processed, and before cylc run|restart|reload is invoked.

Settings defined in each [jinja2:FILE] section of the rose-suite.conf file are added to the header of the named FILE at installation time. The main use of this functionality is to modify the behaviour of cylc's suite.rc file with settings in the [jinja2:suite.rc] section at installation time.

In addition, the following settings are automatically exported to the environment and added to the [jinja2:suite.rc] section.

CYLC_VERSION
The current version of cylc.
ROSE_ORIG_HOST
The name of the host where the rose suite-run command was invoked.
ROSE_VERSION
The current version of Rose.

For example, if we add the following settings to rose-suite.conf:

[jinja2:suite.rc]
HELLO="Greeting"
WORLDS=["Earth", "Moon", "Mars"]

then the following example header will be added to the suite.rc file:

#!jinja2
{# Rose Configuration Insertion: Init #}
{% set CYLC_VERSION="5.4.5" %}
{% set HELLO="Greeting" %}
{% set ROSE_ORIG_HOST="alien" %}
{% set ROSE_VERSION="2013-12" %}
{% set WORLDS=["Earth", "Moon", "Mars"] %}
{# Rose Configuration Insertion: Done #}

Run Modes

The rose suite-run command has 3 run modes: run (default), restart and reload. The mode can be specified using the command line options --run=reload|restart|run, --restart or --reload.

In run and restart modes, rose suite-run checks that the suite is not already running on localhost and/or any suite hosts defined in the lists in the hosts and scan-hosts settings in the [rose-suite-run] section of the site/user configuration. In reload mode, it does the opposite, ensuring that the suite is already running on one of these hosts.

In run and restart mode, rose suite-run will ensure that the suite is registered with cylc. In all modes, it will then attempt to validate cylc's suite.rc file using cylc validate --strict. The --no-strict option can be used to switch off the --strict option to cylc validate.

Once the suite.rc file has been validated, rose suite-run will invoke cylc run, cylc restart or cylc reload. For run and restart mode, if the hosts setting in the [rose-suite-run] section in the site/user configuration is defined, rose suite-run will select a host according to the defined selection criteria to invoke cylc run|restart. In reload mode, rose suite-run will invoke cylc reload on the same host where the suite is still running.

If you need to pass extra options and arguments to the cylc run|restart|reload command, you can specify them on the command line like this:

rose suite-run -- --mode=simulation

In this example, --mode=simulation will be passed to cylc run.

On success, rose suite-run will launch the cylc gui to connect to the suite, unless the --no-gcontrol option is specified or the DISPLAY environment variable is not defined.

Log Rotation

In normal run mode, rose suite-run will create a log.DATETIME/ directory in the runtime location, and (re-)create the symbolic link log to point to it. The log.DATETIME/ directory from previous runs will then be compressed into a Tar-Gzip archive log.DATETIME.tar.gz, unless the --no-log-archive option is specified or if it is being pointed to by a symbolic link matching the glob log.* in the same directory.

Configuring the Install Root Locations

As discussed earlier in Locations, if $HOME/cylc-run/$NAME/ is not a suitable physical location for hosting the suite runtime files, (perhaps the disk does not have enough space or has poor performance), it is possible to configure the root of an alternate physical location using the top level setting root-dir=LIST in the suite's rose-suite.conf or the same setting under the [rose-suite-run] section of the Rose site/user configuration. The LIST should be a newline delimited list of PATTERN=DIR pairs. The PATTERN should be a glob-like pattern for matching a host name. The DIR should be the root directory to install a suite run directory to. E.g.:

In a rose-suite.conf file, it is a top level setting:

[]
root-dir=hpc*=$WORKDIR
        =*=$DATADIR

In a site/user configuration file, it is under [rose-suite-run]:

[rose-suite-run]
root-dir=hpc*=$WORKDIR
        =*=$DATADIR

In this example, invoking rose suite-run on a suite with name $NAME will create ~/cylc-run/$NAME as a symbolic link to $DATADIR/cylc-run/$NAME/ on any machine, except those with their hostnames matching hpc*. For those hosts, it will create ~/cylc-run/$NAME as a symbolic link to $WORKDIR/cylc-run/$NAME/.

In addition to the main suite directory, the share/, share/cycle/ and work/ sub-directories can also be configured using the settings root-dir{share}, root-dir{share/cycle}, and root-dir{work} respectively.

Rose Bush

Rose Bush presents the logs of your running or completed suites and the logs of their task jobs (e.g. STDOUT or STDERR) via a web interface. If Rose Bush is not already configured at your site, see Rose: Installation > Configuring Rose Bush on how to configure it. If you do not have the authority to do so, you should still be able to start an ad-hoc Rose Bush web server by typing:

/path/to/rose/bin/rose bush start [PORT]

If [PORT] is not specified, the default is 8080.

Once configured (or you have started an ad-hoc server), typing rose suite-log in a suite directory will launch Rose Bush on your web browser.

You can use Rose Bush to:

  • View the list of suites in your $HOME/cylc-run/ directory.
  • List the cycles in a suite.
  • List the jobs in a suite.
  • View suite log files.
  • View job log files, including those in cycle Tar-Gzip archives.
  • View suite logs of other users (if the Rose Bush server has read access to their $HOME/cylc-run/ directory.

Remember Rose Bush is not a monitoring tool, cylc gscan and cylc gpanel are designed for this and provide interactive tools to monitor and interrogate your suites. Rose Bush has been designed to view any suite provided it has access to the $HOME/cylc-run/ directory of a user. It also provides an aesthetically pleasing and user friendly web view of the suites files including:

  • rose suite run logs, such as log/rose-suite-run.conf, log/rose-suite-run.version.
  • cylc suite logs, such as log/suite/err, log/suite/log, log/suite/out.
  • cylc task job logs, such as log/job/CYCLE/TASK/NN/* (where CYCLE, TASK, NN are cycle points, task names and submit numbers). Files with a sequential pattern *.NNN.* (where NNN can be a string or numeric index) will be grouped together for easier navigation.

It allows you to filter the Display Options using the tool provided in a drop down section for example by Task names globs, Cycle globs, etc or by cycles list or jobs list.

To invoke Rose Bush in the suite directory: E.g.:

rose suite-log

or

rose slv

rose suite-log

Invoking this command launches a web browser to display the logs of a running or stopped suite in Rose Bush.

If run with the --update option this synchronises logs between the various filesystems that the suite has run jobs on and the suite host. This is useful if cylc has been unable to retrieve a log on job completion.

See Rose Reference Guide: CLI > rose suite-log for more information.

rose suite-gcontrol

Or rose sgc. A convenient way to launch cylc gui. In the absence of arguments, the command assumes that the base name of the current directory is the name of the suite you want to launch cylc gui on.

See Rose Reference Guide: CLI > rose suite-gcontrol for more information.

rose suite-scan

A wrapper of cylc scan. The command scans for your running suites in the dedicated suite hosts as specified by the Rose site/user configuration.

See Rose Reference Guide: CLI > rose suite-scan for more information.

rose suite-shutdown

Or rose suite-stop. A convenient way to run cylc shutdown. In the absence of arguments, the command assumes that the base name of the current directory is the name of the suite you want to run cylc shutdown on. If your suite is running on a dedicated suite host as specified by the Rose site/user configuration, it will automatically connect to the suite at the correct host.

See Rose Reference Guide: CLI > rose suite-shutdown for more information.

rose suite-clean

This command correctly removes items created by rose suite-run, including items on task job hosts and actual run locations under alternate disks. In the absence of arguments, the command assumes that base name of the current directory is the name of the suite you want to clean. It checks that the suite is not running before doing any removal.

See Rose Reference Guide: CLI > rose suite-clean for more information.