Classroom Exercises for Grid Services

Similar documents
Globus Toolkit 3 Tutorial. Grid Development Group San Diego Supercomputer Center

Java Development and Grid Computing with the Globus Toolkit Version 3

Apache Axis. Dr. Kanda Runapongsa Department of Computer Engineering Khon Kaen University. Overview

Developing Web Services. with Axis. Web Languages Course 2009 University of Trento

Exercise SBPM Session-4 : Web Services

Grid Computing. Five Steps. Globus Toolkit Programming GT4 Tutorial Chapter 3. Directory Layout. Grid Computing Fall 2006 Paul A. Farrell 10/23/2006

Design The way components fit together

Grid Services and the Globus Toolkit

Grid Computing. Five Steps. How Chapter 3 example worked. Globus Toolkit Programming GT4 Tutorial Chapter 4. Grid Computing Fall 2006 Paul A.

Tutorial 1: Introduction to Globus Toolkit. John Watt, National e-science Centre

Grid Computing. Resource Properties so far. Resource Property Document. Globus Toolkit Programming GT4 Tutorial Chapter 6 Resource Properties

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

Overview Interactive Data Language Design of parallel IDL on a grid Design of IDL clients for Web/Grid Service Status Conclusions

A short introduction to Web Services

Opal: Wrapping Scientific Applications as Web Services

Research and Design Application Platform of Service Grid Based on WSRF

Installation and Administration

GT-OGSA Grid Service Infrastructure

Introduction to GT3. Introduction to GT3. What is a Grid? A Story of Evolution. The Globus Project

4.1.1 JWS (Java Web Service) Files Instant Deployment

Programming Web Services in Java

DS 2009: middleware. David Evans

Grid Computing. Java Remote Method Invocation (RMI) RMI Application. Grid Computing Fall 2006 Paul A. Farrell 9/5/2006

Creating Web Services with Apache Axis

On-Line Monitoring of Multi-Area Power Systems in Distributed Environment

Lupin: from Web Services to Web-based Problem Solving Environments

Web Services. GC: Web Services Part 3: Rajeev Wankar

Building Services in WSRF. Ben Clifford GGF Summer School July 2004

Introduction. Software Trends. Topics for Discussion. Grid Technology. GridForce:

Grid Computing Initiative at UI: A Preliminary Result

OGSI.NET UVa Grid Computing Group. OGSI.NET Developer Tutorial

3. ก ก (deploy web service)

Grid Computing Fall 2005 Lecture 5: Grid Architecture and Globus. Gabrielle Allen

Regular Forum of Lreis. Speechmaker: Gao Ang

Implementation Method of OGC Web Map Service Based on Web Service. Anthony Wenjue Jia *,Yumin Chen *,Jianya Gong * *Wuhan University

Pieces of the puzzle. Wednesday, March 09, :29 PM

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

The Globus Toolkit 3 Programmer's Tutorial. Borja Sotomayor

DOC // JAVA TOMCAT WEB SERVICES TUTORIAL EBOOK

How to Build a Service Using GT4

Web Services in Java. The shortest path to exposing and consuming web services in Java

Invoking Web Services. with Axis. Web Languages Course 2009 University of Trento

UNIT - V. 1. What is the concept behind JAX-RPC technology? (NOV/DEC 2011)

How to Build a Service Using GT4

MyLEAD Release V1.3 Installation Guide

Axis C++ Linux User Guide

Design The way components fit together

(9A05803) WEB SERVICES (ELECTIVE - III)

Towards a Top-Down Approach to Teaching an Undergraduate Grid Computing Course

Introduction of PDE.Mart

Agent-Enabling Transformation of E-Commerce Portals with Web Services

Grid-Based PDE.Mart: A PDE-Oriented PSE for Grid Computing

SUN. Java Platform Enterprise Edition 6 Web Services Developer Certified Professional

PART VII Building Web Services With JAX-RPC. 7.5 JAX Web Service Architecture. Development of a Web Service with JAX. Runtime View of a Web Service

Introduce Grid Service Authoring Toolkit

A Geographically-Distributed, Assignment-Structured Undergraduate Grid Computing Course

WS-Resource Framework: Globus Alliance Perspectives

Oracle Service Bus. Interoperability with EJB Transport 10g Release 3 (10.3) October 2008

A user-friendly platform for developing and accessing grid services

From Web Services Toward Grid Services

ICENI: An Open Grid Service Architecture Implemented with Jini Nathalie Furmento, William Lee, Anthony Mayer, Steven Newhouse, and John Darlington

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

WDSL and PowerBuilder 9. A Sybase White Paper by Berndt Hamboeck

Developing Interoperable Web Services for the Enterprise

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

WSMetacatService a GT4 Web Service Wrapper for Metacat

IBD Intergiciels et Bases de Données

Introduction to GT3. Overview. Installation Pre-requisites GT3.2. Overview of Installing GT3

Pace University. Web Service Workshop Lab Manual

Globus GTK and Grid Services

Opal: Simple Web Services Wrappers for Scientific Applications

Introduction to Web Services

Lecture 15: Frameworks for Application-layer Communications

Lecture 15: Frameworks for Application-layer Communications

Enterprise JavaBeans, Version 3 (EJB3) Programming

WIRIS quizzes web services Getting started with PHP and Java

Getting Started with the Bullhorn SOAP API and Java

5.4. Events and notifications

XML to Lucene to SRW

Zukünftige Dienste im D-Grid: Neue Anforderungen an die Rechenzentren?

Remote Method Invocation

RadBlue s S2S Quick Start Package (RQS) Developer s Guide. Version 0.1

Web Services Security

An Introduction to Grid Computing

Introduction to Web Services & SOA

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Deccansoft Software Services. J2EE Syllabus

Java J Course Outline

WEB SERVICES DYNAMIC CLIENT GUIDE

1Z Oracle. Java Platform Enterprise Edition 6 Web Services Developer Certified Expert

BEAWebLogic Server. WebLogic Web Services: Advanced Programming

The Opal Toolkit. Wrapping Scientific Applications as Web Services

Component-Based Software Engineering

Oracle 10g: Build J2EE Applications

RPC. Remote Procedure Calls. Robert Grimm New York University

Remote Method Invocation in Java

Web Services Development for IBM WebSphere Application Server V7.0

Overview of Web Services API

Techniques for Building J2EE Applications

Transcription:

Classroom Exercises for Grid Services Amy Apon, Jens Mache L&C Yuriko Yara, Kurt Landrus Grid Computing Grid computing is way of organizing computing resources so that they can be flexibly and dynamically allocated and accessed There is a lot of research-related material on Grid computing, but very little that focuses on Grid computing in an undergraduate classroom setting Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 2

Overall Goals of this work Remove some of the mystery of Grid computing for students (alphabet soup!) OGSA Open Grid Services Architecture is a standard developed by the Global Grid Forum (GGF) OGSI Open Grid Services Infrastructure GT3 Globus Toolkit version 3 Describe the core knowledge units for Grid Create and evaluate a set of exercises that can be used in a classroom setting in conjunction with existing literature Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 3 From http://www.globus.org Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 4

Grid Services Common interface specification supports the interoperability of discrete, independently developed services Concept similar to Remote Procedure Call (RPC), Remote Method Invocation (RMI), only applied over HTTP Based on extensions of Web Services Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 5 Web Services From http://www.globus.org Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 6

Web Services missing features At the time the OGSI V1.0 spec was published there was a gap between the need to define stateful Web Services and what was provided by the latest version of Web Services in WSDL 1.1 Web Services were stateless and non-transient The result was the definition in OGSI of Service Data a common mechanism to expose a service instance s state data for query, update, and change notification Also, Grid Services uses a Factory to manage instances to allow transient and private instances Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 7 Grid Services Factory From http://www.globus.org Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 8

Web Services Exercise Motivation: Most undergraduates are familiar with user-level web access and client/server systems, but not the concept of remote procedure call or data marshalling need 2-3 lectures on these topics before the exercise Marshalling using XML HTTP, SOAP, WSDL Semantics: at-most-once, exactly once, Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 9 Web Services Exercise First, perform a simple Web access using telnet telnet www 80 (hit RETURN key once) GET / HTTP/1.0 (hit RETURN key twice) Second, access a well known Web service http://www.xmethods.net/ve2 Third, write a Web Service using Java and Axis There are many tool choices; this one interoperates with GT3 and provides a learning path for the students Axis is the continuation of Apache SOAP it includes SOAP plus Web Services API s (WSDL, UDDI, ) Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 10

Writing a Simple Web Service Step 1: Create the service source using Java save as a.jws (Java Web Service) file public class MyMath { public int squared(int x) { return x * x; }} Unlike traditional RPC, the service code is written first, and the interface will be generated from it Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 11 Writing a Simple Web Service Step 2: Use Axis tools to automatically generate the WSDL interface file java -classpath $AXISCLASSPATH org.apache.axis.wsdl.wsdl2java http://localhost:8080/axis/mymath.jws?wsdl Can also do this step by accessing the file from a browser. Axis locates the file, compiles the class, and converts SOAP calls into Java This example hardcodes the server pathname in the client stub Step 3: Compile the client stubs that were generated by the previous step javac -classpath $AXISCLASSPATH edu/uark/csce/kite/axis/mymath_jws/*.java Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 12

Step 4: Write the Client Source and Compile import edu.uark.csce.kite.axis.mymath_jws.mymathservicelocator; import edu.uark.csce.kite.axis.mymath_jws.mymathservice; import edu.uark.csce.kite.axis.mymath_jws.mymath; public class MyMathClient { public static void main(string args[]) throws Exception { MyMathService service = new MyMathServiceLocator(); MyMath mymath = service.getmymath(); int x = (new Integer(args[0])).intValue(); System.out.println("The square of " + args[0] + " is " + mymath.squared(x)); }} Compile with: javac -classpath $AXISCLASSPATH:. MyMathClient.java (Assumes that the $AXISCLASSPATH is set up correctly.) Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 13 Web Service program execution java -classpath $AXISCLASSPATH MyMathClient 4 The square of 4 is 16 Axis runs in a servlet container such as Tomcat The Axis environment executes the server when it is called. Pretty simple, huh? The difficulties come with the setup of the environment more on that in a bit. Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 14

Alternatives to Simple Approach Can deploy using WSDD (Web Services Deployment Descriptor) instead of using a.jws file Write the interface in WSDL (or write in Java and convert to WSDL) Use Axis or equivalent tools as before to generate stubs Write the implementation of the service in Java Write the deployment descriptor using WSDD Deploy on the server using the Axis admin client Or, you can use a build file and ant to generate stubs and make a jar file for deployment (like the next exercise). Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 15 Grid Services Exercise Motivation: Web services are stateless, whereas Grid services can be either stateful or stateless, and transient or persistent. Grid services also use a factory pattern to manufacture instances. Build on the Web Services example Show how to create a stateful Grid service and how Grid services differ from Web services using GT3 Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 16

Grid Services Exercise Using GT3 Step 1: Define the Service interface using Java public interface Math { public void add(int a); public void subtract(int a); public int getvalue(); } This server is stateful. The value can be modified via add or subtract, and can be accessed via getvalue. GT3 provides tools for converting the Java to WSDL Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 17 Step 2: Implement the Service public class MathImpl extends GridServiceImpl implements MathPortType { private int value = 0; } public MathImpl() { super( Math Factory Service ); } public void add(int a) throws RemoteException { value = value + a; } public void subtract(int a) throws RemoteException { value = value - a; } public int getvalue() throws RemoteException { return value; } Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 18

Step 3: Write the Deployment Descriptor using Web Service Deployment Descriptor (WSDD) format <?xml version="1.0"?> <deployment name="defaultserverconfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="tutorial/core/factory/mathfactoryservice" provider="handler" style="wrapped"> <parameter name="name" value="mathservice Factory"/> <parameter name="instance-name" value="mathservice Instance"/> <parameter name="instance-schemapath" value="schema/gt3tutorial.core.factory/math/mathservice.wsdl"/> <parameter name="instance-baseclassname" value="gt3tutorial.core.factory.impl.mathimpl"/> <!-- Start common parameters --> <parameter name="allowedmethods" value="*"/> <parameter name="persistent" value="true"/> <parameter name="classname" value="org.gridforum.ogsi.factory"/> <parameter name="baseclassname" value="org.globus.ogsa.impl.ogsi.persistentgridserviceimpl"/> <parameter name="schemapath" value="schema/ogsi/ogsi_factory_service.wsdl"/> <parameter name="handlerclass" value="org.globus.ogsa.handlers.rpcuriprovider"/> <parameter name="factorycallback" value="org.globus.ogsa.impl.ogsi.dynamicfactorycallbackimpl"/> <parameter name="operationproviders" value="org.globus.ogsa.impl.ogsi.factoryprovider"/> </service> </deployment> Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 19 Step 4: Compile and deploy the Service using ant [aapon@kite tutorial]$./tutorial_build.sh gt3tutorial/core/factory/impl/math.java You can see gar and jar files that ant creates from the source files. [aapon@kite] newgrp globus [aapon@kite] cd $GLOBUS_LOCATION [aapon@kite] ant deploy - Dgar.name=/home/aapon/tutorial/build/lib/gt3tutorial.core.factory.Math.gar Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 20

Step 5: Write and compile the client public class MathClient { public static void main(string[] args) { try { // Get command-line arguments URL GSH = new java.net.url(args[0]); int a = Integer.parseInt(args[1]); // Get a reference to the MathService instance MathServiceGridLocator myservicelocator = new MathServiceGridLocator(); MathPortType myprog = myservicelocator.getmathservice(gsh); // Call remote method 'add' myprog.add(a); System.out.println("Added " + a); // Get current value through remote method 'getvalue' int value = myprog.getvalue(); System.out.println("Current value: " + value); }catch(exception e) { System.out.println("ERROR!"); e.printstacktrace(); } } Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 21 Step 6: Start the Service and execute the client Start the Service [aapon@kite] globus-start-container -p 8081 Create the service instance. This client does not create a new instance when it runs; thus, the instance needs to be created the first time. [aapon@kite] ogsi-create-service http://localhost:8081/ogsa/services/tutorial/core/factory/mathfactoryservice myprog This ogsi-create-service has two arguments: the service handle GSH and the name of the instance we want to create. Execute the client [aapon@kite tutorial] java gt3tutorial.core.factory.client.mathclient http://localhost:8081/ogsa/services/tutorial/core/factory/mathfactoryservice/myprog 4 You will see the following result: Added 4 Current value: 4 Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 22

Assessment of the Exercises The response from the students was very favorable. Most finished the Grid exercise in about two hours. They generally felt prepared and ready to do a more complicated Grid program. You have to be very proficient at Java to use GT3. Setup of the environment is key to the success of the exercises Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 23 Environmental Setup We set up GT3 first, then added the Web Services setup Rocks cluster distribution with installed rolls java 3.1.0-0 grid 3.1.0-0 sge 3.1.0-0 hpc 3.1.0-0 Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 24

GT3 Setup for classroom exercises Current version of Rocks ships without the complete GT3 installation Had to install the full Globus Toolkit 3 Future versions of Rocks will be based on NMI Toolkit version 5, which does include GT3 Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 25 GT3 Setup for classroom exercises GT3 not set up for a multiuser environment - ant uses a common build directory for the deployment of all services Added all users to a common globus group Had users create unique service names Had users revise the subdirectory structure of services in the user s home directory Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 26

Web Services Setup Grid Services extends Web Services and uses Axis. However, the GT3 installation does not support Web Services development using Axis Had to install and configure the Tomcat servlet container to support the Axis tools for the example Java version "1.4.2_02" Jakarta Tomcat Ver 4.1.29 http://jakarta.apache.org/tomcat/index.html Apache Axis Ver 1.1 http://xml.apache.org/axis Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 27 Web Services Setup A shell script was used to set the environmental variables so that Java can find all of the required libraries #!/bin/sh AXIS_HOME=/usr/local/axis AXIS_LIB=$AXIS_HOME/lib AXISCLASSPATH=$AXIS_LIB/axis.jar:$AXIS_LIB/commonsdiscovery.jar:$AXIS_LIB/commonslogging.jar:$AXIS_LIB/jaxrpc.jar:$AXIS_LIB/saaj.jar:$AXIS_LIB/log4j- 1.2.8.jar:$AXIS_LIB/xml-apis.jar: $AXIS_LIB/xercesImpl.jar: $AXIS_LIB/wsdl4j.jar:. export AXIS_HOME AXIS_LIB AXISCLASSPATH # this is missing in the docs!! Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 28

Recent Changes to Grid Standards Introduction of Web Services Resource Framework (WSRF), January, 2004 Web services vendors recognized the importance of OGSI concept but would not adopt OGSI as it was defined (summer 2003) Globus Alliance teamed up with Web services architects and came up with WSRF (Jan., 2004) Add the ability to create, address, inspect, discover, and manage stateful resources Beta versions of GT4 are anticipated Sept., 2004 Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 29 Future Work Additional classroom exercises for Grid computing are planned! Improve scripts for Globus Toolkit Incorporation of WSRF Notification Service Discovery GRAM Access to Grid data http://csce.uark.edu/~aapon/grid.edu2004 http://csce.uark.edu/~aapon/ Amy Apon, Ph.D. University of Arkansas May 20, 2004 Page 30