Data Staging and Persistent Provisioning

Persistent Provisioning and data staging allows Rio to provision software or data a service needs prior to instantiation. This allows software to be dynamically installed, and raw data or application components to be installed for a service. The installation is also typically removed when the service terminates. It is possible to keep the installed software (or data) resident on the compute resource the Cybernode represents.

Persistent Provisioning and data staging are currently available for POSIX based systems only.

Persistent Provisioning

Building on the previous example, we will add persistent provisioning declaration for Tomcat. This will allow us to install Tomcat if it is not found on a targeted compute resource.:

The following is a snippet of the Groovy document, showing just the relevant serviceExec element modifications.

deployment(name: 'Tomcat Deploy') {
    groups System.getProperty(Constants.GROUPS_PROPERTY_NAME,
                              System.getProperty('user.name'))
    serviceExec(name: 'Tomcat') {
         software(name: 'Tomcat', version: '6.0.16', removeOnDestroy: true) {
            install source: 'https://elastic-grid.s3.amazonaws.com/tomcat/apache-tomcat-6.0.16.zip',
                    target: '${RIO_HOME}/system/external/tomcat',
                    unarchive: true
            postInstall(removeOnCompletion: false) {
                execute command: '/bin/chmod +x ${RIO_HOME}/system/external/tomcat/apache-tomcat-6.0.16/bin/*sh'
            }
        }

        ...
    }
}

The table below outlines the addition of the following elements:

Element Description
install The install element declares software that needs to be installed, if the software is not provided by the compute resource the Cybernode represents. The element provides an attribute allowing the declaration of whether the software should be removed when the service is destroyed.

The removeOnDestroy attribute specifies whether the software should be removed when the service is terminated (destroyed). The default is true.

The install element also declares the source, target, and whether to unarchive the download (default is to not unarchive it)
postInstall The postInstall element is an optional element, and it allows the ability to perform tasks or commands on the downloaded (and optionally unarchived) software. In this deployment the postInstall declaration has an embedded execute element, instructing Rio to chmod a file in the distribution, giving it execute permissions.


If you want to keep the installed software (rather than overwrite it each time), modify the software declaration to include:
overwrite: 'no', removeOnDestroy: false
.

Data Staging

Although the Tomcat example does not include data staging as part of it's functionality, lets show how the example may be modified to include the installation of a WAR as part of Tomcat bootstrapping.

As in the previous example, this following Groovy snippet is shown for the relevant elements.

deployment(name: 'Tomcat Deploy') {
    ...
    data source: 'https://elastic-grid.s3.amazonaws.com/tomcat/sample.war',
         target: '${RIO_HOME}/system/external/tomcat/apache-tomcat-6.0.16/webapps',
         unarchive: true, perms: 'ugo+rwx'
    ...
    }
}

The data element provides the way to download and install data for the service. In this case, the data is a WAR (Web Application Archive).

Attribute Description Default
perms Optional permissions to set on the staged data. The permissions need to be in the form of what the chmod command uses. n/a
overwrite If set to "yes", overwrite a file at the target download location with the same name. true
removeOnDestroy If set to true, remove the file(s) upon service destruction. true
unarchive If set to true, unarchive the download. false

Try the provided Tomcat example.