35
Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

Embed Size (px)

Citation preview

Page 1: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

Includes slides borrowed freely fromThe Globus team

Building Grid Services andThe Globus Toolkit®

CISE 6930.5: Globus TutorialAnda Iamnitchi

Page 2: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

2

Outline

1. What is Globus Toolkit, not turnkey solution. That is, toolkit, not turnkey solution. Tools (components)

2. Grid services and the relationship with Globus

3. How to build Grid services using Globus

Page 3: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

3

Grids for Physics: LHC Computing Grid

Page 4: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

4

How It Started

While helping to build/integrate a diverse range of distributed applications, the same problems kept showing up over and over again.

Too hard to keep track of authentication data (ID/password) across institutions

Too hard to monitor system and application status across institutions

Too many ways to submit jobs Too many ways to store & access files and data Too many ways to keep track of data Too easy to leave “dangling” resources lying around

(robustness)

Page 5: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

grid architecturein a nutshell

Page 6: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

6

Forget Homogeneity!

Trying to force homogeneity on users is futile. Everyone has their own preferences, sometimes even dogma.

The Internet provides the model…

Page 7: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

7

What Does the Globus Toolkit Cover?

GoalToday

Page 8: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

8

Theory -> Practice

Page 9: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

building a grid(in practice)

Page 10: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

10

Methodology Building a Grid system or application is currently

an exercise in software integration. Define user requirements Derive system requirements or features Survey existing components Identify useful components Develop components to fit into the gaps Integrate the system Deploy and test the system Maintain the system during its operation

This should be done iteratively, with many loops and eddys in the flow.

Page 11: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

11

How it Really Happens

WebBrowser

ComputeServer

DataCatalog

DataViewer

Tool

Certificateauthority

ChatTool

CredentialRepository

WebPortal

ComputeServer

Resources implement standard access & management interfaces

Collective services aggregate &/or

virtualize resources

Users work with client applications

Application services organize VOs & enable

access to other services

Databaseservice

Databaseservice

Databaseservice

SimulationTool

Camera

Camera

TelepresenceMonitor

RegistrationService

Page 12: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

12

How it Really Happens(without Globus)

WebBrowser

ComputeServer

DataCatalog

DataViewer

Tool

Certificateauthority

ChatTool

CredentialRepository

WebPortal

ComputeServer

Resources implement standard access & management interfaces

Collective services aggregate &/or

virtualize resources

Users work with client applications

Application services organize VOs & enable

access to other services

Databaseservice

Databaseservice

Databaseservice

SimulationTool

Camera

Camera

TelepresenceMonitor

RegistrationService

A

B

C

D

E

Application Developer

10

Off the Shelf

12

Globus Toolkit

0

Grid Community

0

Page 13: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

13

How it Really Happens(with Globus)

WebBrowser

ComputeServer

GlobusMCS/RLS

DataViewer

Tool

CertificateAuthority

CHEF ChatTeamlet

MyProxy

CHEF

ComputeServer

Resources implement standard access & management interfaces

Collective services aggregate &/or

virtualize resources

Users work with client applications

Application services organize VOs & enable

access to other services

Databaseservice

Databaseservice

Databaseservice

SimulationTool

Camera

Camera

TelepresenceMonitor

Globus IndexService

GlobusGRAM

GlobusGRAM

GlobusDAI

GlobusDAI

GlobusDAI

Application Developer

2

Off the Shelf

9

Globus Toolkit

4

Grid Community

4

Page 14: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

14

What Is the Globus Toolkit? The Globus Toolkit is a collection of solutions to problems

that frequently come up when trying to build collaborative distributed applications.

Not turnkey solutions, but building blocks and tools for application developers and system integrators. Some components (e.g., file transfer) go farther than others

(e.g., remote job submission) toward end-user relevance. To date (v1.0 - v4.0), the Toolkit has focused on

simplifying heterogeneity for application developers. The goal has been to capitalize on and encourage use of

existing standards (IETF, W3C, OASIS, GGF). The Toolkit also includes reference implementations of

new/proposed standards in these organizations.

Page 15: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

15

How To Use the Globus Toolkit By itself, the Toolkit has surprisingly limited end

user value. There’s very little user interface material there. You can’t just give it to end users (scientists,

engineers, marketing specialists) and tell them to do something useful!

The Globus Toolkit is useful to application developers and system integrators. You’ll need to have a specific application or system

in mind. You’ll need to have the right expertise. You’ll need to set up prerequisite hardware/software. You’ll need to have a plan.

Page 16: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

16

Data Management

SecurityCommonRuntime

Execution Management

Information Services

Web Services

Components

Non-WS

Components

Pre-WSAuthenticationAuthorization

GridFTP

GridResource

Allocation Mgmt(Pre-WS GRAM)

Monitoring& Discovery

System(MDS2)

C CommonLibraries

GT2

WSAuthenticationAuthorization

ReliableFile

Transfer

OGSA-DAI[Tech Preview]

GridResource

Allocation Mgmt(WS GRAM)

Monitoring& Discovery

System(MDS4)

Java WS Core

CommunityAuthorization

ServiceGT3

ReplicaLocationService

XIO

GT3

CredentialManagement

GT4

Python WS Core[contribution]

C WS Core

CommunitySchedulerFramework

[contribution]

DelegationService

GT4

Globus Toolkit Components

Page 17: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

17

Java Services in Apache AxisPlus GT Libraries and Handlers

YourJavaService

YourPythonService

YourJavaService R

FT

GR

AM

Del

egat

ion

Inde

x

Trig

ger

Arc

hive

r

pyGlobusWS Core

YourC

Service

C WS Core

RLS

Pre

-WS

MD

S

CA

S

Pre

-WS

GR

AM

Sim

pleC

A

MyP

roxy

OG

SA

-DA

I

GT

CP

Grid

FT

P

C Services using GT Libraries and Handlers

SERVER

CLIENT

InteroperableWS-I-compliant

SOAP messaging

YourJavaClient

YourC

Client

YourPythonClient

YourJavaClient

YourC

Client

YourPythonClient

YourJavaClient

YourC

Client

YourPythonClient

YourJavaClient

YourC

Client

YourPythonClient

X.509 credentials =common authentication

Python hosting, GT Libraries

GT4 Components

Page 18: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

18

Outline

1. What is Globus Toolkit, not turnkey solution. That is, toolkit, not turnkey solution. Tools (components)

2. Grid services and the relationship with Globus

3. How to build Grid services using Globus

Page 19: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

19

GT4, OGSA, WSRF & Co.

Web services architecture

components

Page 20: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

20

Why Web Services? Standards widely accepted Platform and language-independent

Client may be in C++ running under Windows, server may be in Java running under Linux

Uses XML (standard) HTTP-based:

HTTP traffic allowed by most firewalls and proxies Disadvantages:

Significant overhead (tradeoff: portability) Lack of versatility (e.g., compared to Corba)

Life cycle management, notifications, etc (implemented by WSRF)

Page 21: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

21

GT4, OGSA, WSRF & Co.

Page 22: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

22

Page 23: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

23

A typical Web Service invocation

Page 24: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

24

A typical Web Service invocation (more detailed)

Page 25: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

25

WSRF: It's all about state

WS-Resource = Web service + Resource

Web services do not have state Web Services Resource Framework(add state to web services)

Page 26: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

26

Outline

1. What is Globus Toolkit, not turnkey solution. That is, toolkit, not turnkey solution. Tools (components)

2. Grid services and the relationship with Globus

3. How to build Grid services using Globus

Page 27: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

27

Build your Grid service in 5 steps

1. Define the service's interface. This is done with WSDL

2. Implement the service. This is done with Java.

3. Define the deployment parameters. This is done with WSDD and JNDI

4. Compile everything and generate a GAR file. This is done with Ant

5. Deploy service. This is done with a GT4 tool

Page 28: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

28

Step 1: Define the service's interface

In java:

public interface Math { public void add(int a);

public void subtract(int a);

public int getValueRP();

}

Page 29: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

29

The same interface specification in WSDL…

<?xml version="1.0" encoding="UTF-8"?> <definitions name="MathService"

targetNamespace="http://www.globus.org/namespaces/examples/core/MathService_instance" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.globus.org/namespaces/examples/core/MathService_instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd" xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<wsdl:import namespace= "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" location="../../wsrf/properties/WS-ResourceProperties.wsdl" />

<!================================== T Y P E S =====================================================> <types> <xsd:schema targetNamespace="http://www.globus.org/namespaces/examples/core/MathService_instance"

xmlns:tns="http://www.globus.org/namespaces/examples/core/MathService_instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<!-- REQUESTS AND RESPONSES --> <xsd:element name="add" type="xsd:int"/>

<xsd:element name="addResponse"> <xsd:complexType/>

</xsd:element> <xsd:element name="subtract" type="xsd:int"/>

<xsd:element name="subtractResponse"> <xsd:complexType/>

</xsd:element> <xsd:element name="getValueRP">

<xsd:complexType/> </xsd:element> <xsd:element name="getValueRPResponse" type="xsd:int"/>

Page 30: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

30

<!-- RESOURCE PROPERTIES --> <xsd:element name="Value" type="xsd:int"/> <xsd:element name="LastOp" type="xsd:string"/> <xsd:element name="MathResourceProperties">

<xsd:complexType> <xsd:sequence>

<xsd:element ref="tns:Value" minOccurs="1" maxOccurs="1"/> <xsd:element ref="tns:LastOp" minOccurs="1" maxOccurs="1"/>

</xsd:sequence></xsd:complexType>

</xsd:element> </xsd:schema> </types> <!=================== M E S S A G ES ===============================> <message name="AddInputMessage"> <part name="parameters" element="tns:add"/> </message> <message name="AddOutputMessage"> <part name="parameters" element="tns:addResponse"/> </message> <message name="SubtractInputMessage"> <part name="parameters" element="tns:subtract"/> </message> <message name="SubtractOutputMessage"> <part name="parameters" element="tns:subtractResponse"/> </message><message name="GetValueRPInputMessage"> <part name="parameters" element="tns:getValueRP"/> </message> <message name="GetValueRPOutputMessage"> <part name="parameters" element="tns:getValueRPResponse"/> </message><!====================== P O R T T Y P E ================================================> <portType name="MathPortType" wsdlpp:extends="wsrpw:GetResourceProperty“

wsrp:ResourceProperties="tns:MathResourceProperties"> <operation name="add">

<input message="tns:AddInputMessage"/> <output message="tns:AddOutputMessage"/>

</operation> <operation name="subtract">

<input message="tns:SubtractInputMessage"/> <output message="tns:SubtractOutputMessage"/>

</operation> <operation name="getValueRP">

<input message="tns:GetValueRPInputMessage"/> <output message="tns:GetValueRPOutputMessage"/>

</operation> </portType> </definitions>

Page 31: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

31

Step 2: Implement the service package org.globus.examples.services.core.first.impl; import java.rmi.RemoteException; import org.globus.wsrf.Resource; import org.globus.wsrf.ResourceProperties; import org.globus.wsrf.ResourceProperty; import org.globus.wsrf.ResourcePropertySet; import org.globus.wsrf.impl.ReflectionResourceProperty; import org.globus.wsrf.impl.SimpleResourcePropertySet; import org.globus.examples.stubs.MathService_instance.AddResponse; import org.globus.examples.stubs.MathService_instance.SubtractResponse; import org.globus.examples.stubs.MathService_instance.GetValueRP; public class MathService implements Resource, ResourceProperties {

/* Resource Property set */ private ResourcePropertySet propSet; /* Resource properties */ private int value; private String lastOp; /* Constructor. Initializes RPs */ public MathService() throws RemoteException {

/* Create RP set */ this.propSet = new SimpleResourcePropertySet( MathQNames.RESOURCE_PROPERTIES); /* Initialize the RP's */ try { ResourceProperty valueRP = new ReflectionResourceProperty( MathQNames.RP_VALUE, "Value", this);

this.propSet.add(valueRP); setValue(0); ResourceProperty lastOpRP = new ReflectionResourceProperty( MathQNames.RP_LASTOP, "LastOp",

this);this.propSet.add(lastOpRP); setLastOp("NONE");

} catch (Exception e) { throw new RuntimeException(e.getMessage()); }

}

Page 32: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

32

/* Get/Setters for the RPs */ public int getValue() {

return value; } public void setValue(int value) {

this.value = value; } public String getLastOp() {

return lastOp; } public void setLastOp(String lastOp) {

this.lastOp = lastOp; } /* Remotely-accessible operations */ public AddResponse add(int a) throws RemoteException {

value += a; lastOp = "ADDITION"; return new AddResponse(); }

public SubtractResponse subtract(int a) throws RemoteException { value -= a; lastOp = "SUBTRACTION"; return new SubtractResponse(); }

public int getValueRP(GetValueRP params) throws RemoteException { return value; }

/* Required by interface ResourceProperties */ public ResourcePropertySet getResourcePropertySet() {

return this.propSet; } }

Page 33: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

33

Step 3: Define the deployment parameters

•The WSDD deployment descriptor: the file that tells the Web Services container how it should publish the web service (for example, telling it what the the service's URI will be). The deployment descriptor is written in WSDD format (Web Service Deployment Descriptor). •The JNDI deployment file:

Page 34: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

34

Step 4: Compile everything and generate a GAR file

Creating a GAR (Grid Archive) file involves the following:• Processing the WSDL file to add missing pieces (such as bindings)• 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

In fact, this means executing one script provided by the Globus toolkit:./globus-build-service.sh -d <service base directory> -s <service's WSDL file>

Page 35: Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE 6930.5: Globus Tutorial Anda Iamnitchi

35

Step 5: Deploy service The GAR file, as mentioned in the previous page,

contains all the files and information the web server needs to deploy the web service. Deployment is done with a GT4 tool that, using Ant, unpacks the GAR file and copies the files within (WSDL, compiled stubs, compiled implementation, WSDD) into key locations in the GT4 directory tree.

This deployment command must be run with a user that has write permission in $GLOBUS_LOCATION.

globus-deploy-gar <GAR file>