"Seegrid will be due for a migration to confluence on the 1st of August. Any update on or after the 1st of August will NOT be migrated"
-- VictorTey - 08 Jul 2013

Prerequisite:

In order to understand this FAQ section, you are required to have a background in software programming. It is expected that you will also have a general familiarity with the cloud and VGL.

Overview

Adding a new scientific code to the VGL is relatively straightforward process. It can be split into three parts:
  1. Installing the new code into a VM and bundling it into a new image;
  2. Registering the VM image in VGL;
  3. Creating interactive javascript/python templates to act as a basic GUI

Installing a new code

A new VM will need to be instantiated and the scientific code will need to be installed. It is recommended that this process is automated via a Puppet script. VGLSingleJobImage covers the process for existing codes. It is recommended to follow this example and reuse the VGL puppet classes to ensure all the correct bootstrap scripts are installed. VGLSingleJobImage also covers saving or bundling the VM image into the cloud for reuse.

Registering in VGL

Once the VM image has been created, its unique ID will need to be registered into applicationContext.xml in the VGL source tree. The images are registered as org.auscope.portal.server.vegl.VglMachineImage inside of an existing org.auscope.portal.core.services.cloud.CloudComputeService. At this point you can also specify whether this image is restricted to particular user groups or not.

Creating a template

Set up your component in Components.js and provide a script template. Create a javascript class that extends the BaseTemplate.js
/**
 * A template for generating a eScript gravity inversion example.
 */
Ext.define('ScriptBuilder.templates.AEMInversionTemplate', {
    extend : 'ScriptBuilder.templates.BaseTemplate',

    description : null,
    name : null,

    constructor : function(config) {
        this.callParent(arguments);
    },

    /**
     * See parent description
     */
    requestScript : function(callback) {
        var jobId = this.wizardState.jobId;
        var maxThreads = this.wizardState.ncpus;

        this._getTemplatedScriptGui(callback, 'aem-inversion.py', {
            xtype : 'form',
            width : 450,
            height : 390,
            items : [{
                xtype : 'combo',
                fieldLabel : 'Dataset',
                name : 'wfs-input-xml',
                allowBlank : false,
                valueField : 'localPath',
                displayField : 'localPath',
                anchor : '-20',
                plugins: [{
                    ptype: 'fieldhelptext',
                    text: 'The path to the input file.'
                }],
                store : Ext.create('Ext.data.Store', {
                    model : 'vegl.models.Download',
                    proxy : {
                        type : 'ajax',
                        url : 'getAllJobInputs.do',
                        extraParams : {
                            jobId : jobId
                        },
                        reader : {
                            type : 'json',
                            root : 'data'
                        }
                    },
                    autoLoad : true
                })
            },{
                xtype : 'numberfield',
                fieldLabel : 'Max Threads',
                anchor : '-20',
                name : 'n-threads',
                value : maxThreads,
                allowBlank : false,
                minValue : 1,
                plugins: [{
                    ptype: 'fieldhelptext',
                    text: Ext.String.format('The maximum number of execution threads to run (this job will have {0} CPUs)', maxThreads)
                }]
            }]
        });
    }

});

Following that,
  1. Include the file in jobBuilder.jsp for javascript import
  2. Include the file in joblist.jsp for javascript import
  3. Add code in Component to handle the new javascipt for UI handling+
The code template should be stored in src/main/resources.

Adding code or library to a new or existing VM

Use a existing vm or create a new one and make the necessary changes then follow this guide to build a new VM. Note that existing cannot be directly upgrade as any changes you make won't persist. In order for a old job to be replicate, all changes required on a VM will have to create a new image and register that with the VGL portal.
Topic revision: r4 - 01 Sep 2014, TerryRankine
 

Current license: All material on this collaboration platform is licensed under a Creative Commons Attribution 3.0 Australia Licence (CC BY 3.0).