Presentation is loading. Please wait.

Presentation is loading. Please wait.

4a.1 Grid Computing Infrastructure Software ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 16, 2007,

Similar presentations


Presentation on theme: "4a.1 Grid Computing Infrastructure Software ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 16, 2007,"— Presentation transcript:

1 4a.1 Grid Computing Infrastructure Software ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 16, 2007,

2 4a.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

3 4a.3 Standards Bodies For Internet, world wide web, and grid computing: W3C consortium (Worlds Wide Web Consortium) –Working on standardization of web-related technologies such as XML, see http://www.w3.org OASIS (Organization for the Advancement of Structured Information Standards) IETF (Internet Engineering Task Force) DMTF (Distributed Management Task Force) Global Grid Forum (GGF) – principal grid computing body –Started in 1998 –Meets three times a year, GGF1, GGF2, GGF3 … –More than 40 organizations involved and growing …

4 4a.4 Standards in Web Services World XML introduced (ratified) in 1998 SOAP ratified in 2000 Web services developed Subsequently, standards are continuing to be developed: –WSDL –WS-* where * refers to names of one of many standards

5 4a.5 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).

6 4a.6 (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.

7 4a.7 Simple previous web service example Web service MyMath with a method to square an argument and return its value: public class MyMath {... public int square(int x) { return x * x; }... } Web service x x2x2 Request Result Client Nothing stored permanently

8 4a.8 “Stateful” web service example With a method to add a value to an accumulating value and return its value: public class MyMath {... public void add(int x) { value += x; }... private int value; } Web service +3 Request value = 7 (if value had held 4) Client Value kept between invocations

9 4a.9 Example with a “database” resource The Grid 2: Blueprint for a new Computing Infrastructure, Ian Foster, Carl Kesselman and Steve Tuecker Editors, Morgan Kaufmann 2004 -- Chapter 17: “The Open Grid Service Architecture,” by Ian Foster, Carl Kesselman and Steve Tuecker.

10 4a.10 In this example, the client accesses a file transfer service to perform actions such as transfer a file from one storage service to another. 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.

11 4a.11 Open Grid Services Architecture (OGSA) Originally described in paper: “The Physiology of the Grid” http://www.globus.org/research/papers/ogsa.pdf Grid computing standard announced 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.

12 4a.12 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 web service WDSL to enable state to be specified, using a modified WDSL language called GWSDL (“grid web definition language”), Introduced term “grid service.” Implemented in GT3.

13 4a.13 Open Grid Service Infrastructure (OGSI) Not found acceptable by the community at large because: –It significantly modified pure web service approach –Required new tools. –Too object oriented in approach.

14 4a.14 WS-Resource Framework A specification developed by OASIS, essentially to replace OGSI and make the 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.

15 4a.15 “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

16 4a.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

17 4a.17 From “The Globus Toolkit 4 Programmer’s Tutorial” by Borja Sotomayor.

18 4a.18 Stateful Web Services Obtained in WSRF by having a web service front-end to a stateful “resource.”

19 4a.19 Web Service Resource Resource properties Client Web Service Resource Framework (WSRF) Holds information retained between accesses.

20 4a.20 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.

21 4a.21 Web Service Resource Resource properties Client Holds information retained between accesses. WSDL file includes specifying resource Container

22 4a.22 “Stateful” web service example revisited With a method to add a value to an accumulating value and return its value: public class MyMath {... public void add(int x){ value += x; }... } Stateless Web service +3 Request value =7 (if value had held 4) Client Stateful Resource public int value;

23 4a.23 Service Interface If service implements operations on WSRF resource properties, WSDL will include definitions relating to resource property.

24 4a.24 Other key issues Addressing 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”

25 4a.25 Endpoint Reference EPR Includes both: –Service address (URI) and – Resource identification (called a “key”)

26 4a.26 Endpoint Reference (EPR) Service URI + resource identifier (key) public class MyMath {... public void add(int x) { value += x; }... } Stateless Web service Request using EPR Client Stateful Resource public int value; Identify service by URI Identify resource by a key (a number)

27 4a.27 WSRF Framework 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

28 4a.28 WS-* Standards continued Also: WS-Notification –Collection of specifications that specifies how configure services as notification producers or consumers WS-Addressing –Specifies how to address web services. –Provides a way to address a web service/resource pair

29 4a.29 Concrete example Assignment 4 “Simple” Grid Services Assignment

30 4a.30 Assignment Goals Show how stateful WS-RF web services can be created using Globus 4.0

31 4a.31 Purpose of Service 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). These methods are given. Further methods will be implemented. The service is stateful (the value is retained between accesses).

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

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

34 4a.34 Steps in Assignment 4 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 so far!

35 4a.35 Final Step in Assignment 4 Add functionality to service –Add multiple operation to Math service –Requires you to modify WSDL, service code, and client code. –For that you will need to understand the files –Assignment Appendix gives details

36 4a.36 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.

37 4a.37 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.

38 4a.38 <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

39 4a.39 <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"> add method, argument int, returns a complex type

40 4a.40 <xsd:element ref="tns:Value“ minOccurs="1“ maxOccurs="1"/> <xsd:element ref="tns:LastOp“ minOccurs="1“ maxOccurs="1"/>

41 4a.41 Input and output message for add method

42 4a.42 <portType name="MathPortType" wsdlpp:extends="wsrpw:GetResourceProperty" wsrp:ResourceProperties="tns:MathResourceProperties">

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

44 4a.44 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

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

46 4a.46 /* 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

47 4a.47 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; } add method

48 4a.48 Deploying a GT 4 service GT 4 container uses Apache Axis and the basic steps for deploying a service are similar in concept to that described for Apache Axis.

49 4a.49 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.

50 4a.50 <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"/> share/schema/examples/MathService_instance/ Math_service.wsdl <parameter name="handlerClass“ value="org.globus.axis.providers.RPCProvider"/> WSDD file specifies where service will be located.

51 4a.51 JNDI deployment file <resource name="home“ type="org.globus.wsrf.impl.ServiceResourceHome"> factory org.globus.wsrf.jndi.BeanFactory

52 4a.52 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.

53 4a.53 Generating GAR file with Ant From http://gdp.globus.org/gt4- tutorial/multiplehtml/ch03s04.html

54 4a.54 GT 4 build command globus-build-service.sh service_name Contains bash and ant files, see globus service build tools (http://gsbt.sourceforge.net) Python version globus-build-service.py service_name ]

55 4a.55 In assignment 4b (Linux server version), GT4 command (script): globus-build-service.sh is embedded in a script: build.sh which also includes a script called: nameChangeScript to rename student files to make them each unique.

56 4a.56 Deploying Service Deployment done using GT4 command: globus-deploy-gar using gar file created by globus-build- service.

57 4a.57 Start Container Command: globus-start-container -nosec -nosec specifies “no security”, which simplifies assignment (no need for user certificates) MathService will be listed as one of the services that are available once the container has started.

58 4a.58 GT4 container Mathservice

59 4a.59 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

60 4a.60 Set CLASSPATH environment variable To set CLASSPATH (Windows): %GLOBUS_LOCATION%\etc\globus-devel-env.bat Then compile.

61 4a.61 Execute Client Execute client: javac -classpath build\classes\org\globus\examples\services\cor e\first\impl\:%CLASSPATH% org\globus\examples\clients\MathService_insta nce\Client.java You will see the following result (hopefully): Current value: 15 Current value: 10

62 4a.62 Undeploy sevice Deploy service in preparation to modifying it. Command: globus-undeploy-gar with named gar file.

63 4a.63 Extend Functionality of Service Add a multiply method to your Math Service. Repeat all the steps to test it.

64 4a.64 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.

65 4a.65 Quiz 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 which can be located anywhere in the country. (d) An illegal web service.

66 4a.66 What does one see when one issues the command: globus-start-container –p 8081 –nosec (a) 10 pages of error messages. (b) A list of services deployed by all users. (c) The available ports one can use. (d) A list of the services that only you have deployed.

67 4a.67 Questions


Download ppt "4a.1 Grid Computing Infrastructure Software ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 16, 2007,"

Similar presentations


Ads by Google