Running a Sequencer Using esw-ocs-app
The esw-ocs-app is a command line application that facilitates starting a Sequence Component and/or Sequencer using the coursier dependency management application. The coursier tool is described with full documentation at the coursier site.
Prerequisites for Running esw-ocs-app
The following steps should be followed to use esw-ocs-app to start a Sequencer or Sequence Component.
1. Install coursier and the TMT Apps Channel
The coursier application must be installed on your machine, and the OCS Apps channel must be installed. The instructions for doing this is provided here.
2. Install esw-ocs-app
The following command creates an executable file named esw-ocs-app in the default installation directory.
cs install esw-ocs-app
One can specify an installation directory like the following:
cs install \
--install-dir /tmt/apps \
esw-ocs-app
If you don’t provide the version or SHA in the above command, esw-ocs-app will be installed with the latest tagged binary of esw-ocs-app
3. Start Any Needed CSW Services
- To run Sequencers and Sequence Components, the CSW Location Service must be running.
- Any other CSW Services needed by scripts should also be running.
Information on starting CSW services is here
4. Run esw-ocs-app
Supported Commands
- seqcomp - starts sequence component
- sequencer - starts sequence components and sequencer in single command
Starting a Sequence Component
esw-ocs-app spawns a new Sequence Component with a provided subsytem and name. Note that with this command, only a sequence component is spawned, not a sequencer. A separate loadScript command needs to be sent to the sequence component to spawn a sequencer inside it.
Options accepted by this command are described below:
-s: subsystem of the sequence component, for e.g.tcs,irisetc-n,--name: optional name for sequence component, for e.g.primary,backupetc-a:--agent-prefixoptional argument: agentPrefix on which sequence component will be spawned, for e.g.ESW.agent1,IRIS.agent2etc
Here are some examples.
Example 1: Starts a Sequence Component with a name
//cd to installation directory
cd /tmt/apps
//start sequence component with specified name
./esw-ocs-app seqcomp -s tcs -n primary
Example 2: Starts a Sequence Component without a name
//cd to installation directory
cd /tmt/apps
//start sequence component without name argument.
./esw-ocs-app seqcomp -s tcs
If the Sequence Component name is not specified, a new name (prefixed with subsystem) will be generated for the Sequence Component. For e.g. TCS_123, IRIS_123 Refer to supported arguments section or ./esw-ocs-app start --help for starting esw-ocs-app with specific arguments
Starting a Sequencer
When starting a Sequencer, esw-ocs-app spawns two things:
- Sequence Component: with provided
subsystem,name - Sequencer: with provided
observing modeandsubsystemof sequencer (-ioption) if specified or elsesubsystemof sequence component (-soption) or variation of the sequencer(-voption)
Options accepted by this command are described below:
-s: subsystem of the sequence component, for e.g.tcs,irisetc.-n,--name: optional name for sequence component, for e.g.primary,backupetc.-a,--agent-prefix: optional argument: agentPrefix on which sequence component will be spawned, for eg:ESW.agent1,IRIS.agent2etc-i: optional subsystem of sequencer script, for e.g.tcs,irisetc. Default value: subsystem provided by-soption.-m,--obs-mode: observing mode, for e.g.darknight-v,--variation: optional variation part of the sequencer prefix for eg: Sequencer Prefix(IRIS.IRIS_ImagerAndIFS.IRIS_IFS),IRIS_IFSneeds to be provided as variation
The following command examples start both a Sequence Component and Sequencer:
Example 1: Start a Sequencer with TCS darknight observing mode
//cd to installation directory
cd /tmt/apps
//Below example will spawn a Sequence Component called `OCS.primary` and a Sequencer `TCS.darknight` in it.
./esw-ocs-app sequencer -s ocs -n primary -i tcs -m darknight
Example 2: Start the IRIS-darknight Sequencer on an IRIS Sequence Component
//cd to installation directory
cd /tmt/apps
//Example below will spawn a Sequence Component `IRIS-primary` and a Sequencer `IRIS-darknight` in it.
./esw-ocs-app sequencer -s iris -n primary -m darknight
Example 3: Start the IRIS-darknight Sequencer on an IRIS Sequence Component with a variation of red
//cd to installation directory
cd /tmt/apps
//Example below will spawn a Sequence Component `IRIS-primary` and a Sequencer `IRIS-ImagerAndIFS` in it with variation as red
./esw-ocs-app sequencer -s iris -a IRIS.agent1 -n primary -i iris -m IRIS_ImagerAndIFS -v red
Refer supported arguments section or ./esw-ocs-app start --help for starting esw-ocs-app with specific arguments.
Setting the Default Log Level
The default log level for any component is specified in the application.conf file of the component. In this case, the Sequence Component is shared code among all Sequencers. Therefore, to specify a log level for your Sequencer, use the java -J-D option to override configuration values at runtime. For log level, the format is:
-J-Dcsw-logging.component-log-levels.<Prefix>=<LEVEL>
For example, using the example above:
//cd to installation directory
cd /tmt/apps
// run sequencer iris.darknight on iris.primary sequence component
./esw-ocs-app -J-Dcsw-logging.component-log-levels.IRIS.darknight=TRACE sequencer -s iris -n primary -m darknight