Personal tools

4.4.5. Application Metadata XML

Up one level
Creating an XML File to Describe an Application

Application description files are XML files containing metadata about an application deployed on a GRIA Job Service. These files are essential for GRIA users to discover and use available applications. To create an XML description for an application, you need to use the following schema to identify the application's main features including name, version number, description and inputs/outputs (if any).

The core elements in GRIA application metadata documents are:

  • JobServiceMinVersion, [1]
  • Application, [1]
  • Metrics, [0,1]
  • Parameters, [0,1]
  • DataStagers, [1]

The following paragraphs explain in more detail each of these elements.

JobServiceMinVersion Element

The GRIA Job Service version, e.g. 5.2, 5.3. Multiplicity: 1.

Application Element

This element contains elements that describe the application itself. Multiplicity: 1.

The Application element contains the following sub-elements:

Description Element

Application sort description, multiplicity 0,1, type string.

ApplicationName Element

Every application provided by the Job service must be given a unique ApplicationName. To ensure uniqueness, a URI is used. Note that although these names look like web page addresses, they may not necessarily point to real web pages if treated as URL; they are simply unique strings, multiplicity: 1, type string.

ApplicationVersion Element

This element describes the application version, multiplicity 0, 1, type string.

Group Element

The Group element describes optional information about an application's group, e.g. CFD, simulation, etc. Multiplicity 0, 1, type string.

Keywords Element

This is a string of keywords describing the application, multiplicity 0, 1.

Metrics Element

This is an optional element that can be used to describe application specific metrics to GRIA components. Currently not in use.

Parameters

This element is used to describe application expected parameters. It can be used by the Job Service in order to check validity of submitted job parameters, command line arguments. Multiplicity 0, *.

The Parameters element can take the following attributes:

  • name
  • qualifier
  • type, optional
  • minOccurs, optional
  • maxOccurs, optional

The last two attributes can be used to represent single or multiple parameters.

Default Element

This element can be used to provide default parameters for the application, e.g. run all jobs in debug or verbose mode, etc. Multiplicity 0, 1.

Allowed Element

This element can be used to list application allowed parameters. Multiplicity 0, *.

Description Element

This element can be used to describe parameters metadata. Multiplicity 0, 1.

DataStagers Element

DataStager elements are used to specify job inputs and outputs. The element can present default, optional and multiple I/Os that will be used for running the job. Multiplicity 1, *. Each DataStager element can contain the following attributes:

  • type, required
  • name, required
  • minOccurs, optional
  • maxOccurs, optional
  • defaultSize, optional

Description Element

This is an optional element describing a job file. Multiplicity 0, 1.

MimeType Element

MimeType is an optional element that describes the type of the file, e.g. text, image, etc. GRIA services can use it, for example to display properly the contents of a data stager. Multiplicity 0, 1.

The following XML describes the Swirl application:

<?xml version="1.0" encoding="UTF-8" ?>

<GriaApplicationDescription xmlns="http://www.it-innovation.soton.ac.uk/2007/grid/application">

<JobServiceMinVersion>5.2</JobServiceMinVersion>

<Application>
<Description>Application to swirl an image</Description>
<ApplicationName>http://it-innovation.soton.ac.uk/grid/imagemagick/swirl</ApplicationName>
<ApplicationVersion>2.0-1</ApplicationVersion>
<Group>graphics</Group>
<Keywords>imagemagick, example</Keywords>
</Application>

<DataStagers>
<DataStager type="input" name="inputImage">
<Description>Input image to be swirled</Description>
<MimeType>image</MimeType>
</DataStager>

<DataStager type="output" name="outputImage">
<Description>Swirled image</Description>
<MimeType>image</MimeType>
</DataStager>
</DataStagers>

</GriaApplicationDescription>

Advanced usage

Input arrays

An application might require arrays of inputs, whose exact sizes are specified by the user when creating the job. This is supported by GRIA using the minOccurs, maxOccurs and defaultSize attributes on DataStager elements.

For example, if your application took between 2 and 8 images as input, you might use the following XML:

<DataStager type="input" name="inputImage" minOccurs="2" maxOccurs="8" defaultSize="2">
<Description>Input image</Description>
<MimeType>image</MimeType>
</DataStager>

You can use the defaultSize attribute to support older clients that do not know how to specify the desired size of arrays.

Optional inputs

Optional inputs are described much like arrays, except the minOccurs attribute is 0 and the maxOccurs attribute is 1. For example:

<DataStager type="input" name="overlayImage" minOccurs="0" maxOccurs="1" defaultSize="0">
<Description>Optional image to superimpose on top of the result</Description>
<MimeType>image</MimeType>
</DataStager>

Command line arguments

If your metadata file describes the application's allowed command line arguments, the GRIA Client and Job Service can validate arguments as they are received by the user before they are passed to the application wrappers.

For example:

<Parameters>
<Parameter name="string" qualifier="--string" type="string" minOccurs="0" maxOccurs="1"/>
<Parameter name="bool" qualifier="--bool" type="boolean" minOccurs="0" maxOccurs="1"/>
<Parameter name="data" qualifier="" type="string" minOccurs="1" maxOccurs="1">
<Allowed>one</Allowed>
<Allowed>two</Allowed>
<Allowed>three</Allowed>
</Parameter>
</Parameters>

This would allow the following command lines:

--string "This is a string" one
--bool three

In the above example, we specify whether parameters are optional or compulsory using the minOccurs="0" maxOccurs="1" or minOccurs="1" maxOccurs="1" attribute combinations, respectively.

The "data" parameter may take different values (hence the empty qualifier attribute). It is also further restricted by the use of specific allowed elements, forming a set of options.