| This is the class that implements a call-out to a site selector which
is an application or executable script. In order to use the site
selector implemented by this class, the property
pegasus.selector.site must be set to value
NonJavaCallout .
This site selector implements a popen() like call to an
external application that conforms to the API laid out here. The name
of the application to run is specified by the property
pegasus.selector.site.path . Its value points to a locally
available application.
If the external executable requires certain environment variables to
be set for execution, these can be specified in the property files,
using the prefix pegasus.selector.site.env . The name of the
environment variable is obtained by stripping the prefix. For
example, to set the variable PATH to a certain value, use the
following entry in your user property file:
pegasus.selector.site.env.PATH = /usr/bin:/bin:/usr/X11R6/bin
The site selector populates the environment of the external
application with the following default properties, which can
be overwritten by user-specified properties:
key | value |
PEGASUS_HOME |
As set by the system |
CLASSPATH |
From java.class.path |
JAVA_HOME |
From java.home |
USER |
From user.name, if present |
LOGNAME |
From user.name, if present |
HOME |
From user.home, if present |
TMP |
From java.io.tmpdir, if present |
TZ |
From user.timezone, if present |
The user can specify the environment variables, by specifying the
properties with the prefix pegasus.selector.site.env. prefix. for e.g user
can override the default user.name property by setting the property
pegasus.selector.site.env.user.home .
The external application is invoked with one commandline argument.
This argument is the name of a temporary file. The temporary file is
created for each invocation anew by the site selecting caller. Being
temporary, the file is deleted after the site selector returns with
success. The deletion of the file is governed by the property
pegasus.selector.site.keep.tmp. It can have a tristate value with the valid
values being
ALWAYS
NEVER
ONERROR
The external application is expected to write one line to stdout.
The line starts with the string SOLUTION: , followed
by the chosen site handle. Optionally, separated by a colon, the
name of a jobmanager for the site can be provided by the site
selector. Two examples for successful site selections are:
SOLUTION:mysite:my.job.mgr/jobmanager-batch
SOLUTION:siteY
Note, these are two examples. The site selector only returns one line
with the appropriate solution. If no site is found to be eligble, the
poolhandle should be set to NONE by the site selector.
The temporary file is the corner stone of the communication between
the site selecting caller and the external site selector. It is a
collection of key-value pairs. Each pair is separated by an equals
(=) sign, and stands on a line of its own. There are no multi-line
values permitted.
The following pairs are generated for the siteselector temporary file:
# | key | value |
1 | version |
The version of the site selector API, currently 2.0 |
1 | transformation |
The fully-qualified definition identifier for the TR, ns::id:vs. |
1 | derivation |
The fully-qualified definition identifier for the DV, ns::id:vs. |
1 | job.level |
The job's depth in the DFS tree of the workflow DAG |
1 | job.id |
The job's ID, as used in the DAX file. |
N | resource.id |
A pool handle, followed by a whitespace, followed by a gridftp server.
Typically, each gridftp server is enumerated once, so you may have multiple
occurances of the same site. |
M | input.lfn |
An input LFN, optionally followed by a whitespace and filesize. |
1 | wf.name |
The label of the DAX, as found in the DAX's root element. |
1 | wf.index |
The DAX index, which is incremented for each partition. |
1 | wf.time |
The mtime of the workflow. |
1 | wf.manager |
The name of the workflow manager to be used, e.g. dagman. |
1 | vo.name |
unused at present, name of the virtual organization who runs this WF. |
1 | vo.group |
unused at present, usage not clear . |
In order to detect malfunctioning site selectors, a timeout is
attached with each site selector, see property
pegasus.selector.site.timeout . By default, a site selector
is given up upon after 60 s.
author: Karan Vahi author: Jens Vöckler version: $Revision: 298 $ See Also: java.lang.Runtime See Also: java.lang.Process |