1 / 48

Creating Globus 4 Services: Notes from Barry Wilkinson Grid Computing Course

This resource provides an overview of grid computing, its benefits in terms of performance and collaboration, and the examples of grid computing projects such as Large Hadron Collider and TeraGrid. It also discusses the concept of utility computing and the use of web services in grid computing.

chelen
Download Presentation

Creating Globus 4 Services: Notes from Barry Wilkinson Grid Computing Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Grid Computing • Achieving greater performance by pooling together (aggregating) resources from different organizations/ geographically distributed • Example: processing and storage need of Large Hadron Collider: • 10 Petabytes per year, • 100,000 high-end CPU • Difficulties: heterogeneous resources, allocation, access, policies, security …

  3. Grid computing is not only about high performance, but also about collaboration and resource sharing. 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. The vision/ the name • Does everybody generate electricity? • No. Plug into the “electric power grid”. • Need more computational power, more storage etc.? • Plug into “a grid”. • Fine introduction at gridcafe.web.cern.ch/gridcafe

  5. eScience eScience [n]: Large-scale science carried out through distributed collaborations—often leveraging access to large-scale data & computing

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

  7. TeraGrid

  8. TeraGrid

  9. Applications • Originally e-Science applications • Computational intensive • Not necessarily one big problem but a problem that has to be solved repeatedly with different parameters. • Data intensive. • Experimental collaborative projects • Now also e-Business applications to improve business models and practices.

  10. switchfabric compute storage Utility ComputingOne of Several Commercial Drivers computing utility or GRID virtual data center value programmable data center UDC grid-enabled systems • Utility computing • On-demand • Service-orientation • Virtualization Tru64, HP-UX, Linux clusters Open VMS clusters, TruCluster, MC ServiceGuard today shared, traded resources I. Foster (Based on a slide from HP)

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

  12. Background: 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.

  13. Basic client-server model

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

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

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

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

  18. Web Service Application

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

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

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

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

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

  24. 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)

  25. Stateless (WS) vs. stateful (WSRF) • Web services as created in assignment 1 are stateless. • Stateful web services required for grid computing. • Obtained in WS-RF by having a web service front-end to a stateful “resource.”

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

  27. 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).

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

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

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

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

  32. Running the tutorial • See illustration of running the tutorial (on your Windows computer) on the web

  33. WSDL file used for GT 4 service in the programming assignment

  34. <?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" />

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

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

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

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

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

  40. Service – Resource Properties 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

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

  42. Service – Resource Properties methods /* 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; }

  43. 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; }

  44. Deploying a GT 4 service • The GT 4 container uses Apache Axis • A Java container for executing a Java servlet

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

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

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

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

More Related