83
7-1.1 Grid Computing Infrastructure Software © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb 26, 2010

7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Embed Size (px)

Citation preview

Page 1: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.1

Grid Computing Infrastructure Software

© 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb 26, 2010

Page 2: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.2

Gone through several development cycles.

Started before grid computing standards became accepted.

Clearly need standardized protocols and interfaces for wide adoption of grid computing.

Grid computing software

Page 3: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.3

Standards Bodies

Key players for Internet and World Wide Web:

• IETF (Internet Engineering Task Force)– Formed in 1985 for Internet standards inc. previous TCP/IP

• W3C consortium (Worlds Wide Web Consortium)– founded by Tim Berners-Lee shortly after he conceived World Wide

Web in early 1990’s– Standardization of Web-related technologies

• OASIS (Organization for the Advancement of Structured Information Standards)

• Began as SGML Open in 1993 to promote SGML• Became OASIS in 1998 to focus on structured information standards

including newly developed XML

• DMTF (Distributed Management Task Force)• Created in 1992 for IT systems management infrastructure

Page 4: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.4

Organizations for Grid computing• Open Grid Forum (OGF)

– Principal Grid computing body

– Began as Grid forum in 1998

– Merged with eGrid (European Grid) forum and Asia-Pacific Grid community to form Global Grid Form (GGF) in 2001

• GGF meets three times a year around world• GGF1 (March 2001), GGF2, GGF3 …

– GGF became OGF in 2006 and continued meetings.• GGF 18 became OGF 18

– OGF 24 met in Sept. 2008 in Singapore.

– Meetings grown to a very large endeavour today, with participants across world attending.

Page 5: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.5

Standards in Web Services World

• XML introduced (ratified) in 1998• SOAP ratified in 2000• Web services introduced 2000• Subsequently, many standards developed:

– WSDL– WS-* where * refers to names of one of many

standards– Mostly by W3C organization

Page 6: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.6

Using web services

• It would be natural to use web services for grid computing components.

• Provides a easily identifiable interface through WDSL documents.

• Has Internet addressing (URLs).

Page 7: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.7

(Stateless) Web Services”

• “Pure” web services are stateless.

• They do not remember information from one invocation to the next.

• That can work fine for many web service applications.

• They do not need to know what happened with a previous invocation by another client.

Page 8: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.8

Simple previous Web service example• Web service MathService with a method inc to add

1 to the supplied argument and return the result:

Fig 7.1

Page 9: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.9

“Stateful” web service example• With a method to add a value to an

accumulating value and return its value:

Fig 7.2

Page 10: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Fig 7.3 7-1.10

Stateful Web service as a front-end to a database

Page 11: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.11

• In this example, the client accesses a service to perform actions such as access a database.

• Key aspect here is that the state is contained in a resource that can be separate from the web service.

• Web service becomes a front end to the resource.

• Come back to this concept later.

Page 12: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.12

Open Grid Services Architecture (OGSA)

• Originally proposed by Foster et al. in paper: “The Physiology of the Grid” (see reading list)

• Anounced as Grid computing standard at GGF4 in Feb 2002.

• Defines standard mechanisms for creating, naming, and discovering service instances.

• Addresses architectural issues relating to interoperable services for grid computing.

• Does not give details of implementation.

• Requires stateful services but does not say how that will be achieved.

Page 13: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.13

Open Grid Service Infrastructure (OGSI)

• Introduced in 2002-3 (final draft June 2003).

• First attempt to standardize how stateful Web services will be implemented.

• Modifies WDSL to enable state to be specified, using a language called GWSDL (“Grid Web Definition Language”),

• Introduced term Grid service.

• OGSI included inheritance, addressing mechanism, notifications, and message passing mechanism.

• Implemented in Globus toolkit version 3 (GT3).

Page 14: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.14

Open Grid Service Infrastructure (OGSI)

• Not found acceptable by community at large because:

– It significantly modified pure Web service approach

– Required new tools

– Too object oriented in approach

– Too much specified in one standard. It would be better broken down in a series of specifications

Page 15: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.15

WS-Resource Framework (WSRF)

• Web service community also working on approaches to stateful Web services.

• Web and Grid communities merged on WS-Resource Framework approach.

• Specification developed by OASIS in 2004– Replace OGSI and makes implementation of a stateful

Web service acceptable.

• Specifies how to make Web service stateful and other feature, without drifting from the original Web services concept.

Page 16: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.16

Grid computing standards

Figure from “An ‘Ecosystem’ of Grid Components”, 2004, Grid Research Integration Deployment and Support Center, http://www-unix.grids-

center.org/r6/ecosystem/ecology.php

Page 17: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.17From “The Globus Toolkit 4 Programmer’s Tutorial” by Borja Sotomayor.

Page 18: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.18

Grid service

• Broad meaning -- any service that conforms to interface conventions of a Grid computing infrastructure

• Narrow (current) meaning -- a service that conforms to WSRF

• Term seems to have lost favor – maybe because better to think of services in a Grid environment simply as regular Web services

Page 19: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.19

Stateful Web Services

• Obtained in WSRF by having a web service front-end to a stateful “resource.”

Page 20: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.20

Web Service

Resource

Resource properties

Client

Web Service Resource Framework(WSRF)

Holds information retained between accesses.

Page 21: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.21

WSDL file with WSRF

• Serves same purpose as WSDL file in web services – to define the service interface.

• A significant addition in the WSDL file is to specify the resource.

Page 22: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.22

Web Service

Resource

Resource properties

Client

Holds information retained between accesses.

WSDL fileincludes

specifying resource

Container

Page 23: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.23

“Stateful” web service example revisited• With a method to add a value to an

accumulating value:

Fig 7.4

Page 24: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.24

Service Interface

• If service implements operations on WSRF resource properties, WSDL will include definitions relating to resource property.

• Resource Properties structure described in WSDL file because this file describes how the properties must be exchanged in XML (between clients, services, etc.)

Page 25: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

WSDL fileResource property part

...

<!-- 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>

...

Page 26: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Resource Properties from Command Line

wsrf-query -s http//localhost/wsrf/ services/examples/core/rp/MathService

<ns1:MathResourceProperties

xmlns:ns1=”http://www.globus.org/namespaces/ examples/mathService_instance_rp”>

<ns1:Value>100</ns1:Value>

<ns1:LastOp>ADDITION</ns1:LastOp>

</ns1:MathResourceProperties>

Can also use wsrf-query to display specific resource property, rather than whole list.

7-1.26

Page 27: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.27

Other key issuesAddressing

• WSRF service needs an addressing mechanism that includes access to the resource

• Pure web services typically use URIs (URLs)

• WSRF service addressing defined in WS-addressing standard

– Uses an “endpoint reference”

Page 28: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.28

Endpoint ReferenceEPR

Includes both:

– Service address (URI)

and

– Resource identification (called a “key”)

Page 29: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.29

Endpoint Reference (EPR)

• Service URI + resource identifier (key)

Fig 7.5

Page 30: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

EPR - Web service without an associated resource

<wsa:EndpointReference>

<wsa:Address>

http://www.cs.uncc.edu/myWebService.jws

</wsa:Address>

</wsa:EndpointReference>

where <Address> tag is required.

prefix wsa is WS-Addressing namepace (http://www.w3.org/2005/08/addressing/wsdl)

7-1.30

Page 31: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

<wsa:EndpointReference>

<wsa:Address>

http://www.cs.uncc.edu/myWebService.jws

</wsa:Address>

<wsa:ReferenceParameters>

<myrp:ID> 234 </myrp:ID>

</wsa:ReferenceParameters>

</wsa:EndpointReference>

Resource ID specified within <ReferenceParameters>.

Not specified within WSDL document itself.

Separated out and obtained when EPR obtained7-1.31

EPR - Web service with an associated resource

Page 32: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-2.32

WS-Addressing Terms

Endpoint – the destination where the web service can be accessed.

Endpoint reference (EPR) – describes destination: includes destination location as URI, but can have other parameters like a key

Page 33: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-2.33

Endpoint reference, EPR

Like all WS-* specs, defined in terms of XML.

Defined as complex type. Can contain:• Address (a URI) (required)• Reference Properties• Reference Parameters• Port type• Service name• Policy elements

Corresponds to portType and service of WSDL document

Page 34: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-2.34

SOAP messageWS-Addressing standard requires that contents of: <wsa:Address> and <wsa:ReferenceProperties>must appear in SOAP’s header:

<soap:Envelop><soap:Header>... <wsa:To>http://www.cs.uncc.edu/axis/abw/Myservice.jws</wsa:To> <resourceID>234</resourceID>...</soap:Header>

<soap:Body>...</soap:Body>

</soap:Envelop>

Page 35: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.35

WSRF Framework• Actually collection of four specifications:

– WS-ResourceProperties• Specifies how resource properties are defined

and accessed– WS-ResourceLifetime

• Specifies mechanisms to manage resource lifetimes

– WS-ServiceGroup• Specifies how to group services or WS-

Resources together– WS-BaseFaults

• Specifies how to report faults

Page 36: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.36

WS-* Standards continuedAlso:

• WS-Notification– Collection of specifications that specifies how

configure services as notification producers or consumers

• WS-Addressing (where EPR is defined)– Specifies how to address web services.– Provides a way to address a web

service/resource pair

Page 37: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.37

Concrete example

Assignment 5Globus 4.0 Web Service

Assignment

This assignment is based upon a GT4 service described by Sotomayor and Childers (2006).

Page 38: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.38

Assignment Goals

• Show how stateful WSRF Web services can be created and deployed in Globus 4.0.

• Assignment is to be done on your own computer (or a lab computer).

• Requires you to install Globus 4.0 core and associated software – all available for download.

Page 39: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Installing software

Will need to have or install:

• JDK 1.4.2+• Ant 1.5.1+• Python 2.4+• Globus ws-core-4.0.+

and set environment variables (paths) accordingly as explained in assignment write-up.

Enjoy!

7-1.39

Page 40: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Disclaimer

• BE VERY CAREFUL NOT TO ALTER EXISTING PATHS ON YOUR COMPUTER.

• WE WILL NOT RESONSIBLE IF YOU DO NOT DO THINGS PROPERLY AND CAUSE PROBLEMS TO YOUR COMPUTER OPERATION.

4a.40

Page 41: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Testing installation

Start ContainerCommand:

globus-start-container -nosec

-nosec specifies “no security”, which simplifies assignment (no need for user certificates)

Will show list of deployed services.

7-1.41

Page 42: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Standard list of deployed services in core

7-1.42Fig 7.7

Page 43: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.43

Purpose of ServiceTo store an integer called value, which can be acted upon by three methods to:

• Add argument a to value, and• Subtract argument a from value• Get value

These methods given.Further methods will be implemented.Service is stateful (value retained between accesses).

Page 44: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Java Interface for service

public interface Math {

public void add(int a);

public void subtract(int a);

public int getValueRP();

}

7-1.44

Page 45: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.45

Resource PropertiesIn code provided, actually two resource properties:

• Value -- an integer acted upon by the operations:

– add– sub– getValueRP

• “Last operation performed” -- a string holding name of last operation done, “ADDITION” or “SUBTRACTION”, which is not used in assignment.

Page 46: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.46

Math Web Service

Resource

Resource properties“value”

(integer)

“last operationperformed”

(string)

Client

Resource Properties

Page 47: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.47

Steps in Assignment• Preliminary set-up

– Install GT4 and associated software

• Download provided files:– WSDL service interface file– Stateful Math web service code (in Java)– WSDD Deployment Descriptor file– Client code (java) to exercise service

• Build Math service– Package all files into an archive file (.gar)

• Deploy Math service into GT 4 container• Write and compile the client• Start container and execute client.

Easy!

Page 48: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.48

Final Step in Assignment

• Add functionality to service– Add multiple operation to Math service– Requires you to modify WSDL (by hand),

service code, and client code.– For that you will need to understand the files– Assignment Appendix gives details

Page 49: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.49

WSDL file

• Serves same purpose as WSDL file in Web services – to define the service interface.

• A significant addition in the WSDL file is to specify the resource.

Page 50: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.50

Globus-specific features of WSDL

• Resource properties – specified in portType attribute wsrp:ResourceProperties

• WSDL preprocessor used to include WSRF definitions (portType attribute wsdlpp:extends).

• Bindings (how abstract interface maps to concrete protocol messages) – not needed because automatically inserted by GT4 when built.

Page 51: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.51

<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" />

Namespaces

Name of service being implemented

WSDL file

Page 52: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.52

<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"/>

add method, argument int, returns a complex type

Page 53: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.53

<!-- 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>

Page 54: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.54

<!- M E S S A G E S --><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>

Input and output message for add method

Page 55: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.55

<!-- 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 56: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.56

Service Code

The code has two major parts:

• Resource properties

• Service code (methods)

which are combined into one file for this assignment.

Page 57: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.57

Service – Resource Propertiespublic class MathService implements Resource, ResourceProperties { private ResourcePropertySet propSet; /* Resource Property set */ private int value; private String lastOp; public MathService() throws RemoteException { /* RP Constructor */ this.propSet = new SimpleResourcePropertySet( MathQNames.RESOURCE_PROPERTIES); /* Create RP set */ try { /* Initialize the RP's */ 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()); }}

Resource Property code

Resource properties

Page 58: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.58

/* 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; }

Service – Resource Properties methods

Page 59: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.59

Service code - methods .

.

/* 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; }

.

.

add method

Page 60: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.60

Deploying a GT 4 service

• GT 4 container uses Apache Axis

• Basic steps for deploying a service similar in concept to that described for Apache Axis.

Page 61: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.61

Deployment files

•  server-config.wsdd (Web Service Deployment Descriptor) - contains information about the web service.

• jndi-config.xml (JNDI configuration file) - contains information about the resource management.

Page 62: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.62

<?xml version="1.0" encoding="UTF-8"?><deployment name="defaultServerConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  <service name="examples/core/first/MathService" provider="Handler" use="literal" style="document"> <parameter name="className"value="org.globus.examples.

services.core.first.impl.MathService"/> <wsdlFile>share/schema/examples/MathService_instance/

Math_service.wsdl </wsdlFile> <parameter name="allowedMethods" value="*"/> <parameter name="handlerClass“ value="org.globus.axis.providers.RPCProvider"/> <parameter name="scope" value="Application"/> <parameter name="providers" value="GetRPProvider"/> <parameter name="loadOnStartup" value="true"/> </service></deployment>

WSDD file

specifies where service will be located.

Page 63: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.63

ant(Another Neat Tool)

• A build tool used for building service– forming package of files for deployment– a gar file (grid archive file)

• ant similar to make program but dependencies specified using XML configuration files.

• Windows version of assignment uses Python.

Page 64: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.64

Generating GAR file with Ant

From http://gdp.globus.org/gt4-tutorial/multiplehtml/ch03s04.html

Page 65: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.65

GT 4 build commandglobus-build-service.sh first

where first is a file that contains required bash and ant files.

Windows Python version

globus-build-service.py first

Page 66: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.66

Deploying Service

Deployment done using GT4 command:

globus-deploy-gar gar_file

using the gar file created by globus-build-service.

Page 67: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.67

Start Container

Command:

globus-start-container -nosec

MathService will be listed as one of the services that are available once the container has started.

Page 68: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.68

GT4 container

Mathservice

Page 69: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.69

public class Client {public static void main(String[] args) {MathServiceAddressingLocator locator = new MathServiceAddressingLocator();

try {String serviceURI = args[0];EndpointReferenceType endpoint = new EndpointReferenceType();

endpoint.setAddress(new Address(serviceURI)); //service endpt ref.MathPortType math; math = locator.getMathPortTypePort(endpoint); // Get PortType math.add(10); // Perform an addition math.add(5); // Perform another addition System.out.println("Current value: " + math.getValueRP(new GetValueRP())); // Access value

math.subtract(5); // Perform a subtraction System.out.println("Current value: " + math.getValueRP(new GetValueRP())); // Access value

} catch (Exception e) {e.printStackTrace();

}}

Java client to invoke service

Page 70: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.70

Set CLASSPATH environment variable

To set CLASSPATH (Windows), use provided batch file:

%GLOBUS_LOCATION%\etc\globus-devel-env.bat

Then compile.

Page 71: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.71

Compile the ClientCompile client:

javac -classpath build\classes\org\globus\examples\services\core\first\impl\:%CLASSPATH% org\globus\examples\clients\MathService_instance\Client.java

 

Page 72: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.72

Execute ClientExecute client:

java -classpath build\classes\org\globus\examples\services\core\first\impl\:%CLASSPATH% org.globus.examples.clients.MathService_instance.Client http://localhost:8080/wsrf/services/examples/core/first/MathService

You will see the following result (hopefully): Current value: 15 Current value: 10 

Page 73: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.73

Undeploy sevice

Deploy service in preparation to modifying it.

Command:

globus-undeploy-gar

with named gar file.

Page 74: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.74

Extend Functionality of Service

Add a multiply method to your Math Service.

Repeat all the steps to test it.

Page 75: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.75

Acknowledgment

This assignment is derived from the book:

“Globus Toolkit 4 Programming Java Services” by Borja Sotomayor and Lisa Childers, Morgan

Kaufmann, 2006

see: http://gdp.globus.org/gt4-tutorial/ for on-line version.

Page 76: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Multiple-choice questions

7-1.76

Page 77: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.77

What is a stateless Web service?

(a) A Web service that cannot remember prior events

(b) A Web service without local variables

(c) A Web service that is not associated with a particular state in the country

(d) A Web service that can remember prior events

SAQ 7-1

Page 78: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

What is a non-transient service?

(a) An instance of a service that does not receive data

(b) An instance of a service that outlives its client

(c) An instance of a service that generates stateful data

(d) An instance of a service that generates stable data

7-1.78SAQ 7-2

Page 79: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

What is the Open Grid Services Architecture (OGSA)?

(a) A standard for defining a structure for interoperable Grid computing services but not its implementation

(b) A standard for defining a structure for interoperable Grid computing services that includes its implementation

(c) An open source implementation of Grid computing middleware

(d) A Grid computing environment that is open to all

7-1.79SAQ 7-3

Page 80: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

What is the WS-Resource Framework (WSRF)?

(a) A way of connecting a Web service to a resource without specifying its implementation

(b) A framework for Web service reliability

(c) A standard that provides for Web services embedded within a computing resource

(d) A standard that provides for stateful Web services

7-1.80SAQ 7-5

Page 81: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.81

When one issues the command:

globus-start-container -p 8081 -nosec

what does one see?

(a) 10 pages of errors messages

(b) Nothing because the -p option with port 8081 cannot be used with -nosec (no security)

(c) A list of services deployed by all users in the container

(d) A message that states whether port 8081 can be used without Globus security

(e) A list of the services that only you have deployed in the container

SAQ 7-6

Page 82: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

Name one basic difference between a Web service and a WSRF Grid service.

(a) No differences

(b) A Grid service is accessed from a Grid

(c) A Grid service is designed to be stateful

(d) The connections between Web services are in the form of a Web and the connections between Grid services are in the form of a Grid

7-1.82SAQ 7-8

Page 83: 7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb

7-1.83

Questions