Prerequisite Knowledge EPCC, University of Edinburgh Neil Chue Hong N.ChueHong@epcc.ed.ac.uk OGSA-DAI Training Workshop - April 2003 Release: P2R2 Talk Outline 4Recap of terminology and assumed knowledge – XML • Schema, SOAP, WSDL, G-WSDL • Tomcat, Axis – Database • SQL, JDBC, MySQL, DB2, XML:DB, XPath, XUpdate, Xindice – Grid • OGSI, OGSA, Globus Toolkit, GridFTP, … 4Tools and languages? – Ant, Java, log4J 4Anything else… 2 OGSA-DAI Training Workshop, Release: P2R2 XML XML Schema 4 Already had an introduction to XML – Text based hence portable – Mark-up facilitates machine processing 4 XML Schema overcome some of the limitations of DTDs – Schemas are XML documents themselves – Schemas express XML vocabularies and grammar/syntax that can be used in XML documents 4 XML documents are – Well formed if start and closing tags match – Valid if they conform to an XML Schema 4 More information from – http://www.w3.org/XML/Schema 4 OGSA-DAI Training Workshop, Release: P2R2 SOAP 4 SOAP is: – a stateless, – one-way message exchange paradigm 4 Applications can create more complex interaction patterns: – request/response, – request/multiple – responses, etc 4 Silent on: – – – – 5 the semantics of any application-specific data it conveys the routing of SOAP messages, reliable data transfer, firewall traversal, etc. OGSA-DAI Training Workshop, Release: P2R2 SOAP2 4Can operate over various transports: – http – ftp – smtp, etc. 4Provides a framework to convey applicationspecific information in an extensible manner. 4Provides a full description of the required actions taken by a SOAP node on receiving a SOAP message. 4More information from – http://www.w3.org/2000/xp/Group/ 6 OGSA-DAI Training Workshop, Release: P2R2 WSDL 4 Used to describe interfaces to web services 4 Uses XML to do this and conforms to a WSDL XML Schema – Current W3C recommendation at version 1.1 4 Describes network services as a set of endpoints operating on messages containing either – document-oriented information or – procedure-oriented information. 4 Operations and messages are described abstractly 4 Bound to a concrete network protocol and message format to define an endpoint 4 Related concrete endpoints are combined into abstract endpoints (services) 7 OGSA-DAI Training Workshop, Release: P2R2 WSDL (2) 4WSDL is extensible to allow description of endpoints and their messages – regardless of what message formats or network protocols are used to communicate, 4However, WSDL is typically used in conjunction with: – SOAP 1.1 – HTTP GET/POST – MIME 4More information from – http://www.w3.org/TR/wsdl 8 OGSA-DAI Training Workshop, Release: P2R2 GWSDL 4There are deficiencies in WSDL 1.1 – Lack of Interface inheritance • Needed for portTypes – Lack of an open content model • Needed for service data elements 4These features are in WSDL 1.2 – WSDL 1.2 only in draft form – OGSI people did not want to use a draft standard 4GWSDL is a stepping stone to WSDL 1.2 4When WSDL 1.2 is released it will replace GWSDL 9 OGSA-DAI Training Workshop, Release: P2R2 Tomcat 4Tomcat is the servlet container used in the – official reference implementation for the Java Servlet and Java Server Pages technologies 4More information from – http://jakarta.apache.org/tomcat/ 4Other possible hosting environments: – – – – 10 IBM Websphere Oracle Application Server Microsoft .Net framework JBOSS OGSA-DAI Training Workshop, Release: P2R2 Axis 4Axis is an implementation of a SOAP engine 4It can run as a servlet on Tomcat 4It is extensible through a handler chain framework 4More information from – http://ws.apache.org/axis/ 11 OGSA-DAI Training Workshop, Release: P2R2 Tools Ant 4Ant is a flexible build tool for multiple platforms – Replacement for Makefiles 4Mainly Java orientated 4XML based as well 4More information from – http://ant.apache.org 13 OGSA-DAI Training Workshop, Release: P2R2 Log4J 4Log4J is a framework for efficiently inserting logging statements in Java code 4Supports detailed context for application warnings and failures 4Supports inheritance of loggers 4More information from – http://jakarta.apache.org/log4j/docs/ 14 OGSA-DAI Training Workshop, Release: P2R2 Databases SQL 4SQL is a database sub-language that is used for accessing relational databases. 4A database sub-language is one that is used in association with some other language e.g. Java, for the purpose of accessing a database. 4SQL-92 is a particular specification supported by many relational databases. 4More information from – http://www.sqlstandards.org/ 16 OGSA-DAI Training Workshop, Release: P2R2 Java DataBase Connectivity 4JDBC technology is an API that lets you – access virtually any tabular data source from Java – Provides cross-DBMS connectivity to a wide range of SQL databases 4In theory, it also provides access to other tabular data sources, such as – spreadsheets or – flat files. 4More information from – http://java.sun.com/products/jdbc/ 17 OGSA-DAI Training Workshop, Release: P2R2 Relational Databases 4MySQL – – – – Open source relational database Supports SQL’92 No support for atomic operations, triggers, rollback More information: • http://www.mysql.com 4DB2 – – – – IBM’s flagship database product Supports SQL’92 Support for atomic operations, triggers, rollback More information: • http://www.ibm.com/software/data/db2/ 18 OGSA-DAI Training Workshop, Release: P2R2 Prepared Statements 4Prepared statements and parameterised queries allow databases to return results more efficiently. – Queries are precompiled and stored in the DBMS – Parameter replacement can be used to modify data inputs/outputs 4Database access plans can be cached and reused – E.g. select a,b from t where c=? 19 OGSA-DAI Training Workshop, Release: P2R2 XML:DB 4The XML:DB Initiative aims to – develop a set of standards to allow interoperability between the different XML databases available 4They produce defacto standards 4Three types of XML databases: – Native XML database (NXD) – XML enabled database (XEDB) – Hybrid XML database (HXD) 4More information from – http://www.xmldb.org 20 OGSA-DAI Training Workshop, Release: P2R2 XPath 4 XPath is a language – – – – for addressing parts of an XML document, designed to be used by both XSLT and Xpointer W3C recommendation at version 1.0 There is a Version 2.0 working draft 4 XPath is the current de facto NXD query language – is has been extended slightly to allow queries across collections of documents 4 But XPath still has a number of limitations – – – – No grouping, No sorting, No cross document joins Poor support for data types. 4 More information from: – http://www.w3.org/TR/xpath 21 OGSA-DAI Training Workshop, Release: P2R2 XUpdate 4 The XUpdate specification: – provides open and flexible update facilities to modify data in XML documents – gives the ability to modify real documents or virtual documents retrieved from XML databases – makes extensive use of the expression language defined by XPath for selecting elements for updating and for conditional processing. – is a pure descriptive language which is designed with references to the definition of XSL Transformations. 4 Comes from the XMLDB stable 4 An update in the XUpdate language is expressed as a well-formed XML document. 4 More information from – http://www.xmldb.org/xupdate/index.html 22 OGSA-DAI Training Workshop, Release: P2R2 Other XML APIs 4 XQuery – W3C working draft recommendation • designed for processing XML data. • not only files in XML format, but also other data including databases whose structure -- nested, named trees with attributes -- is similar to XML. • everything is an expression which evaluates to a value – More information: • http://www.w3.org/XML/Query 4 SiXDML (Simple XML Manipulation Language) – designed to create a common syntax and semantics for performing tasks most often required of XML repositories – SiXDML consists of two parts: • a data definition and manipulation language inspired by SQL • an API based on the XML:DB Database API. – More information: • http://www.xmldb.org/sixdml/index.html 23 OGSA-DAI Training Workshop, Release: P2R2 Xindice 4Xindice is a DBMS designed to store XML data – It is an example of a native XML database (NXD) – Uses • XPath and • XUpdate – Designed specifically for storing • many small/medium sized documents, • not one large document 4Open source from Apache project 4More information from – http://xml.apache.org/xindice 24 OGSA-DAI Training Workshop, Release: P2R2 Grids What is OGSA? 4 OGSA pulls together Open Grid Architecture and Web Services to form Grid Services. – Open Grid Architecture + Web Services = Grid Services 4 Grid Services are – – – – dynamic, transient, have state (i.e. have a finite lifetime) and are defined by a well defined set of interfaces and behaviours. 4 The interfaces and behaviours describing Grid Services can be written in an XML schema based WSDL document. – Other implementations are possible. 26 OGSA-DAI Training Workshop, Release: P2R2 What is OGSA? The Best of Both Worlds Open Grid Services Architecture Share Access Manage resource resource resource Continuous Availability Applications on demand Secure and universal access Business integration Web Services 27 Resources on demand Global Accessibility Vast resource scalability Grid Protocols OGSA-DAI Training Workshop, Release: P2R2 What is OGSA? OGSA Structure System Management Services Grid Services OGSI – Open Grid Services Infrastructure Web Services 28 OGSA-DAI Training Workshop, Release: P2R2 OGSI Specifies minimum set of standards/behaviours with which Grid Services must comply. OGSA implementations MUST adhere to the OGSI specifications of Grid Services. Exploits existing Web Services properties • Interface abstraction (WSDL), described through PortTypes. • Uses WS protocols, language, and is hosting platform independent. Enhancement to web services • Allow state management, event notification. • Have reference handles for service access. • Implement lifecycle management. • service data extension through Service Data Elements (SDEs). 29 OGSA-DAI Training Workshop, Release: P2R2 Grid Services 4 Grid Services can be described using WSDL documents (although this is implementation independent). 4 They consist of interfaces, which are then essentially WSDL PortTypes. 4 PortTypes include a set of Service Data Elements, which are used to describe the properties and capabilities of Grid Services. 4 Grid Service Factory (GSF) services are used to instantiate Grid Services. 4 Grid Service Registry (GSR) services are used to register factory services for look up by clients and users. 4 All Grid Services must include a GridService PortType. 30 OGSA-DAI Training Workshop, Release: P2R2 Anatomy of a Grid Service • Service Data Access • Lifetime Management GridService (required) Other Interfaces (Optional) •Service creation (Factory) •Service discovery (Registry) •Notification •Handle Management •Other functions e.g. Handle Handle Element Element Service Data Element Grid Service •Workflow •Auditing •Resource Management Implementation Hosting Environment 31 OGSA-DAI Training Workshop, Release: P2R2 Anatomy of a Grid Service • Service Data Access • Lifetime Management GridService (required) Other Interfaces (Optional) •Service creation (Factory) •Service discovery (Registry) •Notification •Handle Management •Other functions e.g. Handle Handle Element Element Service Data Element •Workflow •Auditing •Resource Management Implementation Hosting Environment 32 OGSA-DAI Training Workshop, Release: P2R2 Anatomy of a Grid Service • Service Data Access • Lifetime Management GridService (required) Other Interfaces (Optional) •Service creation (Factory) •Service discovery (Registry) •Notification •Handle Management •Other functions e.g. Handle Handle Element Element Element •Workflow •Auditing •Resource Management Implementation Hosting Environment 33 OGSA-DAI Training Workshop, Release: P2R2 Service Types 4 Service (component) implemented as a Java class 4 Implements the PortType interfaces and extends some base class public class MyGridService extends implements BaseGridService PortTypeOne, PortTypeTwo, PortTypeThree { 4 Here BaseGridService implements common GridService interface functions 4 Other common functions are reused through delegation 4 This class is instantiated in order to create a service instance 36 OGSA-DAI Training Workshop, Release: P2R2 OGSA PortTypes <<Interface>> PortType (from org.w3c.wsdl) <<Interface>> GridService findServiceData() requestTerminationTimeAfter() requestTerminationTimeBefore() destroy() SDEs <<Interface>> NotificationSource subscribe() 37 <<Interface>> Factory createService() <<Interface>> Registration registerService() unregisterService() <<Interface>> NotificationSink deliverNotification() <<Interface>> Handl eResolver f indByHandle() <<Interface>> NotificationSub scription OGSA-DAI Training Workshop, Release: P2R2 Grid Services 4Grid Services are identified by means of a – Grid Service Handle (GSH), which is used to find the – Grid Service Reference (GSR) that is unique to an instance of a Grid Service. – The HandleResolver service is used to go from GSH to GSR. 4 The GSH is a type of URI (or URL) and is constant for the lifetime of the Grid Service. 4 The GSR is bound to the Grid Service instance. It is the representation of the interfaces, and may be a WSDL document for example, of that service instance and can change if the service instance evolves. 38 OGSA-DAI Training Workshop, Release: P2R2 Globus’ OGSA Implementation 4 Technology Preview 1 4 Technology Preview 2 4 Technology Preview 3 4 Technology Preview 4 4 Technology Preview 5 – December 02 4 Globus Toolkit 3 Alpha – January 03 4 Globus Toolkit 3 Beta – end May 03 4 Globus Toolkit 3 Release – end June 03 39 OGSA-DAI Training Workshop, Release: P2R2 Globus Toolkit 3 4Globus Toolkit 2 was a one of the leading middleware for grid applications 4Globus Toolkit 3 takes the features of GT2 and incorporates the OGSA paradigm 4GT3 aims to be a reference implementation of the OGSI spec (core services) as well as providing higher level services for e.g. job submission, resource discovery. 4More information from: – http://www.globus.org/toolkit/gt3-factsheet.html 40 OGSA-DAI Training Workshop, Release: P2R2 GridFTP 4GridFTP is a high-performance, secure, reliable data transfer protocol optimised for high-bandwidth wide-area networks. 4The GridFTP protocol is based on FTP, the highly-popular Internet file transfer protocol. 4More information from – http://www.globus.org/datagrid/gridftp.html 41 OGSA-DAI Training Workshop, Release: P2R2 GGF 4The Global Grid Forum: – Is the Grid equivalent of the W3C and IETF bodies. – Meets three times a year. – Facilitates the development of implementation and platform independent Grid standards and protocols. – Operates as a number of; • working groups (WGs) which produce recommendations on specific areas, and • research groups (RGs) which are longer term groups looking into issues that feed into short term WGs. 4More information from – http://www.ggf.org 42 OGSA-DAI Training Workshop, Release: P2R2 Disclaimer 4Grid Development: • • • • new and developing protocols and standards, lots of issues are not yet “set in stone”, ongoing, iterative development process, facilitated through the Global Grid Forum (alongside W3C, OASIS and IETF). 4Grids are complicated systems: • • • • 43 complex set of interactions, between many components (services in OGSA), You can know the technology… … but it’s non-trivial social and political issues that can hinder development. OGSA-DAI Training Workshop, Release: P2R2 ***