4.4.5.
Application Metadata XML
Up one level
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). For example, 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>
The main application metadata is contained within an Application 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.
Inputs and outputs are defined as DataStager elements, with the type attribute set to "input" or "output", as appropriate. Note that you can add as many inputs/outputs as necessary, according to your application.
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.
