Presentation is loading. Please wait.

Presentation is loading. Please wait.

OGSI on Microsoft.NET Daragh Byrne, Ally Hume, Mike Jackson EPCC Budapest, Hungary – November.

Similar presentations

Presentation on theme: "OGSI on Microsoft.NET Daragh Byrne, Ally Hume, Mike Jackson EPCC Budapest, Hungary – November."— Presentation transcript:

1 OGSI on Microsoft.NET Daragh Byrne, Ally Hume, Mike Jackson EPCC Budapest, Hungary – November 10 th -11 th 2003 Some slides within this presentation have been graciously contributed by the OGSA-DAI project. Microsoft is a trademark of Microsoft Corporation.

2 Overview MS.NETGrid Project Web Services, OGSA and OGSI OGSI on Microsoft.NET – MS.NETGrid-OGSI Grid Service Demonstrators Training Courses

3 Project Goals Goals: Engaging and training the UK e-Science community in OGSI and.NET Facilitate uptake of.NET for developing Grid services Achieve via delivery of: Free-source OGSI implementation on.NET Free-source Grid service demonstrators Training materials Training courses

4 Project Partners EPCC: Project management Design, development and implementation Authoring training materials Delivering training courses Microsoft Research Limited (Cambridge): Technical consultancy and expertise Provision of training materials NeSC – UK National e-Science Centre: Production and negotiation of collaboration agreement Hosting training courses

5 Project Activities Microsoft.NET OGSI OGSA- DAI e-Science Application OGSI and Microsoft.NET Course … … … OGSI and Microsoft.NET Course … … … OGSI and Microsoft.NET Course … … … OGSI and Microsoft.NET Course … … …

6 Web Services, OGSA and OGSI

7 Web Services Network-enabled application Exposes a well-defined interface Stateless: Born Services Request Dies Accessible using common Internet protocols HTTP XML-oriented technology: Describe services and their interfaces  WSDL – Web Services Description Language Support messaging  SOAP – Simple Object Access Protocol

8 WSDL Web Services Description Language XML description of Web Services: Define input and output messages Define operations in terms of input and output messages Aggregate operations into portTypes  Application-specific collections of related operations Combine portTypes with a concrete network protocol and message format to form a binding Combine a binding and a network address to define a concrete network endpoint or port Aggregate ports into an abstract network endpoint or service Current W3C version is 1.1

9 What is OGSA? Open Grid Services Architecture Open Grid Architecture + Web Services = Grid Services Grid Services: Dynamic Transient Stateful – have a finite lifetime Defined by a well-defined set of interfaces and behaviours More information from

10 OGSA Characteristics Supports: Resource access Resources sharing Service integration Uniform access to services Specifies protocols and standards that: Are:  Implementation-independent  Platform-independent Support:  Communication  Data access, transfer, translation and transformation  Access and security  Auditing and logging

11 What is OGSI? Open Grid Services Infrastructure Minimum set of standards and behaviours with which Grid Services must comply Exploits existing Web Services properties: Interface abstraction via WSDL portTypes Web Service protocols Hosting platform-independent Extends these to provide for: State management Event notification Service location and access Lifecycle management Service data More information from:

12 Anatomy of a Grid Service Hosting Environment Service Data Access Lifetime Management GridService portType (required) Other PortTypes (Optional) Service Creation Service Grouping Notification Handle Resolution Other functions e.g: Workflow Auditing Resource Management Element Service Data Grid Service Handle

13 Anatomy of a Grid Service Hosting Environment Implementation Service Data Access Lifetime Management Other PortTypes (Optional) Service Creation Service Grouping Notification Handle Resolution Other functions e.g: Workflow Auditing Resource Management Element Service Data Set Handle GridService portType (required)

14 Anatomy of a Grid Service Hosting Environment Implementation Service Data Access Lifetime Management Other PortTypes (Optional) Service Creation Service Grouping Notification Handle Resolution Other functions e.g: Workflow Auditing Resource Management Service Data Handle GridService portType (required) Service Data

15 OGSI PortTypes (1) GridService findServiceData setServiceData requestTerminationBefore requestTerminationAfter destroy Factory createService HandleResolver findByHandle ServiceGroup

16 OGSI PortTypes (2) ServiceGroupRegistration add remove ServiceGroupEntry NotificationSource subscribe NotificationSubscription NotificationSink deliverNotification

17 WSDL and GWSDL WSDL 1.1: Lack of portType inheritance  A portType cannot be defined in terms of an aggregation or extension of one or more other portTypes Lack of an open content model  Needed for specifying service data GWSDL: portType inheritance Open content model Stepping stone to WSDL 1.2 GWSDL => WSDL 1.1: Flattening the inheritance hierarchy The “most-derived” portType WSDL 1.2

18 Grid Service Identification Grid 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 A HandleResolver service is used to provide a GSR given a GSH GSH: Type of URI (or URL) Constant for the lifetime of the Grid Service GSR: Representation of the service interfaces  Can be a WSDL document Can change if the service evolves

19 OGSI Implementations Microsoft.NET: EPCC: MS.NETGridOGSI Release 1.1 University of Virginia: OGSI.NET Release 1.1 Java: Globus: Globus Toolkit 3 Release 1.0 Unicore Perl: University of Manchester: OGSI::Lite Python: Lawrence Berkley National Labs: pyGlobus

20 OGSI on Microsoft.NET MS.NETGrid-OGSI

21 Design Dimensions Use IIS/ASP.NET: Facilitate speed of development  SOAP and WSDL handling for free! Industry-standard Web services programming model Maintain integration with existing technology Exploit existing knowledge of developers Utilise.NET class library Rich framework for XML programming, serialization etc. Use an object instance to represent a service instance Creating service object and loading state every request is too costly:  Performance-wise  Development time-wise

22 Design Limitations No rich client-side support: No Grid service-specific support But Grid services ARE Web services! GSH / GSR support Subset of OGSI portTypes Security But can secure using ASP.NET Web Services Security No GWSDL

23 MS.NETGrid-OGSI Implementation of OGSI on Microsoft.NET Leverages ASP.NET functionality Provides support for: Grid service hosting in ASP.NET Web services container GridService portType-related functionality Factory portType-related functionality Service data management Management of persistent and transient services

24 C# Implementation ASP.NET Client-Service Interaction C# Implementation Client Proxy (from WSDL) Proxy (from WSDL) 8. C# method return 1. C# method call HTTP 2. SOAP request 7. SOAP response OGSI Container Grid Service Web Service Proxy (.asmx) 4. Grid Service Object Reference 3. Grid Service ID 5. Operation Call 6. Operation Return

25 Service Lifetime and Naming Persistent services: Server-managed services Necessary for factories, permanent services Naming  eServiceFactory.asmx Transient services: Client-managed services Naming  Service.asmx?instanceID=someService1

26 Service Proxy Model Service proxy is standard ASP.NET Web service Created – processes request - dies Communications layer between client and Grid services: One proxy type corresponds to one or more Grid services One instance of a proxy created per service request to.asmx file GSH is used by proxy to find Grid service object Reflection allows invocation of a service method on that object Operations exposed via WebMethod attributes SOAP communication and WSDL description for free! Familiar model to ASP.NET users Potential for auto-generation of proxy code

27 Developing a Grid Service

28 Grid Service Design What services will your Grid service provide? What operations will it support? How are these operations aggregated into portTypes? What existing and new portTypes will your service implement? No need to write WSDL!

29 Grid Service Development Implement the service functionality: GridServiceSkeleton -derived OR PersistentGridServiceSkeleton -derived PortTypeProviders for portTypes Provide a service proxy class: Communications layer between clients and services No original effort required! Represents the most-derived portType Inherits from GridServiceInstanceAspProxy (which derives from ASP.NET class WebService ) Deploy the service: ASP.NET Web service deployment descriptor ( Web.config ) Location of classes and proxies / service lifetime type Application-specific information

30 Implement the Service Functionality

31 MS.NETGrid-OGSI Classes Inherit from: GridServiceSkeleton OR PersistentGridServiceSkeleton Hello Service: public class HelloServiceImpl : PersistentGridServiceSkeleton { }

32 GridServiceSkeleton (1) Implements GridService portType functionality: findServiceData, setServiceData, requestTerminationBefore, requestTerminationAfter, destroy InstanceServiceDataSet property: ServiceDataSet for the live running service instance ServiceDataSet and ServiceData APIs ServiceParameters property: General purpose hashtable Loaded with configuration data from a deployment descriptor when service is initialised PortTypeProviders property: Hashtable containing references to implementations of portTypes

33 GridServiceSkeleton (2) PostCreate method public abstract class GridServiceSkeleton { public virtual void PostCreate() { } } Can be used for resource acquisition, service data initialisation, other initialisation: Called by the container or factory when service is created Store useful items in ServiceParameters hashtable Only for objects used by all the portTypes of a service

34 Implementing PortType Operations Option 1 - Inheritance: Provide methods on a GridServiceSkeleton -derived class Recommended when only one portType is required Quick and convenient Option 2 – PortType Providers: Use IPortTypeProvider implementations Use OgsiPortType attribute to associate with service class PortTypeProviders property of GridServiceSkeleton  Maps requests to IPortTypeProvider instances Modularises portType and service implementations

35 Inheritance public class HelloServiceImpl : PersistentGridServiceSkeleton { int i = 0; // sayHello is an operation on some portType public string sayHello(string name) { return “Hello, “ + name + “ “ + (++i); } }

36 PortType Providers (1) public class HelloPortType : PortTypeProviderBase { int i = 0; public string sayHello(string name) { return “Hello, “ + name + “ “ + (++i); } public override void Initialise() { } } // Declare service and attach portType using attribute [OgsiPortType(typeof(HelloPortType), “”, “HelloPortType”] public class HelloServiceImpl : PersistentGridServiceSkeleton { }

37 PortType Providers (2) public interface IPortTypeProvider { GridServiceSkeleton ServiceInstance { get; set; } void Initialise(); } Provides for: Access to service instance Custom initialisation code – called after the IPortTypeProvider is created Attach to service with OgsiPortTypeAttribute PortTypeProviderBase gives simple implementation of PortTypeProvider

38 How PortType Providers Work Attributes and reflection! On instantiation of GridServiceSkeleton : Reflects upon self to get OgsiPortType attributes Uses the information in the attributes to instantiate implementation classes [OgsiPortType(typeof(HelloPortType), “”, “HelloPortType”] Stores instances in PortTypeProviders hashtable Methods can then be called on these instances

39 Service Data Named like any XML element: (namespace, local name) Represented by an instance of the Ogsi.ServiceData.ServiceData type ServiceDataSet type represents the entire collection of service data for a service GridServiceSkeleton.InstanceServiceData

40 Service Data APIs ServiceDataSet: Create(XmlQualifiedName name); Add(ServiceData data); Contains(XmlQualifiedName name); Delete(XmlQualifiedName name); Remove(XmlQualifiedName name); ServiceData: Contains System.Object(s) GetValues() / GetValuesArray() Value property SetValues(object [ ]) Callback property for on-demand generation  Uses IServiceDataValuesCallback

41 Provide a Service Proxy Class

42 Service Proxies Communications layer between clients and Grid service objects Proxies are Web services Based on System.Web.Services.WebService class of ASP.NET Allows ASP.NET to forward service requests to/from Grid service objects: GridServiceInstanceAspProxy and PersistentGridServiceInstanceAspProxy

43 Proxies and Inheritance // HelloService.cs public class HelloService : PersistentGridServiceInstanceAspProxy { [WebMethod] // Any other ASP.NET attributes public string SayHello(string name) { object [] args = { name }; return (string) CallMethod(“SayHello”, args); } } GridServiceInstanceAspProxy / PersistentGridServiceInstanceAspProxy constructor provides reference to service instance object via container CallMethod invokes on service instance object

44 Proxies and PortType Providers // HelloService.cs public class HelloService : PersistentGridServiceInstanceAspProxy { [WebMethod] // Any other ASP.NET attributes public string SayHello(string name) { object [] args = { name }; return (string) CallMethodOnProvider(“HelloPortType”, “SayHello”, args); } }

45 Completing the Proxy Write.asmx file which references proxy type

46 Deploy the Service

47 Deployment Descriptors and ASP.NET Web.Config gridContainer element Add gridServiceDeploymentDescriptor : Attributes: asmxFileName -.asmx file for proxy service – main service implementation class assembly - service and proxy assembly persistence - transient or persistent

48 Provide the Service Copy assemblies to Ogsi.Container/bin/ directory Copy.asmx file to: services/persistent directory OR services/transient directory

49 Grid Service Demonstrators

50 Representative examples provided with the MS.NETGrid-OGSI distribution Basic GridService: Implements GridService portType Persistent and transient services available, with factory Counter Service: A simple transient counter service which maintains state An associated persistent factory service A client with a graphical user-interface

51 Open Grid Services Architecture – Data Access and Integration Stripped down from full OGSA-DAI functionality Service-database communication over ADO.NET OGSA-DAI Grid Data Service (1) Grid Data Service SQL Server Client Request (GDS-Perform document) Response (GDS-Response document) ( WebRowSet )

52 OGSA-DAI Grid Data Service (2)

53 Training the UK e-Science Community

54 Training Courses “OGSI on Microsoft.NET” Designed for UK e-Scientists Four courses each for 25 attendees: September 9 th -10 th 2003 November 4 th -5 th 2003 January 27 th -28 th 2004 February 2004 e-Science Institute in Edinburgh

55 Course Goals Introduce / review: Grid Services Microsoft.NET Introduce OGSI on Microsoft.NET MS.NETGrid-OGSI Use MS.NETGrid-OGSI: Develop a Grid Service Develop a client Introduce related OGSI on Microsoft.NET work

56 Course Outline – Day 1 Welcome and Workshop Overview Grid Services Web Services and XML Grids, OGSA and OGSI Essential Microsoft.NET Concepts.NET Framework Overview C# Recap, Assemblies and Using Metadata ASP.NET OGSI and.NET Why OGSI on.NET? MS.NETGrid-OGSI Obtaining, installing and testing MS.NETGrid-OGSI Practical

57 Course Outline – Day 2 Recap Developing a Grid Service 1 Practical Developing a Grid Service 2 Practical Developing a Grid Service 3 Practical Miscellaneous: MS.NETGrid-OGSI Demonstrators Course Feedback Discussion

58 Near Future Revision of OGSI on.NET container Facilitating scalability and service persistence Development of additional Grid service demonstrators: Practical demonstration of the utility of OGSI on.NET Revision of training materials: Courses and supporting materials on OGSI and.NET Delivery of additional courses

Download ppt "OGSI on Microsoft.NET Daragh Byrne, Ally Hume, Mike Jackson EPCC Budapest, Hungary – November."

Similar presentations

Ads by Google