CloudTran Home

 
  
 
Contents  >   7.  Deployment
 


7.4 Generating Deployment Files

 7.4.1  Concepts
 7.4.2  ChangingTheDeployment
 7.4.3  How To

7.4.1  Concepts
After modelling and building, the next step is to create the deployments.

Cloudtran creates an intermediate XML file, by default called 'generatedDeployment.xml'. (If you want to change this name, change the property in the file jeewiz/resources/giga-spaces/control/application/component.properties, then re-build the application.) It can be found at the top project level, at the same level as the .osm model). This is used to generate the actual deployment scripts.

This file contains a root node for the <application>, then a nested <deploymentOption> element for each named Deployment. Then, for PU in the build, there is a <deploymentOption> element for each processing unit. Just to give you an idea, this extract shows the structure:
<application                name="TheApplication"
                            deploymentKey="TheApplication_key"
                            >
    <deploymentOption       name="deployment1"
                            target="CommandLine"
                            machines="Inspiron510m,NteDell8"
                            >
        <processingUnit     name="UtilityPU"
                            projectName="TheApplication_UtilityPU"


7.4.2  ChangingTheDeployment
We expect some development teams to want to change the deployment scripts. There are two ways of doing this.
  1. Amend the Cloudtran scripts. The Velocity scripts for this are in the following directory:
    <EclipseDir>/plugins/com.cloudtran.builder_x.y.z/
           jeewiz/resources/control/giga-spaces/deployments
    
    where X, Y and Z represent the product major, minor and release numbers. You should copy the files you want to change to your own custom tmeplates directory, then preserve the remainder of the filename from 'giga-spaces/deployments'. See the Windows/Preferences/CloudTran page in Eclipse - this shows the default location of the customTemplateDirectory - it's down in the plugin. You can change it there if you want; be aware that it will need to be respecified when you install another version of the plugin. In other words, to change file X, copy it to [[customTemplateDir]]/giga-spaces/deployments/X and change it there.

    You will be using the JeeWiz generator's variant of Velocity for this. See jeewiz.org for more details.
  2. Use the 'generatedDeployment.xml' file and your own favourite scripting language to write the deployment.

7.4.3  How To
The deployment files are generated automatically in the application generation, but can be generated independently. To generate the deployment files using the 'generatedDeployment.xml' file and the CloudTran scripts (either out of the box or altered by you), open a command box, cd to the GigaSpaces project directory and type:
ant -f provisioning.xml
To generate the deployment files using another XML file open a command box and change to the GigaSpaces project directory and type:
ant -DdeploymentDefinition=<the deployment file> -f provisioning.xml
Both of these result in the generation of the deployment files. A sub-directory called 'deployment' will be generated in the main project. Further sub-directories are generated below the 'deployment' directory, one for each named Deployment Option. These sub-directories will be named using the Deployment Option name. For example if there are 2 Deployment Options - 'deployment1' and 'deployToCloud' - the following directory structure will be generated.

The contents of the deployment directories will depend on the 'target' of the Deployment Option, which is covered in the remaining sections of this chapter.


Copyright (c) 2001-2011 CloudTran Inc.