Skip to content

tmtsoftware/sequencer-scripts

Repository files navigation

Sequencer Script

This repo contains subsystem specific sequencer scripts.

Version Compatibility

sequencer-scripts esw csw
v0.4.0 v0.4.0 v4.0.1
v0.4.0-RC1 v0.4.0-RC1 v4.0.1-RC1
v0.3.0 v0.3.0 v4.0.0
v0.3.0-RC2 v0.3.0-RC2 v4.0.0-RC2
v0.3.0-RC1 v0.3.0-RC1 v4.0.0-RC1
v0.3.0-M1 v0.3.0-M1 v4.0.0-M1
v0.2.0 v0.2.1 v3.0.1
v0.2.0-RC1 v0.2.0-RC1 v3.0.0-RC1
v0.2.0-M1 v0.2.0-M1 v3.0.0-M1
v0.1.0 v0.1.0 v2.0.0
v0.1.0-RC3 v0.1.0-RC3 v2.0.0-RC3
v0.1.0-RC2 v0.1.0-RC2 v2.0.0-RC2
v0.1.0-RC1 v0.1.0-RC1 v2.0.0-RC1

Adding new scripts

sequencer-scripts repo is restricted and limited people have admin access to make changes to master and merge pull requests.

Script writers should follow steps mentioned below to add/update scripts

  1. Fork sequencer-scripts repo

    1. One can fork it to their personal repository and keep working on that fork
    2. Or fork it under your own organization
  2. Add new scripts intoscripts directory under specific subsystem. If your subsystem doesn't exist, create a directory with the name of your subsystem in the scripts directory, e.g. scripts/wfos. Also add an observing mode mapping configuration file to provide a mapping from observing modes to scripts in your new directory named your subsystem with the .conf extension, e.g. scripts/wfos/wfos.conf. Then, include the new configuration file in the scripts/application.conf, for example, if you have newly created scripts/wfos/wfos.conf, then add line include "wfos/wfos.conf" in scripts/application.conf file

  3. Add an entry for each observing mode into the subsystem-specific observing mode mapping configuration. It should include a scriptClass property pointing to script file where script logic resides, for example,

      scripts {
        iris {
          IRIS_darknight {
            scriptClass = iris.Darknight
          }
        }
      }

    Note: the same script class can be used for multiple observing modes.

  4. Once all the changes are completed in a forked repo, then you can submit a pull request to upstream which is tmtsoftware/sequencer-scripts repo in this case

  5. Admins of sequencer-scripts repo will then review changes and merge it to master

Running script

Prerequisite

The CSW services need to be running before starting the components. This is done by starting the csw-services If you are not building csw from the sources, you can run csw-services as follows:

  • Install coursier using steps described here and add TMT channel.
  • Run cs install csw-services. This will create an executable file named csw-services in the default installation directory.
  • Run csw-services --help to get more information.
  • Run csw-services start to start all the csw services, for example, Location, Config, Alarm, AAS service etc

Running Sequencer App with script

  1. Run sbt command at root level of this repo

  2. Within the sbt shell, run following command which will read scripts.Subsystem.Observing_Mode.scriptClass configuration and start that script.

        run sequencer -s <Subsystem> -m <Observing_Mode>

    Please note that configuration for IRIS (subsystem) and IRIS_darknight (observing mode) should be there in config file.

    For example, following command will start IRIS IRIS_darknight script i.e. Darknight.kts script Confiuration for this exist in iris.conf file under iris scripts folder.

        run sequencer -s IRIS -m IRIS_darknight
  3. At this stage, your Sequencer will be started with provided script and waiting for Sequence to be received for execution

Submitting Sequence to Sequencer

Once you have started Sequencer with appropriate script, next step would be to submit a Sequence to the Sequencer for execution.

Use esw-shell to do this and more which has detailed documentation on how to submit sequence to sequencer.