Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Notes adapted from Barry Wilkinson Grid Computing Course UNCC Web Service Resource Framework Creating Globus 4 services.

Similar presentations


Presentation on theme: "1 Notes adapted from Barry Wilkinson Grid Computing Course UNCC Web Service Resource Framework Creating Globus 4 services."— Presentation transcript:

1 1 Notes adapted from Barry Wilkinson Grid Computing Course UNCC Web Service Resource Framework Creating Globus 4 services

2 2 Grid Computing Using distributed computers and resources collectively. Usually associated with geographically distributed computers and resources on a high speed network. Often about teams sharing resources.

3 3 But grid computing can be more than this. It offers the potential of virtual organizations –groups of people both geographically and organizationally distributed working together on problems, sharing computers AND other resources such as databases and experimental equipment.

4 4 Some “Computational” Grid Projects Large Hadron Collider experimental facility for complex particle experiments at CERN (European Center for Nuclear Research, near Geneva Switzerland). DOE Particle Physics Data grid DOE Science grid AstroGrid Project Comb-e-Chem project

5 5 TeraGrid

6 6

7 7 Grid computing With the use of the Internet interconnection technology, implementation now based upon Internet technologies. Now uses a form of web services. Enables using existing protocols, security mechanisms, etc.

8 8 Web Services Software components designed to provide specific operations (“services”) accessible using standard Internet technology. For machine interaction over a network. Usually through SOAP (simple Object Access Protocol) messages carrying XML documents, and a HTTP transport protocol.

9 9 Basic client-server model

10 10 Key aspects Has similarities with RMI and other distributed object technologies (CORBA etc.) but:: Web Services are platform independent – They use XML within a SOAP message). – Most use HTTP to transmit message.

11 11 XML Tags Not predefined as in HTML. Must define your own tags using names as names in a programming languages As in programming languages, restrictions. Case sensitive. Start with a letter. “Elements” have start and end tags. Start tags can have attributes as in HTML.

12 12 Additional XML materials On-line materials W3C consortium home page: http://www.w3.org/XML/ W3Schools XML Tutorial : http://www.w3schools.com/xml/

13 13 Address of a Web Service URIs Example (URL) http://www.cs.wcu.edu/webservices/math1 This does not exist, and if did, would only be meaningful to software.

14 14 Web Service Application

15 15 Steps Client calls client stub. SOAP request sent across network Server stub receives request and sends request to service Service send result to serve stub Server stub sends result across network to client stub. Client stub sends result to client.

16 16 Web Service Application Call client stub SOAP request Request service Result returned SOAP response Client receives result

17 17 Web Service Definition Language (WSDL) A W3C standard XML document that describes three fundamental properties of a service: What it is - operations (methods) it provides. How it is accessed - data format, protocols. Where it is located - protocol specific network address.

18 18 Parts of a WSDL Document Parts of an WSDL document:: Root definitions - namespaces portType definitions - abstract definition of service Message definitions - parameters in method signature Type definitions - data types Binding definitions - to protocols I.e. SOAP over HTTP Service definitions - where service is, ports

19 19 Grid service The Global Grid Forum (GGF) developed standard interfaces, behaviors, core semantics, etc. for grid applications based upon web services. GGF introduced the term Grid Service as an extended web service that conforms to the GGF OGSI standard.

20 20 Globus Toolkit An implementation of the Open Grid Services Infrastructure (OGSI) standard, developed at Argonne National Laboratory and the University of Chicago Used in virtually all grids today We will be using Globus Toolkit 4 (GT4)

21 21 GT 4 services Key aspect is the separation of the (web) service and a resource – conceptually if not actually. Provides the ability to have “state” without altering the statelessness of a web service.

22 22 Web Service Resource Resource properties Client Web Service Resource Framework (WS-RF) Holds information retained between accesses.

23 23 WSRF Programming Assignment Goal: To store an integer value which can be acted upon by methods to: Get its value Increment its value (add one), and Decrement its value (subtract one). The service is stateful (the value is retained between accesses).

24 24 Resource Properties In the code provided in the assignment, there are actually two resource properties: Value -- an integer acted upon by the operations: add, sub, and getValueRP and “Last operation performed” -- a string holding the name of the last operation done, addition or subtraction, which is not used in assignment 2

25 25 Math Web Service Resource Resource properties “value” (integer) “last operation performed” (string) Client Assignment Resource Properties

26 26 Key XML files needed for implementing service WSDL file – defines the service interface. Deployments files: –WSDD deployment file –JNDI deployment file

27 27 Steps in the assignment 0. Setting up the environment 1.Defining the interface in WSDL 2.Implementing the service in Java 3.Configuring the deployment in WSDD 4.Build the Math service (Create a GAR file) 5.Deploy the Math service 6.Write and compile the client 7.Start the container and execute the client All of the above steps are mostly done for you! 8.Add functionality to the service

28 28 Running the tutorial An illustration of running the tutorial on your Windows computer can be found at: http://csce.uark.edu/~aapon/courses/clu ster/homework/tutorial.doc http://csce.uark.edu/~aapon/courses/clu ster/homework/tutorial.pdf

29 29 WSDL file used for GT 4 service in the programming assignment

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

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

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

33 33

34 34 <portType name="MathPortType" wsdlpp:extends="wsrpw:GetResourceProperty" wsrp:ResourceProperties="tns:MathResourceProperties">

35 35 Service Code The code has two major parts: Resource properties Service code (methods) which are combined into one file for this assignment.

36 36 Service – Resource Properties public 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

37 37 Resource and ResourceProperty interfaces Resource – a way of tagging a class as being a resource. This interface does not require any methods. ResourceProperty – interface representing a single resource property ReflectionResourceProperty -- A GT4 class, one of the ways one can represent a resource property in GT 4.

38 38 /* 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

39 39 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; } /* Required by interface ResourceProperties */ public ResourcePropertySet getResourcePropertySet() { return this.propSet; }

40 40 Deploying a GT 4 service The GT 4 container uses Apache Axis A Java container for executing a Java servlet

41 41 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.

42 42 GT 4 build command globus-build-service Contains bash and ant files, see globus service build tools: http://gsbt.sourceforge.net

43 43 Step 8: Extend the Functionality of the Service This is your assignment! Add a multiply method to your Math Service. Repeat all the steps to test it.

44 44 More Information GGF: http://www.ggf.org GT4 services tutorial: http://gdp.globus.org/gt4-tutorial/ (Slides and assignment based upon this tutorial) GT4 tutorial by Foster: http://www.globus.org/toolkit/docs/4.0/key/GT4_Primer_0.6.pdf


Download ppt "1 Notes adapted from Barry Wilkinson Grid Computing Course UNCC Web Service Resource Framework Creating Globus 4 services."

Similar presentations


Ads by Google