1、A Brief Introduction to Grid Services,Yogesh L. SimmhanExtreme! Computing LabComputer Science DepartmentIndiana University,Extreme! Computing Lab Computer Science Dept., Indiana University,What are Grid Services?,Grid Computing Share information and processing capacities on Grid Resources Network-en
2、abled entity that provides specific capability Interact with it using Messages Response behavior based on Service State Simple Internet Based Standards (XML, HTTP) for Interoperability Web Services with additional features HTTP, SOAP, XML, (G)WSDL,Extreme! Computing Lab Computer Science Dept., India
3、na University,Grid Services Vs. Web Service,Transient in Nature (Lifetime, Migration) Stateful Service Service Data Elements (SDE) Introspection GWSDL Vs. WSDL Service Data Definitions PortType (=Interface) Inheritance Standard Required Interfaces for all Services Lifetime Management Service Data In
4、teraction Interfaces Predefined for Common Services,Extreme! Computing Lab Computer Science Dept., Indiana University,The OGSI Specification,Open Grid Services Infrastructure (v1.0) Global Grid Forum Standard Grid Service PortType Factory PortType Service Creation Handle Resolver Dynamic Location Lo
5、okup Grid Service Handle (http:/extreme/gannon/foo-service) Grid Service Reference (http:/rainier:8080/foo-service) Service Group Register Service Metadata Entry = Metadata Content + Service Location Notification PortType Messaging service Web-Services Resource Framework (WSRF),Extreme! Computing La
6、b Computer Science Dept., Indiana University,Grid Service Pattern,SDE:http:/extreme/services/foo/my-servicemyContent,GSH = http:/extreme/services/service-registry GSR (URL) = http:/rainier:20202/service-registry,Service Group Registry,My Grid Service,GSH = http:/extreme/services/foo/my-service GSR (
7、URL) = http:/ooty:8080/foo-service,Handle Resolver,GSH = http:/extreme/services/handle-resolver GSR (URL) = http:/rainier:10101/handle-resolver,1,2,4,3,5,6,Add Mapping: http:/extreme/services/service-registry http:/rainier:20202/service-registry,Start Handle Resolver Service,Start Registry Service,S
8、tart Your Grid Service,Add Mapping: http:/extreme/services/foo/my-service http:/ooty:8080/foo-service,Register Metadata Content about your service and the GSH (http:/extreme/services/foo/my-service),Entry SDE created for your service,7,Extreme! Computing Lab Computer Science Dept., Indiana Universit
9、y,Get all Entries about services. Returns Metadata Content and the GSH (http:/extreme/services/foo/my-service),SDE:http:/extreme/services/foo/my-servicemyContent,Grid Service Client Pattern,GSH = http:/extreme/services/service-registry GSR (URL) = http:/rainier:20202/service-registry,Service Group R
10、egistry,My Grid Service,GSH = http:/extreme/services/foo/my-service GSR (URL) = http:/ooty:8080/foo-service,Handle Resolver,GSH = http:/extreme/services/handle-resolver GSR (URL) = http:/rainier:10101/handle-resolver,Select your service and get GSR for GSH http:/extreme/services/foo/my-service. Retu
11、rns http:/ooty:8080/foo-service.,Client,3,2,Handle Resolver URL = http:/rainier:10101/handle-resolver Your Service Handle = http:/extreme/services/foo/my-service OR locate from Registry GSH = http:/extreme/services/service-registry,4,Invoke method on service,Get GSR for registry GSH http:/extreme/se
12、rvices/service-registry. Returns http:/rainier:20202/handle-resolver,1,Introduction to Grid Services eXtensions (GSX),Extreme! Computing Lab Computer Science Dept., Indiana University,What is GSX?,Implementation of OGSI v1.0 Specification Lightweight Grid Services Document as a Service? Experiment o
13、n Scalable Services Make it Simpler to write Grid Services Predefined Interfaces and Implementations of Standard Grid Services (Resolver, Registry) Make it easier to run Grid Services No starting Apache Tomcat HTTP Servers and deploying each service,Extreme! Computing Lab Computer Science Dept., Ind
14、iana University,Web Services Utility Library (WSUL),A.k.a. XSUL Alek Slominski Mini HTTP Server Extensible Add a stack of Message Processors SOAP Message Processing Message Routing XML Signature Processing Client side SOAP Message Invocation Gives RPC view of XML document exchange,Extreme! Computing
15、 Lab Computer Science Dept., Indiana University,WSUL,HTTP (Mini) Server,SOAP Message Router,HTTP POST,HTTP GET/PUT,HTTP (Mini) Servlet,Chain,Inter- face A,Inter- face B,Inter- face N,GSX GridServiceImplB,User Impl ClassA,User Impl ClassN,WSUL,Service Invoker Proxy,Interface A,XML Sign. & Authorizati
16、on,SOAP RPC Invoker,HTTP Invoker,GSX Client Library,User Client,HTTP on the Wire (TCP/IP),GSX/WSUL Communication Stack,Extreme! Computing Lab Computer Science Dept., Indiana University,PortTypes implemented in GSX,Grid Service PortType GridServiceImpl.java Manage SDEs Manage Service Lifetime Handle
17、Resolver PortType HandleResolverImpl.java Adding and Querying GSR-GSH Mappings In-memory and Persistent (MySQL) versions Service Group Registry ServiceGroup*Impl.java Adding and Querying Service Metadata Entries In-memory and Persistent (Xindice XML DB) versions Extend GridServiceImpl and you have a
18、 Grid Service! Samples for starting Handle Resolver and Service Group are available,Extreme! Computing Lab Computer Science Dept., Indiana University,Managing Service Data Elements,XML Metadata that describes the services properties and state GridService Predefined Service Data Elements Interface, S
19、erviceDataName, GridServiceHandle, GridService Reference User Defined Service Data Elements Any XML Document can be added Service Data Manager available to manage SDEs In-memory and Persistent (Xindice XML DB) versions Use SDM from within your code and SDEs are automatically available through GridSe
20、rviceImpl,Extreme! Computing Lab Computer Science Dept., Indiana University,Document and RPC Styles,Services methods can have RPC or Document style int sum(int j, int k) return j + k; SumResponseDoc sum(SumRequestDoc) . Invoke Services using RPC or Documents int j=5, k=6; int i = sumServiceInvoker.s
21、um(j, k); (i = 11) SumRequestDoc = 5 6 SumResponseDoc = DocInvoker.invoke(SumRequestDoc) (SumResponseDoc = 11)Even RPC style converts request to XML, but transparent to user (sumServiceInvoker) Document style useful when methods have to follow an XML Schema (e.g. OGSI Schema) RPC style useful for us
22、er defined methods,Extreme! Computing Lab Computer Science Dept., Indiana University,Grid Client Utility,Grid Service PortTypes use document style Expect and return XML Documents Grid Client Utility gives RPC view of common Grid Service methodsWrap parameters into XML and unwrap responses Can overri
23、de and call Grid Service methods directly using a document invoker,Extreme! Computing Lab Computer Science Dept., Indiana University,XML Beans,All OGSI methods, parameters, service data elements have XML schema GSH looks like someURI XML Beans gives Java Object view of XML Documents String gsh = gri
24、dServiceHandle.getHandle(); Get and set methods for all elements and attributes in XML Document Can compile any XML Schema into XML Beans Object classes You can pass complex types in GSX only as XML Bean Objects!,Extreme! Computing Lab Computer Science Dept., Indiana University,Security XML Signatur
25、e and SAML,WSUL provides an XML Signature module Client canonicalizes the SOAP Body and puts its Digital Signature in the header Verify signature at Service end and authenticate message Security Assertion Markup Language (SAML) used for Authorization Self contained signed tokens in header used to authorize the message request,Extreme! Computing Lab Computer Science Dept., Indiana University,Downloading and Using GSX,http:/www.extreme.indiana.edu/xgws/GSX Download - Distribution - GSX_1.0_RC_1_all.zip$GSX_HOME/docs/index.html faq.html service_model.html,Questions?,