The individual CCDs and their larger aggregates in the form of RTMs undergo a series of tests. These tests are broken down into atomic jobs (aka "work processes"). Only parts of tests that are implemented by running a software program are considered in this note. The note describes a job harness which controls the execution of these jobs.
The terms used in this note are defined.
The job harness ties together the LIMS, the running of individual job implementations and their result files. It enforces a uniform interface between LIMS and the jobs and between jobs and the file archive. It hides unneeded details of invoking a job from an operator.
The role of the job harness is described by breaking down the cycle of executing one job.
A cycle starts by determining the input parameters to a job. A these parameters include:
It is outside the scope of this document to state how the values of these input parameters will be determined however it is expected that they will ultimately be derived from a LIMS database query.
The harness is implemented in Python and can be invoked as a command line program or as part of a larger Python program.
The job environment is built in three steps. It is initialized from the environment from which the harness is invoked (FIXME: should we limit this?) to which variables are added to expose the input parameters:
LCATR_UNITLCATR_UNIT_IDLCATR_JOBLCATR_VERSIONThe environment is then amended to use environment Modules (see http://modules.sf.net/) and to load the module specific for the given job. Details of this step are described in the note on "Describing LSST Sensor Test Software Environment with Modules". The module loaded is determined by the canonical name and version given as input parameters. If loading fails the harness aborts.
Every job has an associated, unique identifier. This identifier is allocated from LIMS based input parameters described above and these additional items:
USER).
The allocation is done by making an HTTP query on the LIMS web front end. The query supplies the these parameters and returns the allocation in the form of an HTML file containing the job identifier.
Some jobs require that the output files of prior jobs are available as input. The harness resolves these dependencies by a call to a LIMS web service1 in much the same was as the job identifier is allocated. The query returns the previously registered input parameters and associated job ID for all successfully completed jobs on which the current one depends. In the case where multiple jobs of any type have been run it is up to LIMS to determine which one shall provide the input to the current job.
Based on the allocated job ID and any input dependencies the job environment is updated to include variables of the form:
LCATR_OUTDIRLCATR_<dep>_OUTDIR<dep>.
The local stage file system is checked to assure that LCATR_OUTDIR
does not exist. The archive is checked for the existence of all
LCATR_<dep>_OUTDIR directories. If these checks fail the harness
aborts.
The LCATR_<dep>_OUTDIR directories are copied from the archive to
a corresponding location on the local stage and the LCATR_OUTDIR
directory is created and becomes the harness's current working directory.
The production program, as specified by the LCATR_JOB_PRODUCER
environment variable, is executed. Standard output and error are
logged. If the returns a failure code (non-zero) the harness aborts.
The validation program, as specified by the LCATR_JOB_VALIDTOR
environment variable, is executed. The validator is expected to
perform the following tasks:
Standard output and error are logged. If the returns a failure code (non-zero) the harness aborts.
The contents of the current directory are copied into LCATR_OUTDIR
rooted at the archive.
At exit the job harness notifies LIMS about the completion of the job by making a web service call that includes the following information:
Files in the stage are removed.
Details of each step are given in the following subsections.
An instance of a job harness may be configured from a variety of sources: environment, configuration files or explicit arguments. The parameters are resolved in four steps:
[DEFAULT] will update the configuration.
Specifics of each configuration step are given in the following sections.
Configuration parameters may be specified with environment variables.
Their names should be constructed by the capitalized parameter name
with {{{envprefix}}}.
Zero or more configuration files may be read by the harness. The files checked are:
~/.lcatr.cfg ./lcatr.cfg
They may provide configuration parameters in two ways. First, the
[DEFAULT] section overrides parameters supplied by environment
variables but may be further overridden by those explicitly supplied
(see below)
Second, after the command line parameters are applied the files are
checked a second time for any sections that match the key/value name
of any existing parameters. For example a section named [site BNL] matches the parameter site with the value BNL. Any
parameters listed in the section will be applied. If they are not yet
set they will be but they will not override previously set parameters.
That is, they provide a set of default tied to the setting of some
other parameter.
This last step in resolving the parameters is general but intended to
only be used for the high-level parameters such as context, site,
local and job.
The main Python job.Job class constructor takes as keywords zero or
more parameters. The command line invocation of the harness can be
given zero or more parameters using command line arguments like:
--parameter=value
These explicit parameters will override any of the same names provided
by the environment or by any [DEFAULT] sections of configuration
files.
The configuration parameters understood by the harness are:
contextsite, local and
job.
sitelocaljobversionoperatorarchive_rootarchive_userarchive_root mounted via SSH.
archive_hoststage_rootdependenciesmodules_homeinit/ sub
directory)
modules_versionmodules_cmdmodulescmd program.
modules_pathThe following things must be provided before the job harness can run
The job harness will need to run from an account that can access the archive server via SSH. This is needed to perform existence checks on the archive and to copy files between the archive and the local stage. For unattended running it is strongly recommended to setup an SSH key pair such that a phassphrase/password need not be given interactively while jobs run.
As described above, the job harness relies on externally defined environmental Modules. It is expected that the Modules support programs are already installed and that the suite of job-specific modulefiles exist. Their locations may be specified in the harness configuration file, previously set up using standard Modules environment variables or the harness will attempt to guess the locations.
1 There is a mode used for testing where such dependencies are resolved through guesses made based on the contents of the archive.
Date: 2014-10-03 11:45:53 PDT
HTML generated by org-mode 6.21b in emacs 23