Difference between revisions of "Doc:Sdk 4.0/awdguide/appbundle"

Line 10: Line 10:
 
     <application configuration files>
 
     <application configuration files>
  
The appcfg.xml file describes the contents of the application bundle.  It is an xml V1.1 document with a simple layout.  For example:
+
The appcfg.xml file describes the contents of the application bundle.  It is an xml V1.1 document with a simple layout.  As a simplification to standard XML, attributes and child tags are considered equivalent and the special attribute "value" is equivalent to child content.  The purpose is to allow the xml author to use whichever form is more convenient.  This concept is most easily understood by noting that all of the following are equivalent config files:
 +
 
 +
===="Classic" XML====
 +
<pre>
 +
<foo>
 +
  <bar>1</bar>
 +
</foo>
 +
</pre>
 +
 
 +
===="Compact" XML====
 +
<pre>
 +
<foo bar="1" />
 +
</pre>
 +
 
 +
====Partially compacted XML====
 +
<pre>
 +
<foo>
 +
  <bar value="1"></bar>
 +
</foo>
 +
</pre>
 +
 
 +
===Example configuration file===
 +
 
 +
The following is a typical appcfg.xml configuration file.  This file is used in the SAFplus Platform virtualIp example provided with your SAFplus Platform source distribution:
  
 
<pre>
 
<pre>
Line 90: Line 113:
 
   <activeStandbyRatio value='50' />
 
   <activeStandbyRatio value='50' />
 
</modifiers>
 
</modifiers>
 +
</pre>
 +
 +
===messages===
 +
 +
The messages section allows you to provide a message to the user during certain actions.
 +
 +
====newDeployment====
 +
 +
The new deployment tag specifies the message to print after a successful deployment of this application.
 +
 +
Example:
 +
<pre>
 +
<messages>
 +
<newdeployment>This application is deployed onto the selected nodes.</newdeployment>
 +
</messages>
 +
</pre>
 +
 +
===work===
 +
The work tag is used to specify the work assignments (SAF Service Instance and Component Service Instances) for this application.  Each item of work is defined by a child tag, and the tag name will become the name of the SAF Service Instance.  Attributes become the name/value pairs in each CSI.  This specification is simpler than the full SAF definition and so covers a subset of the full SAF expressibility.  In particular, every component defined in the "ProgramNames" tag will have a CSI created for it, and each CSI will contain every name/value pair.
 +
 +
Example:
 +
<pre>
 +
<work>
 +
  <firstIp VirtualIpAddress="192.168.1.250" VirtualNetMask="255.255.255.0" VirtualDevice="eth0:10" />
 +
</work>
 
</pre>
 
</pre>

Revision as of 16:11, 30 December 2008

Contents

Application Bundle Format

An application bundle is a gzipped tar file (.tgz, open via the "tar xvfz <file>" command) that contains at a minimum the following layout:

appcfg.xml
deploy (a directory)
  bin  (a directory)
    <application binary files>
  etc
    <application configuration files>

The appcfg.xml file describes the contents of the application bundle. It is an xml V1.1 document with a simple layout. As a simplification to standard XML, attributes and child tags are considered equivalent and the special attribute "value" is equivalent to child content. The purpose is to allow the xml author to use whichever form is more convenient. This concept is most easily understood by noting that all of the following are equivalent config files:

"Classic" XML

<foo>
  <bar>1</bar>
</foo>

"Compact" XML

<foo bar="1" />

Partially compacted XML

<foo>
  <bar value="1"></bar>
</foo>

Example configuration file

The following is a typical appcfg.xml configuration file. This file is used in the SAFplus Platform virtualIp example provided with your SAFplus Platform source distribution:

<virtualIp ver="1.4.0.0">
<programNames prog0="vip" />
<redundancyModel value="3+1" />
<totalNodes value="4" />
<modifiers>
  <failBack value="false" />
  <autoRepair value="true" />
  <restartsBeforeFailure value='0' />
  <activeStandbyRatio value='50' />
</modifiers>
<messages>
  <newDeployment>Virtual IP application deployed.  Please edit the work assignment (SAF SI) to customize your virtual IP address and interface before starting it.</newDeployment>
</messages>
<work>
  <firstIp VirtualIpAddress="192.168.1.250" VirtualNetMask="255.255.255.0" VirtualDevice="eth0:10" />
</work>
</virtualIp>

The tags are described as follows:

Root Tag

The root tag (in this case "virtualIp") is the name of the application (SAF Service Group).

Attribute: ver

 It has a single attribute "ver" that specifies the version of the software in a 4 dotted digit format.

ProgramNames

ProgramNames specifies the names of every SAF component to be run in the application (SAF Service Group). A single SAF Service Unit will be created on each node that this Service Group is deployed onto, and this SU will contain 1 component for every specified attribute to this tag.

Attribute: progN

This tag takes any number of attributes, labelled prog0...progN. Each attribute specifies the name of a Component to be created, and also the name of a binary located in "deploy/bin" that the component will run.

Example:

<programNames prog0="vip" prog1='myProg' />

RedundancyModel

Specify what type of redundancy this Service Group requires

Attribute: value

This specifies the redundancy model. Possible values are:

  • "2N": 1 Active/1 standby redundancy
  • "N+M": N Active/N standby redundancy
  • "custom": The application will explicitly assign redundancy

Example: <redundancyModel value="3+1" />

totalNodes

Recommend the optimal number of nodes to run this application on.

Attribute: value

A number specifying the number of nodes

Example: <totalNodes value="4" />


modifiers

To override the default configuration for any Service Group configuration parameter, specify the parameter and value as a child tag of this tag. The possible child tags are standard SAF and documented in the AWD GUI's deployment page under "Advanced Configuration", or in the SAF AMF, SAFplus Platform SDK or IDE documentation.

Example:

<modifiers>
  <failBack value="false" />
  <autoRepair value="true" />
  <restartsBeforeFailure value='0' />
  <activeStandbyRatio value='50' />
</modifiers>

messages

The messages section allows you to provide a message to the user during certain actions.

newDeployment

The new deployment tag specifies the message to print after a successful deployment of this application.

Example:

<messages>
<newdeployment>This application is deployed onto the selected nodes.</newdeployment>
</messages>

work

The work tag is used to specify the work assignments (SAF Service Instance and Component Service Instances) for this application. Each item of work is defined by a child tag, and the tag name will become the name of the SAF Service Instance. Attributes become the name/value pairs in each CSI. This specification is simpler than the full SAF definition and so covers a subset of the full SAF expressibility. In particular, every component defined in the "ProgramNames" tag will have a CSI created for it, and each CSI will contain every name/value pair.

Example:

<work>
  <firstIp VirtualIpAddress="192.168.1.250" VirtualNetMask="255.255.255.0" VirtualDevice="eth0:10" />
</work>