Applications as Web (Grid) Services and Related Issues Argonne 10 November 2003 PTLIU Laboratory for Community Grids Geoffrey Fox Computer Science, Informatics, Physics Indiana University, Bloomington.
Download ReportTranscript Applications as Web (Grid) Services and Related Issues Argonne 10 November 2003 PTLIU Laboratory for Community Grids Geoffrey Fox Computer Science, Informatics, Physics Indiana University, Bloomington.
Applications as Web (Grid) Services and Related Issues Argonne 10 November 2003 PTLIU Laboratory for Community Grids Geoffrey Fox Computer Science, Informatics, Physics Indiana University, Bloomington IN 47404 http://grids.ucs.indiana.edu/ptliupages [email protected] 1 Reporting work of Minjun Wang PowerPoint/OpenOffice as a WS Xiaohong Qiu SVG as a WS Bryan Carpenter SVG Javascript games Sangmi Lee, Sunghoon Ko PDA and WS Shrideep Pallickara NaradaBrokering messaging Gurhan Gunduz Messaging performance module Wenjun Wu and Ahmet Uyar Global-MMCS A/V And other students not graduating in next 3 to 9 months 2 Client Applications and O/S I Consider applications like Word, Illustrator, Internet Explorer These haven’t dramatically changed over the last 3 or perhaps more years • Some complain that such products are in fact getting worse as they increase in size and complexity and correspondingly decrease in usability Microsoft has an obvious dominance in both O/S and associated applications Sun is trying to compete directly with StarOffice/OpenOffice which are competitive with but not clearly better than Microsoft products • To be compatible with Microsoft Office requires reproducing its bugs? Mozilla is very competitive with Internet Explorer but not clearly better 3 Client Applications and O/S II Asia – led by China – is aiming at escaping Windows noose by developing their own (Linux) client • For cost and desire to develop their software industry Palm O/S and Java are doing rather well in PDA/Cellphone industry • Doesn’t seem one wants to run same applications on PDA’s and desktops • At least don’t want same user interface? Macintosh is doing quite well broadly as a client with a UNIX based client Linux (Unix?) has rather specialized CLIENT user base 4 Lessons from Web Services Web services are an attractive way of building service side (Middle-tier) applications with a component model • Expressed by using WSDL and meta-data • All remarks here valid for Grid and Web services! WSRP, JSR168, Portlets, Jetspeed have taught us to distinguish user-facing and service (resource) ports on Web services and build a corresponding component model for user interfaces • Jetspeed is primitive and standards WSRP, JSR168, portlets are incomplete • But this will surely rapidly improve as relatively obvious what to do So Web service based applications are significantly different from classic desktop products like Word • Light weight client which is relatively easily ported between client O/S • Very easy to make collaborative using shared input port (MIMD) or shared output port (SIMD) • Perhaps hopelessly slow due to service-client interaction (the rule of the millisecond?) 5 Applications as Web Services? Build “all” classic applications in Web service style with user interface and “real application” interacting by (WSDL/SOAP) messages and NOT by O/S controlled interrupts • This is “just” MVC (Model View Control) paradigm done very explicitly • Quite hard because MVC not actually used very systematically Perhaps the advantages of this architecture could be enough to shake the Microsoft hegemony in both O/S and “productivity” applications • Current challenges of Microsoft applications are trying to do as well and not easy to see how they can do better Immediately make a lot easier to support cross O/S applications Form the “Next Generation Client Consortium”? • There is quite a lot of open source (but not web service based) software with which to begin 6 Classic MVC Paradigm Model View Controller Model Controller Mouse event Keyboard events Figure View Display MVC Model 7 Web Service Model for Application Development Data Resource Facing Ports Logic of Application Semantic Events Model Messaging System User Facing Ports Events as Messages Rendering as Messages Control Raw (UI) Events User Interface View Interrupts in traditional monolithic applications become “real messages” not directly method calls Natural for collaboration and universal access 8 Next Generation Client? Access Grid (GlobalMMCS), JXTA, Mozilla (or Firebird for browser and Thunderbird for mail), Batik SVG, OpenOffice, Better Jetspeed ….. Support Linux, Windows, Palm, Java cellphone Use W3C DOM and “better portlets” What are the principles • Split at “user interface” events (mouse clicks) or at “semantic” events (slide change) • What part of rendering on client (AWT, Java2D or …) • could be different for different clients with server-side adaptors mapping What general support (tools) do we need? • Event to message mapping and serialization When is there a performance problem? • How “far” can server be from client? 9 Web Service Model for Application Development Data Resource Facing Ports Logic of Application Other Semantic Events Another version of Model Messaging System User Facing Ports Events as Messages Rendering as Messages Control Some Semantic Events Raw (UI) Events User Interface (framebuffer) Another View 10 What have we done in this Area? Most of this is work in progress …. PowerPoint only partially as a Web Service SVG as a Web Service and Collaborative SVG • Example of W3C Document Object Model (DOM) PDA Interfaces and Collaboration using this architecture Universal Access Publish-subscribe Messaging to link clients and Web services Global-MMCS: Collaboration as a Web Service Looking at OpenOffice but not perfect • Not Java and not W3C DOM compliant 11 Handling Events (Control in MVC) Typically events (Mouse click or change node in DOM) are handled by setting listeners for produced events • This is publish/subscribe intra-application Collaboration whether audio-video, text-chat or shared display can be handled by collaborators subscribing to change events published by master • Publish/subscribe inter-clients Java takes about 0.75 millisecond to handle this on a Linux server Can handle with uniform publish/subscribe environment • http://www.naradabrokering.org 12 Role of Portal and User Facing Ports Other WS User Facing Ports F I R O WSDL U Application or Content source Web Service O F I Possible Filter Portal Aggregate WS-User Facing Fragments Other WS User Facing Ports Render 13 F I R O WSDL U Application or Content source Web Service O F Selection View (NaradaBrokering) Event Service I Filter Customized View Selector Control Channel Jetspeed Portal Customized User-Facing Ports Customized View Universal Access With Jetspeed Web Services, MVC Model for applications Asynchronous Messaging Control Channel User Profile Render 14 Shared Input Port (Replicated WS) Collaboration Collaboration as a WS Set up Session with XGSP R U Web F Servic I I e O O F WS Viewer WS Display Master U Web F Servic I I e O O F Event (Message) Service R R U Web F Servic I I e O O F WS Viewer WS Display Other Participants WS Viewer WS Display 15 Shared Output Port Collaboration Collaboration as a WS Set up Session with XGSP Web Service Message Interceptor F I WSDL R O Master U Application or Content source Web Service Text Chat Whiteboard Multiple masters O F I Event (Message) Service WS Viewer WS Display WS Viewer WS Display Other Participants WS Viewer WS Display 16 Collaborative SVG Web Service SVG is W3C 2D Vector Graphics standard and is interesting for visualization and as a simple PowerPoint like application • Further SVG is built on W3C DOM and one can generalize results to all W3C DOM-based applications (“all” applications in future?) Apache Batik SVG is Java and open source and so it is practical to modify it to explore • Real Applications as a Web Service • Collaboration as a Web Service • MVC model and web services with implications for portlets We use NaradaBrokering and Global-MMCS to control collaboration; support PDA Cell-phone and desktop clients; are restructuring Batik as MVC Web Service • Good progress in all areas see • http://www.svgarena.org for SVG Games • http://grids.ucs.indiana.edu/ptliupages/projects/carousel/ for PDA 17 Document Object Model DOM (Document Object Model) defines how documents to be accessed as distributed objects – especially as a Web service DOM has a particular tree-like specification of the Object structure of a document It defines • An application programming interface (API) for documents (e.g. HTML, XML documents) for Java, CORBA, Javascript …. • Including how to change DOM • The logical structure of documents • The way a document is accessed and manipulated DOM has a generic event model defining uniform interface for mouse and keyboard actions • Also defines events signifying change in DOM W3C DOM builds on earlier ad-hoc DOM’s of Internet Explorer and Netscape • Surprisingly unsuccessful so far but critical for this project as allows general approach to user interfaces 18 Example of HTML DOM Here is an example of a fragment of HTML and how it can be thought of as a tree This is called a “document fragment” in DOM (lightweight tree) 19 Constants The Node Interface in CORBA IDL Properties Methods 20 Collaborative SVG AsSVGAclients Web Service Control flow for collaborative From Collaboration As a WS Application as a Web service Application as a Web service Events Rendering From Master NaradaBrokering W3C DOM Events User Interface Participating Client From Collaboration As a WS Application as a Web service Application as a Web service Events Rendering To Collaborative Clients W3C DOM Events User Interface Master Client 21 Collaborative SVG Chess Game in Batik Browser Players Observers 22 Lessons from SVG Web Service This keeps DOM and Javascript Event Handlers on the Server; keeps the Graphics version of DOM that interfaces with Java2D on client; client captures raw user interface events inside SVG frame; client captures some semantic events (zoom, change URL) in menu-bar We identified SIMD and MIMD model of collaboration • Program is JavaScript implementing in our case chess or card game • SIMD collaboration is shared output port in Web Services model • MIMD collaboration becomes shared input port model Internally there are pipelines AWT/Swing GVT DOM JavaScript new DOM for user input new DOM GVT Java2D Framebuffer for rendering The Graphic Vector Toolkit (GVT) module represents a view of the DOM tree in terms of Java objects that is more suitable for rendering and event handling purposes. Can share at different points of pipeline based on software engineering issues – where is current software easiest to split 23 From the Battle Lines Why not easy to convert legacy applications to WS Although many modern applications adopt MVC (Model-View-Control) paradigm, they may not strictly follow the principles in implementation. Not faithfully following modularized design principle the applications does not have a clear "control" design which plays the role as the only communication channel between "model" and "view". • there exits direct linkage (not through "control") between Model and View in the MVC paradigm. • For example, some functional modules involve information from many stages across the pipeline rather than just provide the linkage between the two modules Are instantiated in GUI/"view" but execute functions in the backend "model" through direct methods calls Not providing "Object Serialization" • Object Serialization (the process of reading and writing objects) has many uses, including remote method invocation (RMI) • In addition to the object streams, java.io has other classes and interfaces that define the API to help classes perform serialization for its instances. • lacking of serializable feature of the modularized components makes it hard to split the application into a Web service 24 SIMD Collaboration Non Web Service Implementation NaradaBrokering SVG Browser SVG Browser SVG Browser SVG Browser Identical Programs receiving identical events Token determines if browser is moving, waiting for opponent or an observer SVG Model (DOM) NaradaBrokering SVG Viewer SVG Viewer SVG Viewer Shared Output port SIMD Collaborative Web Service SVG Viewer 25 MIMD Collaboration Shared Input port MIMD Collaborative Web Service NaradaBrokering SVG Model SVG Model SVG Model SVG Model NaradaBrokering SVG Viewer SVG Viewer SVG Viewer SVG Viewer 26 PowerPoint as a Sort of Web Service As in Access Grid Collaborative Client PPT as a Web Service NaradaBrokering Message Service User 1 1 User 2 User n Master Client Sink Connectable Object Holds meta-data (sample of high level semantic events) like slide number and title 27 Semantic Events in PPT Web Service One can capture slide and animation semantic events such as WindowSelectionChange WindowBeforeRightClick, WindowBeforeDoubleClick, PresentationClose, PresentationSave, PresentationOpen, NewPresentation, PresentationNewSlide, WindowActivate, WindowDeactivate, SlideShowBegin, SlideShowNextBuild, SlideShowNextSlide, SlideShowEnd, PresentationPrint, SlideSelectionChanged, ColorSchemeChanged, PresentationBeforeSave, SlideShowNextClick We don’t know how to capture • Raw UI events such as MouseOver, MouseClicked, MouseDoubleClicked, KeyDown, KeyUp, KeyStroke, etc. • Sound events such as SoundClipPlayed, SoundFilePlayed, etc. • Some animation events such as AnimationClipPlayed, MoviesPlayed, AnimationFilePlayed 28 Integration of PDA, Cell phone and Desktop Grid Access 29 Real-time Community Collaboration Desktop PC, local wireless (802.11b) and the rest of the world (Sprint PCSVision as glimpse of next generation cell phones) Reconcile different protocols, different display areas, different O/S and different network bandwidths Text Chat 30 Real-time Community Collaboration PowerPoint via “Shared Pixels” 31 Real-time Community Collaboration 32 Scalable Vector Graphics (SVG) via “Shared Web Service” 4500 4000 Performance of PDA Client Latency over successive iterations Time (milliseconds) 3500 3000 2500 2000 1500 1000 Publishing Event from PDA to Server Subscribing to Event from PDA 500 0 • Treo 300 Sprint PCS Vision Java MIDP on Palm O/S • 50 Kbit/sec bandwidth both directions • Developing optimized protocol (HHMP) to be built into NaradaBrokering for fault-tolerance and latency hiding 33 (pre-start HTTP connection) Application Web Services and Universal Access NaradaBrokering can link lightweight clients (V in MVC) to Web Services holding as a Web service the “guts of an application” (M in MVC) • This allows customizable user interfaces gotten by mapping between client profile protocols at NB • Supports collaboration between diverse clients Map P to P1 P1 Agent1 Client1 Web Service NB M Profiles P Client2 Map P to P2 P2 Agent2 34 Collaboration Personal Server and EventFlow Web Service B Topic set B (does not need content adaption) SVG Web Service A Topic set A (needs content adapting) Subscribe/Publish to Topic set A Subscribe/Publish to Topic set B ( Subscribe to Topic set A instead of mobile devices and adapt the content to give Topic Set C) JMS Collaboration Personal Server Topic set C Subscribe /Publish to Topic set A,C NB NB HTTP RTP HHMP Subscribe/Publish to Topic set A,B HTTP/HHMP Interface (for current 3G phone service) Subscribe/Publish to Topic set B,C 35 Web Service to Client Pipeline IB M computation unit Generating user presentation real time multimedia Database DAT M&L DTX PCL MCL User event transmit Universal user devices • DAT (Data) stage: Data source (facing remote resources) • M&L (Model and Logic) stage: Semantic processing of the data • DTX (Data Transformer) stage: Process of filtering the object for heterogeneous devices • PCL (Presentation client) stage: Generating abstract presentation for each client • MCL (Minimal client) stage: Actual drawing onto user device • PDA would “just” have MCL • Desktop might have PDA and MCL • Such diagrams can be analysed formally using Petri nets Page. 36 Event Processing in Web Service to Client Pipeline • Events allow Client and service to interact – Transformations in each module MUST be invertible • Two directions of dataflow – Event transmission – Presentation Generation User Event Transmission DAT M&L DTX PCL MCL <?xml vers <!DOCTYPE <!--local DT <svg width= <desc>This SVG document with the original size of 1200 x 2000 DOM tree of SVG document Rendered Image with CSS for PDAs (resolution of 160 x 160) SVG browser for PDAs Generating Presentation View Actual Display on PDA Page. 37 Some Simple Principles One must use invertible transformations so that can propagate information to AND from the client Don’t ever send a position (x,y) for say a mouse click – rather send position and coordinate system specified by some transformation (as in affine transformations used in graphics) • Or send semantic meaning of click – e.g. open URL Accumulate mouse-move events into arrays or cumulative events to avoid too many messages Choose “cutting point” between M and V to support interactivity and performance Jetspeed is just aggregating lots of different “Views” All messages MUST go through messaging system – it must support all needed protocols such as those needed to minimize latency for cellphones • Messaging system has routing optimization/firewalls built in 38 NaradaBrokering Audio/Video Conferencing Client Computer Modem Minicomputer Server NaradaBrokering Broker Network Brokers ONLY process messages Firewall Workstation Peers Laptop computer Peers PDA Audio/Video Conferencing Client 39 “GridMPI” v. NaradaBrokering In parallel computing, MPI and PVM provided “all the features one needed’ for inter-node messaging NB aims to play same role for the Grid but the requirements and constraints are very different • NB is not MPI ported to a Grid/Globus environment Typically MPI aiming at microsecond latency but for Grid, time scales are different • 100 millisecond quite normal network latency • 30 millisecond typical packet time sensitivity (this is one audio or video frame) but even here can buffer 10-100 frames on client (conferencing to streaming) • <1 millisecond is time for a Java server to “think” Jitter in latency (transit time through broker) due to routing, processing (in NB) or packet loss recovery is important property Grids need and can use software supported message functions and trade-offs between hardware and software routing different from parallel computing 40 NaradaBrokering Based on a network of cooperating broker nodes • Cluster based architecture allows system to scale in size • Grid routing topologies are open research issue? Originally designed to provide uniform software multicast to support real-time collaboration linked to publish-subscribe for asynchronous systems. Perhaps better thought of as stream not message handler Now has several core functions • Reliable order-preserving “Optimized” Message transport (based on performance measurement) in heterogeneous multilink fashion with TCP, UDP, SSL, HTTP, and will add GridFTP • General publish-subscribe including JMS & JXTA and support for RTP-based audio/video conferencing • General software routing to avoid network problem • Distributed XML event selection using XPATH metaphor • QoS, Security profiles for sent and received messages 41 • Interface with reliable storage for persistent events Grid Messaging Substrate SOAP+HTTP GridFTP RTP …. Standard client-server style communication. Substrate mediated communication removes transport protocol dependence. Consumer Consumer Service SOAP+HTTP GridFTP RTP …. Service Messaging Substrate Any Protocols satisfying QoS Messaging Substrate has “intelligence” “any desired fault tolerance” “logging” etc. Hope to demonstrate with multicast fault tolerant GridFTP 42 Laudable Features of NaradaBrokering Is open source http://www.naradabrokering.org available now; major new release for SC03 Will have end-point “plug-in” as well as standalone brokers • end-point is service or user-interface machine Will have a discovery service to find nearest brokers Does tunnel through most firewalls without requiring ports to be opened Links to NWS (Network Weather Service) style performance estimation systems Supports JXTA (peer-to-peer network), JMS (Java Message Service) and more powerful native mode Transit time < 1 millisecond per broker Will have setup and broker network administration module 43 NaradaBrokering Naturally Supports Filtering of events (streams) to support different end-point requirements (e.g,. PDA versus desktop, slow lines, different A/V codecs) Virtualization of addressing, routing, interfaces (OGSI versus pure Web services for example) Federation and Mediation of multiple instances of Grid services as illustrated by • Composition of Gridlets into full Grids (Gridlets are single computers in P2P case) • JXTA with peer-group forming a Gridlet Monitoring of messages for Service management and general autonomic functions Fault tolerant data transport Virtual Private Grid with fine-grain Security model 44 Virtualizing Communication Communication specified in terms of user goal and Quality of Service – not in choice of port number and protocol Protocols have become overloaded e.g. MUST use UDP for A/V latency requirements but CAN’t use UDP as firewall will not support ……… A given communication can involve multiple transport protocols and multiple destinations – the latter possibly determined dynamically NB Brokers A Satellite UDP Firewall HTTP Software Multicast NB Broker Client Filtering Fast Link B1 Hand-Held Protocol Dial-up Filter B2 B3 45 Performance Monitoring Every broker incorporates a Monitoring service that monitors links originating from the node. Every link measures and exposes a set of metrics • Average delays, jitters, loss rates, throughput. Individual links can disable measurements for individual or the entire set of metrics. Measurement Broker Broker Monitoring intervals can Node Node Service also be varied Link Link Monitoring Service, Data Data returns measured Aggregates info metrics to Control Message from nodes in a Exchange Performance certain domain Aggregator. Performance Aggregation Service 46 Transit Delay (Milliseconds) Mean transit delay for message samples in NaradaBrokering: Different communication hops 9 8 7 6 5 4 3 2 1 0 hop-2 hop-3 hop-5 hop-7 100 1000 Message Payload Size (Bytes) Pentium-3, 1GHz, 256 MB RAM 100 Mbps LAN 47 JRE 1.3 Linux Standard Deviation for message samples in NaradaBrokering Different communication hops - Internal Machines 0.8 hop-2 hop-3 hop-5 hop-7 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 1000 1500 2000 2500 3000 3500 Message Payload Size (Bytes) 4000 4500 5000 48 Transit delays for Content Payloads. Broker at Cardiff, Clients at Indiana 114.5 Delay 114 113.5 113 112.5 112 111.5 100 200 300 400 500 600 700 800 900 1000 49 Content Payload Size in Bytes Standard deviation for Content Payloads. Broker at Cardiff, Clients at Indiana 2.6 Standard Deviation 2.4 2.2 2 1.8 1.6 1.4 1.2 1 0.8 0.6 100 200 300 400 500 600 700 800 900 1000 50 Content Payload Size in Bytes Architecture of Message Layer Need to optimize not only routing of particular messages but classic publish/subscribe problem of integrating different requests with related topics (subscribe to sports/basketball/lakers and sports) Related to Akamai, AOL … caching and Server optimization problem Hypercube of NB Brokers (logical not physical) N≈100 clients per leaf node for A/V conferencing 1-> N Grid Clients Scale using NB broker network 51 Global-MMCS 2.0 XGSP based MCU We are building an open source protocol independent Web Service “MCU” which will scale to an arbitrary number of users and provide integrated thousands of simultaneous users collaboration services. We will deploy it globally and hope to test with later this year. The function of A/V media server will be distributed using NaradaBrokering architecture. • Media Servers mix and convert A/V streams and are built as Web Services Open Global-MMCS MCU based on the following open source projects • openh323 is basis of H323 Gateway • NIST SIP stack is basis of SIP Gateway • NaradaBrokering is open source messaging from Indiana • Java Media Framework basis of Media Servers 52 XGSP Web Service MCU Architecture Use Multiple Media servers to scale to many codecs and many versions of audio/video mixing Session Server XGSP-based Control NaradaBrokering All Messaging NB Scales as distributed Admire Web Services SIP H323 Media Servers Filters High Performance (RTP) and XML/SOAP and .. Access Grid Native XGSP Gateways convert to uniform XGSP Messaging NaradaBrokering 53 Polycom, Access Grid and RealVideo views of multiple streams using A/V Web Service integrating SIP and H323 54 Performance Test : GlobalMMCS1.0 We conducted extensive performance tests on audio and video servers. Video: • The test shows that our video server is capable of supporting 100-300 clients if there is only one video sender. • Video Server Machine : 1.2GHz Intel Pentium III dual CPU, 1GB MEM, RedHat Linux 7.3 Audio: • Our tests show that audio server can support 5 concurrent sessions (250 participants in total) without any packet droppings. • Audio Server Machine: 2.5GHz Pentium 4 CPU, 512MB Windows XP machine memory, Scale with logarithmic Broker network 55 Average delays per packet for 50 video-clients NaradaBrokering Avg=2.23 ms, JMF Avg=3.08 ms 60 NaradaBrokering-RTP JMF-RTP Delay (Milliseconds) 50 40 30 20 10 0 0 200 400 600 800 1000 1200 1400 1600 1800 2000 Packet Number 56 Average jitter (std. dev) for 50 video clients. NaradaBrokering Avg=0.95 ms, JMF Avg=1.10 ms 8 NaradaBrokering-RTP JMF-RTP Jitter (Milliseconds) 7 6 5 4 3 2 1 0 0 200 400 600 800 1000 1200 1400 1600 1800 2000 Packet Number 57 4.5 NaradaBrokering-RTP 900 audio clients JMF-RTP 4 3.5 3 2.5 2 1.5 1 0.5 0 0 200 400 600 800 1000 1200 1400 1600 1800 2000 Packet Number 58