Presentation is loading. Please wait.

Presentation is loading. Please wait.

Containers and Web Services Grid Middleware 7 David Groep, lecture series 2005-2006.

Similar presentations


Presentation on theme: "Containers and Web Services Grid Middleware 7 David Groep, lecture series 2005-2006."— Presentation transcript:

1 Containers and Web Services Grid Middleware 7 David Groep, lecture series 2005-2006

2 Grid Middleware VII2 Outline Why web services? Web services revisited  SOAP, WS-I basic profile, encoding styles  Envelope versus body Containers  why containers  pluggable frameworks (e.g. the GT4 security stuff)  some leaky abstractions: file ACLs in the (Globus) RLS Implementing grid middleware  where to put the abstractions (crunching paper stuff)  is stuff in the envelope really standard?  syntax vs. semantics of the interface Performance: Java, C, Python,.NET

3 Grid Middleware VII3 Why web services came about in grid The definition of WSRF means that the Grid and Web services communities can move forward on a common base.

4 Grid Middleware VII4 Web Services WS are just one implementation of a SOA  we could have done ASN.1 over BEEP over avian carriers (which might even have been faster )  but we don’t, to help interoperation Web services are basically RPC using XML  largely self-describing

5 Grid Middleware VII5 Web Services hints Web Services are just a syntax  Define proper sementics and document that to make your service re- useable  Match up the semantics with related services  Make sure your services are compliant  with relevant standards (like WS-I Basic Profile)  with the chosen hosting system (GT4)

6 WSDL Styles thanks to the EGEE WS tutorial…

7 Grid Middleware VII7 Types of WSDL SOAP binding RPC/encoded RPC/literal Document/encoded Document/literal

8 Grid Middleware VII8 Java method example public void myMethod (int x);

9 Grid Middleware VII9 RPC/Encoded WSDL Binding is RPC/encoded

10 Grid Middleware VII10 SOAP message value

11 Grid Middleware VII11 Advantages/disadvantages Advantages  Simple WSDL  Operation name appears in the message Disadvantages  Type encoding information overhead  SOAP message cannot be validated except against WSDL

12 Grid Middleware VII12 RPC/Literal WSDL Binding is RPC/literal

13 Grid Middleware VII13 SOAP message value

14 Grid Middleware VII14 Advantages/Disadvantages Advantages  WSDL is simple  Operation name appears in the message  Type encoding information is minimal Disadvantages  Nearly all the definitions in WSDL so not independently validatable

15 Grid Middleware VII15 Document/encoded Not implemented !

16 Grid Middleware VII16 Document/literal WSDL

17 Grid Middleware VII17 SOAP message value

18 Grid Middleware VII18 Advantages/Disadvantages Advantages  No type encoding information  The body of the soap message is all defined in a schema and so can be validated independently Disadvantages  WSDL is more complicated  Operation name is lost

19 Grid Middleware VII19 Document/wrapped WSDL WSDL schema has a wrapper around the parameters

20 Grid Middleware VII20 SOAP message value

21 Grid Middleware VII21 Characteristics Input message has a single part Part is an element Element has the same name as the operation Element’s complex type has no attributes

22 Grid Middleware VII22 Advantages/disadvantages Advantages  No type encoding information  Soap body is defined in a schema – validation  Method name in the soap message Disadvantages  WSDL is complicated Generally this is the best style to use.

23 Grid Middleware VII23 When not to use document/wrapped Document literal wrapped style does not allow for overloading Cannot have two elements with the same name in XML (element has to have same name as operation) In this case you may wish to use RPC/literal so that the operation name is available.

24 Grid Middleware VII24 SOA Editor Cape Clear SOA Editor, Cape Clear 2003 WSDL © EGEE Consortium and partners, see www.gLite.org

25 Deploying web services Containers and invocation

26 Grid Middleware VII26 Container A framework to accept, interpret, (de-)marshall the I/O for your application or service

27 Grid Middleware VII27 Container Various vendors  Oracle Application Server  SUN Application Server  IBM WebSphere  Apache Catalina/Tomcat  Apache Axis .NET although the WS on the outside may be the same, tools and interface on the business end vary

28 Grid Middleware VII28 Containers Many containers, but not all the same Vary in what they support, e.g.,  Platform: JVM,.NET, Unix  Language (Java, C, Python)  WSDL bindings (rpc or document/literal)  Security mechanisms (none or GSI) VL-e supplied container GT4 (Axis 2.0-RC2++)  Modified to do WS-RF, -Addressing, -Notification  With GSI Security framework  Almost like standard Axis 2

29 Grid Middleware VII29 Data structures All data structures in the language (Java, C, &c) need to be serialized Easy when you stick to: Global types (int, double, String, array etc.) Java beans (set and get methods) Otherwise need write custom serializers  commands like WSDL2Java generate (amonst other things) stubs to fill with the serialization code slide source: Machiel Jansen, Vrije Universiteit Amsterdam: VL-e web services induction 2006

30 Grid Middleware VII30 Wrapping existing application Define input and output of the application  write the appropriate WSDL Generate the Java stubs Execute application from Java Redirect the output Deploy as webservice slide source: Machiel Jansen, Vrije Universiteit Amsterdam: VL-e web services induction 2006

31 Grid Middleware VII31 Wrapping existing application public int run(String cmd, Writer out) throws IOException { RunTime r = Runtime.getRuntime(); Process p = r.exec(cmd); FileIO.copyFile(new InputStreamReader(p.getInputStream( )), out, true); try { p.waitFor( ); // wait for process to complete } catch (InterruptedException e) { return -1; } return p.exitValue( ); } slide source: Machiel Jansen, Vrije Universiteit Amsterdam: VL-e web services induction 2006

32 Grid Middleware VII32 WS Clients – 3 types Stub based (easy: use WSDL2Java ) Service endpoint is static Dynamic proxy Service endpoint dynamically at runtime Dynamic Invocation Interface (DII) Discover services at runtime then invoke methods slide source: Machiel Jansen, Vrije Universiteit Amsterdam: VL-e web services induction 2006

33 Grid Middleware VII33 Clients - DII Axis user guide uses Call object (DII) in examples. WSRF and GT4 examples uses stubs. slide source: Machiel Jansen, Vrije Universiteit Amsterdam: VL-e web services induction 2006

34 Grid Middleware VII34 WSRF and GT4 GT4 uses the WSCore library. http://www-128.ibm.com/developerworks/edu/gr-dw-gr-eclipseide-i.html Notes: GT4 WSRF is a little different from Apache WSRF GT4 uses GAR files and JNDI deployment. Eclipse has a GT4 plugin… slide source: Machiel Jansen, Vrije Universiteit Amsterdam: VL-e web services induction 2006

35 Grid Middleware VII35 Moving into the container GT4 puts most of the grid elements in the container  support for resource properties  support for the AuthZ framework  information system/MDS4  … makes application service development easier  if the service is independent of those features  otherwise, lots of callouts are needed as in the RLS security interface from lecture #6

36 Grid Middleware VII36 Container capabilities Axis 1.x, x<2  support RPC/encoded  deployment of services requires restart Axis 1.3  support Document/literal  still no hot deployment GT4  Like Axis 1.3, but with grid services built-in, WS-RF support Tomcat5, Axis2  hot deployment of services  WS-RF, WS-Notification, WS-Addressing in the pipeline somewhere Sun & Oracle Application Server  Hot deployment supported

37 Grid Middleware VII37 Implementation Remember that web services are stateless  Model state via Resources  Don’t keep running after the service invocation is complete  Use database/memory based storage, not process-based state retention  Much more friendly on the CPU  Resilient to machine/VM restarts The ultimate horror scenario: R-GMA producer & consumer threads, see Concurrency P&E paper on the web

38 Using containers

39 Grid Middleware VII39 Container deployment issues Container needs inbound connectivity to get to the services most sites & compute clusters provide only outbound connectivity how to get to the service? proxy box inside the network perimeter  needs specific site support  opens a security hole in the perimeter a better protocol  unlikely that beep will ever replace http … tunnel  layer on top of protocols like, e.g., jabber, and push messages through that with a proxy box overlay network  build a ‘quasi-VPN’ for your grid, e.g. using the GCB

40 Grid Middleware VII40 Typical Facility topology

41 Grid Middleware VII41 Service Deployment Example Farm of GT4 containers provided on the edge of the site  Based on the concept of “VO Boxes”  For now: login to these boxes via gsissh  Not for compute-intensive work You cannot run a container continuously on worker nodes  No inbound IP connectivity  Resource management and utilization And you should not want to, because  All services in a container content for CPU and (disk) bandwidth  JVM does not insulate services from each other

42 Grid Middleware VII42 Other constraints Worker nodes are allocated in a transient way  Jobs run in a one-off scratch directory  No shared file system for $HOME (and if it happens to be there don’t use it!)  Jobs will be queued  Short jobs get to run faster  Small jobs get to run faster  Priority depends on your VO affiliation  You can connect out, but cannot listen  Your job is limited in wall time

43 Grid Middleware VII43 Central Hosting A hosting environment can offered on a set of edge boxes  Visible from the outside world  Highly monitored systems for security reasons  Can talk to the ‘inside’ Requirements for deployment on the CF  Appropriate AuthN/AuthZ must be used for all services (this is available by default in GT4)  Allow for request tracability (e.g. via log files)  then, these services are allowed to talk to the ‘inside’

44 Wrapping Making the world into a service

45 Grid Middleware VII45 Some general caveats Re-use services Use generic services where possible  ‘job submission service’, ‘data location srv’ Don’t over-do it  WS are not suitable for low-latency HPC or bulk file transfer We’re not running a course on WS-RF … Not all services (nor architectures) are mature jet  Be prepared to make compromises …  … as long as it’s in-line with long-term trend

46 Grid Middleware VII46 Brokered Job Submission Service Submit brokered jobs in JDL through WS-interface to the Matrix Resource Broker WSDL specification http://mu7.matrix.sara.nl/SaraGridService/SaraGridServiceLCG.wsdl For detailed info: ask Bart Heupers, SARA Future version of the basic Grid middleware will have a native WMS WS interface

47 Grid Middleware VII47 Defining and building Services in WS-* [See Introduction to Web Services Tutorial] 1. Start with the WSDL 2. Then, generate your interfaces E.g. with GT4 tools or JWSDP See appropriate tutorial(s): “Technologies for Building Grids” or “Sotomajor” 3. Fill the stubs with an implementation 4. Deploy your services in a container EGEE NA3 Training Home has plenty of material: http://www.egee.nesc.ac.uk/trgmat/


Download ppt "Containers and Web Services Grid Middleware 7 David Groep, lecture series 2005-2006."

Similar presentations


Ads by Google