46
Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Embed Size (px)

Citation preview

Page 1: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Grid Services

Grid Enablement of Scientific ApplicationsPresent by Mark Joselli

Professor S. Masoud Sadjadi

Page 2: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Services Grid Services

Page 3: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Service. (W3C definition)• A Web service is a software system designed to

support interoperable machine-to-machine interaction over a network.

• It has an interface described in a machine-processable format (specifically WSDL).

• Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.

Page 4: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

In plain words, they provide a good mechanism to connect over a network heterogeneous systems.

For that to happen it uses: WSDL, XML, SOAP…

Page 5: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Sample Interaction

Buyer Amazon.com

login

buy a book

login ok

price information

confirm purchase

Key things to note:

Request/response

Page 6: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

The Web Service state machine

2. Client looks up the service in the registry

3. Client interacts with the service

1. Service advertises itself in the registry

Page 7: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Why web services?

Can we not do above interaction with traditional client/server protocols

Yes ! But,

We want to talk to any service in the same language in the same way

Page 8: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Services Technologies

The Protocol Stack Service Discovery

UDDI Service Description

WSDL (XML-based) Messaging

SOAP (XML-based) Service Transport

HTTP, SMTP etc.

XML Messaging

Service Transport

Service Discovery

Service Description

Page 9: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

XML (Extensible Markup Language) A language for describing data Platform independent and self-describing Good for distributed computing where

heterogeneous systems co-exist

Page 10: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

XML - Example

<?xml version="1.0"?>

<contact-info>

<name>John Smith</name> <company>University of Florida</company> <phone>352-392-1200</phone>

</contact-info>

</xml>

xml declaration

start tag

end tag text

Page 11: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Services Interaction

Web ServiceUser

XML

Resource (database, CPU,

storage …)

Page 12: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

An example scenario

Buyer Amazon.comWSD (Web service description) (show the wsdl in the text

box)

Returned SOAP message

Tell me about your service

<portType name=“BookService"> <operation name=“buyBook"> <input name=“bookName“ message="tns:bookName"/> <output name=“price" message="tns:price"/> </operation>

</portType>

Send a SOAP message (show the soap message in the text box)

Page 13: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Typical Web Service Invocation

The Globus Toolkit 4 Tutorial.http://gdp.globus.org/gt4-tutorial/

Page 14: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

UDDI

client

service

2. Client looks up the service in the registry (UDDI) and gets a WSDL description

3. Client interacts with the service (SOAP + HTTP + XML)

The Web Service state machine

1. Service advertises itself in the registry (UDDI)

Page 15: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

SOAP (Simple Object Access Protocol) SOAP is a protocol specification that defines a

uniform way of passing XML-encoded data In also defines a way to perform remote procedure

calls (RPCs) using HTTP as the underlying communication protocol

It is the underlying protocol for all web services

Page 16: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Soap Message

Structure of SOAP Messages

Envelope (required)

Header (optional)

Body (required)

Fault (optional)

Page 17: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

XML messaging using SOAP

Application Web Service

SOAP

Network protocols (HTTP

…)

SOAP

Network protocols (HTTP

…)

Page 18: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

WSDL (Web Service Description Language) Now, we know how to send messages. But, how do

we find out about the web service interface? Answer: WSDL !!!

WSDL provides a way for service providers to describe the basic format of web service requests over different protocols or encodings

It provides the following information about the service What the service can do Where it resides How to invoke it

Page 19: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Contents of a WSDL document<definitions>

<types> definition of types........

</types> <message>

definition of a message.... </message> <portType>

definition of a port....... </portType> <binding> definition of a binding.... </binding>

</definitions>

Page 20: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

portType

WSDL portType is the most important element of the document

It defines the operations that can be performed on a web service

<portType name=“Hello"> <operation name=“greeting"> <input name=“name" message=“greetingRequest"/>

<output name=“response” message=“greetingResponse"/> </operation>

</portType >

Page 21: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Messages and Types

But, to describe the operation we also have to identify the messages that need to be sent and type of the elements that are sent in the messages <message name=“greetingRequest">

<part name=“input" type="xs:string"/> </message> <message name=“greetingResponse">

<part name="value" type="xs:string"/> </message>

As you can see, various types can be specified for the messages

Page 22: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Binding

The binding element describes the way the message needs to be encoded (usually using SOAP)<binding type=“Hello" name=“myBinding"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

<operation> <soap:operation soapAction="http://example.com/Hello"/>

<input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output>

</operation> </binding>

Page 23: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

<definitions name=“Hello" targetNamespace="http://hello.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name=“greetingRequest">

<part name=“input" type="xs:string"/> </message> <message name=“greetingResponse">

<part name="value" type="xs:string"/> </message><portType name=“Hello"> <operation name=“greeting"> <input name=“name" message=“greetingRequest"/> <output name=“response” message=“greetingResponse"/> </operation> </portType ><binding type=“Hello" name=“myBinding"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation> <soap:operation soapAction="http://example.com/Hello"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding></definitions>

portType

binding

message

Page 24: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

UDDI (Universal Description, Discovery and Integration)

A protocol for finding web services Registries of web services can be maintained The primary purpose is to find services with

certain qualities

Page 25: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

UDDI

BusinessEntity (company description)

BusinessService (Service Description)

BindingTemplate (service technical description) modeled as a tModel

BusinessEntity Information about a

company (name of the company, contact info etc.)

Kind of company BusinessEntity contains

BusinessService elements that represent the services the company offers

Each BusinessService contains BindingTemplates that describe the services

Page 26: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

stateless vs. stateful web service Stateless web services don’t “remember” information

from one invocation to another whereas stateful Web Services do.

When Web Services are used just to create Internet-based applications with loosely coupled clients and servers, they can be stateless. The service can be restarted without concern of previous interactions.

When Web Services are used to create Grid Applications, they are generally required to be stateful.

Page 27: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Stateful web services example

Buyer Amazon.com

login

login ok, your shopping cart id is 0x800

logout

login and my id is 0x800

Your shopping cart has …

Page 28: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Problems

No standard on how to do this Client needs to have special code Some protocol specific features like cookies

can be used

Page 29: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Grid Services

So, what are these grid services anyway? Grid services are web services that are customized

to grid environment Similar to web services they provide the glue to

interact with heterogeneous systems Why do we need them? What do they provide?

Page 30: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Services vs Grid Services Though web services are great, some key

things that are required on the grid are missing State management Global Service Naming Reference resolution more …

Page 31: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Services vs Grid Services Wait a minute ! I can do all those things with

web services, can’t I? YES ! You can But,

The standards don’t provide (yet) the required mechanisms. Work is being done to figure out the best way to do these things

Page 32: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Achieving Statefulness

The state is kept in a separate entity called a resource.

Each resource has a unique key.

The Globus Toolkit 4 Tutorial.http://gdp.globus.org/gt4-tutorial/

Page 33: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

OGSA Introduction

Grid systems and applications aim to integrate, virtualize and manage resources and services within distributed, heterogeneous, dynamic “virtual organizations”

Items needed Computers, application services, data, and other resources need

to be accessed within different organizations Standardization

Open Grid Services Architecture (OGSA) Is a service-oriented architecture (SOA), that addresses the

need for standardization by defining a set of core capabilities and behaviors that address key concerns in Grid systems

SOA: A perspective of software architecture that defines the use of services to support the requirements of software users. Enables the creation of applications that are built by combining loosely coupled and interoperable services

Page 34: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

OGSA

OPEN GRID SERVICES ARCHITECTURE (OGSA) VO Management Service. Resource Discovery and Management Service. Job Management Service. … security, data management, etc.

Page 35: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

OGSI

OGSI defines the mechanisms to create grid services

Introduces the notion of grid services and their special properties particularly the global pointer GSH (Grid Service Handle)

Page 36: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Grid Service Handle (GSH) Publish GSR

Bind

Service Consumer

Client

Service Provider

Grid Service

OGSI Registry

Grid Service Reference(GSR)

Legendrequest flow

reply flow

program boundary

module boundary

Reply

Grid Service Reference

OGSA is the architecture, OGSI is the infrastructure.

Grid service interface standard Methods allow access to Grid

service As well as Grid service state

(SDE) Optional factory interface Naming and referencing of Grid

services Extends WSDL 1.1 (GWSDL) Handle resolver Notifications

OGSI Grid service locator:•Multiple GHSs + GSRs + interface description

OGSI - 2001

Page 37: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Grid Services as seen by OGSI Connect to the grid service Ask the server to create an instance for you Get a unique global pointer to it Interact with the service

Page 38: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

OGSI Issues

Confusion and Criticism from web services folks

Modeling stateful resource with Web services Web service Resource Framework (WS-RF)

2004

Page 39: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

WSRF

Stands for Web Services Resource Framework

Improves on the concept of Web Services by creating a separate view for the resource state.

Simplifies WSDL and reduces message size and complexity (XML gets heavy and complicated fast)

Modular (users decide which specification to use)

Jonatan Alava
WSRF is also a haitian radio station here in South FloridaXquery and tigerlogic XML servers
Page 40: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

WS-Resource

Provides a means of expressing the relationship between stateful resources and web services

The WS-Resource has an XML resource property document defined using XML schema.

The requestor can determine the WS-Resource type by retrieving the portType

Web service programming paradigm is used to interact with the resource

Page 41: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Web Services and Grids - OGSA OGSI problems solved by WSRF

Grid

Web

WSRF

Started far apart in apps & tech

OGSI

GT2

GT1

HTTPWSDL,

WS-*

WSDL 2,

WSDM

Have beenconverging

Jonatan Alava
OGSA requires stateful entities. Web Services are by nature statelessWSDl would be way too complex with OGSIWhat is the Open Grid Service Infrastructure (OGSI)?The Open Grid Services Infrastructure (OGSI) is a set of WSDL specifications defining standard interfaces, behaviors, and schema for grid computing consistent with the OGSA vision. These interfaces and behaviors define the Grid Service. The latest version of the OGSI Specification is available from the OGSI Working Group in the Global Grid Forum. The OGSI specification is being implemented on a number of different platforms including .NET (by this project), Java (GT3 from the Globus Project) and others.
Page 42: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Global Toolkit

The Globus Toolkit is a software toolkit, developed by The Globus Alliance, which can be used to program grid-based applications.

Globus Toolkit includes a resource monitoring and discovery service, a job submission infrastructure, a security infrastructure, and data management services;

Page 43: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

WS-GRAM

Globus Tookit 4 contains a web service-based Grid Resource Allocation and Management (GRAM) component.

WS-GRAM is a WSRF-based web service used by computational resources on the Teragrid to remotely submit, monitor, and cancel jobs.

These jobs may be either be interactive jobs which tend to perform simple tasks which complete quickly, or they may be jobs managed by a scheduler.

Page 44: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Programming Grid Services (GT4) Basic steps involved in creating a grid service

Create the interface using WSDL Specify the portTypes, messages and data encoding

Generate Stubs Add functionality Compile and Build the code using Globus libraries Create a GAR (Grid Archive) Deploy it

Page 45: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

OGSA, WSRF & GT4

B. Sotomayor and L. Childers. Globus Toolkit 4, Programming Java Services. 2006. The Morgan Kaufmann Series in Networking.

Page 46: Grid Services Grid Enablement of Scientific Applications Present by Mark Joselli Professor S. Masoud Sadjadi

Bibliografy

Masoud Sadjadi’s Lecute Lecture on Developing Grid Services on LA Grid

Laukik Chitnis and Sanjay Ranka’s Tutorial on Grid Onyeka Ezenwoye’s Lecture on Web Services TeraGridForum wiki:

http://www.teragridforum.org/mediawiki/index.php?title=WS-Gram

Python WSRF Programmers' Tutorial: http://acs.lbl.gov/gtg/projects/pyGridWare/doc/tutorial/html/c182.html