Sunday, March 27, 2005

GT3 Programmers Tutorial--Part 2

Step 5: Deploy the service into a grid services
container

The GAR file, as mentioned in the previous page, contains all the files and information the web server
needs to deploy the Grid Service. Deployment is also done with the Ant tool, which unpacks the GAR
file and copies the files within (WSDL, compiled stubs, compiled implementation, WSDD) into key locations
in the GT3 directory tree. ****It also reads our deployment descriptor and configures the web server to
take our new Grid Service into account.***

This deployment command must be run from the root of your GT3 installation. Furthermore, you need
to run it with a user that has write permission in that directory.

ant deploy -Dgar.name=

the client:

package org.globus.progtutorial.clients.MathService;
import org.globus.progtutorial.stubs.MathService.service.MathServiceGridLocator;
import org.globus.progtutorial.stubs.MathService.MathPortType;
import java.net.URL;
public class Client
{
Writing Your First Grid Service in 5 Simple
Steps
49
public static void main(String[] args)
{
try
{
// Get command-line arguments
URL GSH = new java.net.URL(args[0]);
int a = Integer.parseInt(args[1]);
// Get a reference to the MathService instance
MathServiceGridLocator mathServiceLocator = new MathServiceGridLocator();
MathPortType math = mathServiceLocator.getMathServicePort(GSH);
// Call remote method 'add'
math.add(a);
System.out.println("Added " + a);
// Get current value through remote method 'getValue'
int value = math.getValue();
System.out.println("Current value: " + value);
}catch(Exception e)
{
System.out.println("ERROR!");
e.printStackTrace();
}
}
}

However, the important point is that,
once we have that reference, we can work with the Grid Service as if it were a local object.


placed. We
need to include this directory in the Classpath so our client can access generated stub classes such as
MathServiceGridLocator. Before running it, we need to to start up the standalone container. Otherwise,
our Grid Service won't be available, and the client will crash. The following command must be run from
the root of your GT3 installation:
globus-start-container

==delegation==



Now we're using this parameter to tell the Grid Services container that GridServiceImpl will provide the
basic functionality of our Grid Service.

===Service data can be used for indexing===

Finally, remember from the What is a Grid Service? page that service data generally falls into two categories:
state information (operation results, intermediate results, runtime information, etc.) and service
metadata (system data, supported interfaces, cost of using the service, etc.). The SystemInfo SDE
would fall into the 'service metadata' category, while the LastResults SDE would fall into the 'state
information' category.

--So... where and how exactly do we define Service Data?


The solution is in the GWSDL. As we'll see in the next page, another of the extensions introduced by
GWSDL (with respect to WSDL) is that we can associate SDEs to a portType, specifying the cardinality
of each SDE along with other properties. The datatype of each SDE is specified in XML Schema
[http://www.w3c.org/XML/Schema], a language originally intended to describe the structure and vocabulary
of XML documents. However, it can also be used to define other types of structures (including
databases, objects, etc.)

The GridService Service Data
Besides all the Service Data we might add by ourselves to a Grid Service (such as our MathData), all
Grid Services have a set of common Service Data Elements which describe certain characteristics of the
Grid Service, such as the GSH of the instance. These SDEs are part of the GridService portType

gridServiceHandle. Multivalued SDE which contains the GridService's GSHs.
• factoryLocator. Single valued SDE with the locator for the factory which created this Grid Service.
If the Grid Service was not created by a factory, the value of this SDE will be null.
• terminationTime. Single valued SDE with information about the termination time of the Grid Service.
• serviceDataNames. Multivalued SDE with the names of all the SDEs in the Grid Service.
• interfaces. Multivalued SDE with the names of all the interfaces (PortTypes) implemented by this
Grid Service.

Saturday, March 26, 2005

GT3 programmers Tutorial--part1

Here are my notes on the Gt3 Programmers Tutorial written clasically by Borja Sotomayor
//---------------------------------------------------------------------------------------------------------//



• GT3 Quick Start
[http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpaperAbstracts/redp3697.html?Open]. Redpaper
written by an IBM team lead by Luis Ferreira.
• From Zero to GT3 [http://www-pnp.physics.ox.ac.uk/~stokes/twiki/bin/view/DIRAC/GT3Express].
Written by Ian Stokes-Rees


----------
Writing and deploying a Grid Service is easier than you might think. You just have to follow five simple
steps.
1. Define the service's interface. This is done with GWSDL
2. Implement the service. This is done with Java
3. Define the deployment parameters. This is done with WSDD
4. Compile everything and generate GAR file. This is done with Ant
5. Deploy service. This is also done with Ant
--------------
3. Define the deployment parameters. This is done with WSDD

One of the key components of the deployment phase is a file called the deployment descriptor. It's the
file that tells the web server how it should publish our Grid Service (for example, telling it what the our
service's GSH will be). The deployment descriptor is written in WSDD format (Web Service Deployment
Descriptor). The deployment descriptor for our Grid Service could be something like this:

---------------
4)

However, creating a GAR file is a pretty complex task which involves the following:
• Converting the GWSDL into WSDL
• Creating the stub classes from the WSDL
• Compiling the stubs classes
• Compiling the service implementation
• Organize all the files into a very specific directory structure
---------------



./tutorial_build.sh
hi ppl, tis e ma first post...this blog'o'mine will be more on the tech side...plan to post regular snippets, nooz discussions and also use it as a medium to document something I learnt....it might b of help to u...