Deploying an Application

This page will explain how to create and register an application as well as the jsdl file necessary to run it on a BES container. We will create two XML files, which will both be stored on the local machine. This tutorial will only cover a zip/jar method of application deployment. This assumes that everything that the program needs to run is contained within the archive. When you install Genesis II, you have the option to see example deployment and jsdl documents, which demonstrate other ways of application deployment.

Throughout the examples, I will bold the parameters that you will likely want to change to suit your own needs.

Editing XML docs

Deployment Document

We need to create an xml deployment document. This will depend on what type of application we are trying to run, but for this example, assume a simple executable that uses no shared libraries. You may then zip or jar the file up along with any other files that it might need such as input. We will save the xml document as /uf14/daw9f/deployment.xml.

<?xml version="1.0" encoding="UTF-8"?> <gdesc:deployment-descriptor

       xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl"
       xmlns:gdesc="http://vcgr.cs.virginia.edu/genii/application-description"
       xmlns:genii-zj="http://vcgr.cs.virginia.edu/genii/application-description/zip-jar">
       <gdesc:PlatformDescription>
               <jsdl:CPUArchitecture>
                       <jsdl:CPUArchitectureName>x86</jsdl:CPUArchitectureName>
               </jsdl:CPUArchitecture>
               <jsdl:OperatingSystem>
                       <jsdl:OperatingSystemType>
                               <jsdl:OperatingSystemName>LINUX</jsdl:OperatingSystemName>
                       </jsdl:OperatingSystemType>
               </jsdl:OperatingSystem>
       </gdesc:PlatformDescription>
       <genii-zj:zip-jar>
               <gdesc:binary-name>CalculatorProgram</gdesc:binary-name>
               <genii-zj:source package-type="zip">
                       <gdesc:local-file>/uf14/daw9f/CalculatorProgram.zip</gdesc:local-file>
               </genii-zj:source>
       </genii-zj:zip-jar>

</gdesc:deployment-descriptor>

If you are deploying a Windows application, you must change LINUX to Windows_XP.

JSDL Document

We will need a document to tell the BES container about our new application. Below is a sample jsdl document, which we will save as /uf14/daw9f/calc-jsdl.xml.

<?xml version="1.0" encoding="UTF-8"?> <jsdl:JobDefinition xmlns="http://www.example.org/"

       xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl"
       xmlns:jsdl-posix="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix"
       xmlns:genii-app="http://vcgr.cs.virginia.edu/genii/application"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <jsdl:JobDescription>
               <jsdl:JobIdentification>
                       <jsdl:JobName>Fun Program</jsdl:JobName>
               </jsdl:JobIdentification>
               <jsdl:Application>
                       <jsdl:ApplicationName>Calculator</jsdl:ApplicationName>
                       <genii-app:ApplicationPath path="/home/dan/funapp"/>
                       <jsdl-posix:POSIXApplication>
                               <jsdl-posix:Executable>
                                       calculator.bat
                               </jsdl-posix:Executable>
                               <jsdl-posix:Output>stdout</jsdl-posix:Output>
                       </jsdl-posix:POSIXApplication>
               </jsdl:Application>
               <jsdl:DataStaging>
                       <jsdl:FileName>stdout</jsdl:FileName>
                       <jsdl:CreationFlag>overwrite</jsdl:CreationFlag>
                       <jsdl:DeleteOnTermination>true</jsdl:DeleteOnTermination>
                       <jsdl:Target>
                               <jsdl:URI>rns:/home/dan/Cancer-stdout.txt</jsdl:URI>
                       </jsdl:Target>
               </jsdl:DataStaging>
       </jsdl:JobDescription>

</jsdl:JobDefinition>

This will store the program output in the grid space as /home/dan/Cancer/stdout.txt.

Getting the Application onto the Grid

Creating the Application

We first need to create space for an application to be created. If you wanted to store the application in /home/daw9f/funapp, then you would first have to make sure that /home/daw9f exists before calling the following command in the grid's shell. Note that /home/daw9f refers to its location on the grid's RNS space, not a local directory.

   >app-description-tool --create-application /home/daw9f/funapp

Registering the Application

This step will upload the application's files to the grid, and store them properly into the directory that we created before. In our example, it will place our program into /home/daw9f/funapp. Now we can actually register it onto the grid.

   >app-description-tool --register '''/home/daw9f/funapp CalculatorProgram /uf14/daw9f/deployment.xml

''' In this example, our executable will be CalculatorProgram, and we will tell it all that it needs to know from the deployment xml document.

Running the Application

   >run --jsdl=/uf14/daw9f/calc-jsdl.xml /bes-containers/BootstrapContainer