logo
Go to the homepage of the Vrije Universiteit. Goto the homepage of the faculty of sciences. Goto the homepage of the department of computer science.

Cluster and Grid Computing (Practical Work)



Creating Adaptors:


When you want to write your own adaptor, you can use the following recipe:

  1. Find the GAT interface that your adaptor should implement.
  2. Find the CPI class that corresponds to this interface.
  3. Create a class that extends the CPI class and implements the necessary methods.
    Alternatively, extend an existing adaptor and overwrite methods to change its behavior.
  4. Create a jar file that contains your class and a special MANIFEST file (more on this later).
  5. Makes sure that GAT Engine can find your jar (explained below)
  6. (If necessary) explicitly select your adaptor in your application by using preferences.

The easiest way to create a resource broker for the Amazon Cloud is to extend the existing SshTrilead resource broker for and add some Amazon specific knowledge to it. As with the previous assigment, there is a template that you can use for your implementation. As a result, your adaptor recipe will look like this:

  1. Have a look at the ResourceBroker interface.
  2. Have a look at the ResourceBrokerCpi class.
  3. Untar the Amazon broker template (see below).
  4. Add the code talk to Amazon.
  5. Complete the implementation.
  6. Change your joinc implementation to use the new adaptor.
  7. Tell the JavaGAT where it can find your Amazon broker (see below).
  8. Run the applications...


Amazon Broker Template:


The Amazon broker template can be found in the usual directory on the fs0 machine:

/usr/local/VU/practicum/gridcomputing/tarballs/amazonbroker-template.tgz

It contains a skeleton for your implementation that looks like this:

    public class AmazonResourceBrokerAdaptor extends SshTrileadResourceBrokerAdaptor {

         public AmazonResourceBrokerAdaptor(GATContext gatContext, Preferences preferences) throws ... {
              super(gatContext, preferences);

              // Add stuff here if needed.
         }

         public Job submitJob(JobDescription description) throws ... {
              // Do whatever you need to do here, and then
              // call super.submitJob(...) to submit a job.
         }
    }


It is very important that you use 'ant' to build your source, since a special MANIFEST file must be inserted into the Amazon resource broker jar file. This MANIFEST file is used by the JavaGAT to figure out what type of adaptor it can find in the jar file. If it is not found, your implementation will not be recognised as an adaptor.


Telling JavaGAT about your adaptor:


After you have created an Amazon broker, you will have to tell the JavaGAT where it can can find your implementation. You can do this by setting the AMAZON_ADAPTOR environment variable, for example:

export AMAZON_ADAPTOR=$HOME/amazonbroker/jar/AmazonResourceBrokerAdaptor.jar

This way, your AmazonResourceBrokerAdaptor.jar file will be automatically added to the list of adaptors that the JavaGAT loads (provided that you use the /usr/local/VU/practicum/gridcomputing/bin/run_grid_app script to run your grid applications).


Updating JOINC:


After you have created an Amazon resource broker implementation, you must update your JOINC implementation to use the "Amazon" resource broker instead of "globus". Also don't forget to remove any hard-coded machine settings.


If you spot a mistake, please e-mail the maintainer of this page.
Your browser does not fully support CSS. This may result in visual artifacts.