TeraGrid’07, June 4-8, 2007, Madison, WI 1 Building Blocks for a Simple TeraGrid Science Gateway Yan Liu and Shaowen Wang Grid Research & educatiOn group.

Slides:



Advertisements
Similar presentations
PRAGMA BioSciences Portal Raj Chhabra Susumu Date Junya Seo Yohei Sawai.
Advertisements

Using the Collaborative Tools in NEESgrid Charles Severance University of Michigan.
Grid Resource Allocation Management (GRAM) GRAM provides the user to access the grid in order to run, terminate and monitor jobs remotely. The job request.
The Developer Perspective Michelle Osmond. Design – Requirements Gathering Sales & Research projects –Prototypes/Demos User group meetings Usability workshops.
Starting with Gridsphere Albert Einstein Institute Gridsphere Installation.
Slides for Grid Computing: Techniques and Applications by Barry Wilkinson, Chapman & Hall/CRC press, © Chapter 1, pp For educational use only.
1-2.1 Grid computing infrastructure software Brief introduction to Globus © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. Modification.
Indianapolis Java User Group JSR-168 Portal Presentation Introduction: Kurt Desserich.
Globus Computing Infrustructure Software Globus Toolkit 11-2.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Web-based Portal for Discovery, Retrieval and Visualization of Earth Science Datasets in Grid Environment Zhenping (Jane) Liu.
UNIT-V The MVC architecture and Struts Framework.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
TeraGrid Information Services December 1, 2006 JP Navarro GIG Software Integration.
CloudBroker integration to WS- PGRADE/gUSE Zoltán Farkas MTA SZTAKI LPDS
Indianapolis Java User Group Portal Presentation - Part 2 Introduction: Kurt Desserich.
Holding slide prior to starting show. A Grid-based Problem Solving Environment for GECEM Maria Lin and David Walker Cardiff University Yu Chen and Jason.
Building Cyberinfrastructure-Enabled and Community-Centric Science Gateway Applications Yan Liu 1, Shaowen Wang 1, and Nancy Wilkins-Diehr 2 1 CyberInfrastructure.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
The gLite API – PART I Giuseppe LA ROCCA INFN Catania ACGRID-II School 2-14 November 2009 Kuala Lumpur - Malaysia.
Grids and Portals for VLAB Marlon Pierce Community Grids Lab Indiana University.
23:48:11Service Oriented Cyberinfrastructure Lab, Grid Portals Fugang Wang April 29
Through the development of advanced middleware, Grid computing has evolved to a mature technology in which scientists and researchers can leverage to gain.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
07/06/11 New Features of WS-PGRADE (and gUSE) 2010 Q Q2 Miklós Kozlovszky MTA SZTAKI LPDS.
GridFE: Web-accessible Grid System Front End Jared Yanovich, PSC Robert Budden, PSC.
National Center for Supercomputing Applications NCSA OPIE Presentation November 2000.
1 ® Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1 Building Portlets with ColdFusion Pete Freitag Foundeo, Inc.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
The PROGRESS Grid Service Provider Maciej Bogdański Portals & Portlets 2003 Edinburgh, July 14th-17th.
© 2008 Pittsburgh Supercomputing Center So you have a TeraGrid Allocation What now?
August 13, 2003Eric Hjort Getting Started with Grid Computing in STAR Eric Hjort, LBNL STAR Collaboration Meeting August 13, 2003.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
TeraGrid CTSS Plans and Status Dane Skow for Lee Liming and JP Navarro OSG Consortium Meeting 22 August, 2006.
Application Specific Module Tutorial Akos Balasko 02/07/
Wrapping Scientific Applications As Web Services Using The Opal Toolkit Wrapping Scientific Applications As Web Services Using The Opal Toolkit Sriram.
1 Grid Portal for VN-Grid Cu Nguyen Phuong Ha. 2 Outline Some words about portals in principle Overview of OGCE GridPortlets.
Institute For Digital Research and Education Implementation of the UCLA Grid Using the Globus Toolkit Grid Center’s 2005 Community Workshop University.
Holding slide prior to starting show. A Portlet Interface for Computational Electromagnetics on the Grid Maria Lin and David Walker Cardiff University.
NA-MIC National Alliance for Medical Image Computing UCSD: Engineering Core 2 Portal and Grid Infrastructure.
The MyProxy Online Credential Repository Jim Basney NCSA
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
Running Kuali: A Technical Perspective Ailish Byrne (Indiana University) Jonathan Keller (University of California, Davis)
Creating and running an application.
SAN DIEGO SUPERCOMPUTER CENTER Inca Control Infrastructure Shava Smallen Inca Workshop September 4, 2008.
1 Service Creation, Advertisement and Discovery Including caCORE SDK and ISO21090 William Stephens Operations Manager caGrid Knowledge Center February.
Some comments on Portals and Grid Computing Environments PTLIU Laboratory for Community Grids Geoffrey Fox, Marlon Pierce Computer Science, Informatics,
Building Grid Portals with OGCE: Big Red Portal and GTLAB Mehmet A. Nacar, Jong Youl Choi, Marlon Pierce, Geoffrey Fox Community Grids Lab Indiana University.
Development of e-Science Application Portal on GAP WeiLong Ueng Academia Sinica Grid Computing
VisPortal Project developer’s experience C.E.Siegerist, J. Shalf, E.W. Bethel NERSC/LBNL Visualization Group T.J. Jankun-Kelley, O. Kreylos, K.L. Ma CIPIC/UC.
Grid Interoperability Update on GridFTP tests Gregor von Laszewski
NJIT 1 Apache Tomcat (Version 6.0) THETOPPERSWAY.COM.
National Energy Research Scientific Computing Center (NERSC) Visportal : interface to grid enabled NERC resources Cristina Siegerist NERSC Center Division,
Introduction – ORM, Helloworld Application
Holding slide prior to starting show. Lessons Learned from the GECEM Portal David Walker Cardiff University
IBM Express Runtime Quick Start Workshop © 2007 IBM Corporation Deploying a Solution.
Remote Api Tutorial How to call WS-PGRADE workflows from remote clients through the http protocol?
CSF4 Meta-Scheduler Zhaohui Ding College of Computer Science & Technology Jilin University.
Java High level programming language ◦ Sun Microsystems ◦ ORACLE acquired Java Development Kit – JDK Java Runtime Environment – JRE Java Virtual Machine.
Tutorial on Science Gateways, Roma, Riccardo Rotondo Web Application Development Introduction to application servers, web applications and portlets.
Shaowen Wang 1, 2, Yan Liu 1, 2, Nancy Wilkins-Diehr 3, Stuart Martin 4,5 1. CyberInfrastructure and Geospatial Information Laboratory (CIGI) Department.
Introduction to portlet development Carla Carrubba INFN Dpt. Of Catania Giuseppina Inserra
Writing Grid Portlets.
Shaowen Wang1, 2, Yan Liu1, 2, Nancy Wilkins-Diehr3, Stuart Martin4,5
OGCE Portal Software for Big Red and the TeraGrid
Grid Computing Software Interface
Presentation transcript:

TeraGrid’07, June 4-8, 2007, Madison, WI 1 Building Blocks for a Simple TeraGrid Science Gateway Yan Liu and Shaowen Wang Grid Research & educatiOn ioWa (GROW) The University of Iowa June 4, A GISolve Approach

TeraGrid’07, June 4-8, 2007, Madison, WI 2 Contributors/Collaborators SDSC SDSC –Andrew Sanderson –Nancy Wilkins-Diehr UC/ANL UC/ANL –Stuart Martin UIowa UIowa –Eric Shook

TeraGrid’07, June 4-8, 2007, Madison, WI 3 Objectives Use TeraGrid to support domain-specific scientific computing Develop Grid-enabled applications to access TeraGrid capabilities Create a GridSphere-based portal as a TeraGrid science gateway interface Develop JSR-168 compliant portlets to build gateway components Understand a GISolve-based workflow to steer analyses on TeraGrid

TeraGrid’07, June 4-8, 2007, Madison, WI 4 Overview

5 Learning Curve Access TeraGrid resources Access TeraGrid resources –Accounts, computing and data storage Develop Java programs for TeraGrid access Develop Java programs for TeraGrid access –JGlobus Cog programming –A simple visualization module Build a simple science gateway Grid portal Build a simple science gateway Grid portal –JSR-168 PortletAPI –GridSphere-based portlet development

TeraGrid’07, June 4-8, 2007, Madison, WI 6 Development Curve Command line Command line –Running domain science application on TeraGrid Grid-enabled application development Grid-enabled application development –Java programming –Application-specific SimpleGrid API Science gateway Science gateway –SimpleGrid portal –A straightforward GIScience (Geographic Information Science) application workflow

TeraGrid’07, June 4-8, 2007, Madison, WI 7 Application Example DMS Spatial Analysis DMS Spatial Analysis –Spatial interpolation based on the Dynamically Memorized Strategy (DMS) Application package Application package –Binary executables –Sample datasets –Package directory layout Build user-friendly science gateway interfaces for scientists to perform DMS analysis transparently on TeraGrid Build user-friendly science gateway interfaces for scientists to perform DMS analysis transparently on TeraGrid

TeraGrid’07, June 4-8, 2007, Madison, WI 8 Technologies TeraGrid access TeraGrid access –Globus Toolkit (CTSS3) MyProxy, GRAM, WS-GRAM, GridFTP MyProxy, GRAM, WS-GRAM, GridFTP Programming Programming –Java Cog kit JGlbous module JGlbous module Grid portal Grid portal –GridSphere portal server –GridSphere-based portlet development framework –JSP and GridSphere Visual UI

TeraGrid’07, June 4-8, 2007, Madison, WI 9 Environments Three tutorial portal servers Three tutorial portal servers –grow-dev1.its.uiowa.edu Portal server software Portal server software –SSH client and server –Globus Toolkit client tools –Java J2SE 1.5 –Ant –Apache httpd –Tomcat –GridSphere (customized) –MySQL server TeraGrid sites TeraGrid sites –UC, NCSA, and SDSC

TeraGrid’07, June 4-8, 2007, Madison, WI 10 User Accounts TeraGrid training accounts TeraGrid training accounts –train01 – train19 –Gateway head nodes: tg-login.ncsa.teragrid.org tg-login.ncsa.teragrid.org tg-login.uc.teragrid.org (through ncsa or sdsc) tg-login.uc.teragrid.org (through ncsa or sdsc) Tg-login.sdsc.teragrid.org Tg-login.sdsc.teragrid.org Portal accounts Portal accounts –train1 – train 19 –Password is dispatched with tutorial materials –URL:

TeraGrid’07, June 4-8, 2007, Madison, WI 11 User Accounts (Cont’d) MySQL database accounts MySQL database accounts –Same user names as TeraGrid training accounts –Password same as your portal account password Tutorial server UNIX accounts Tutorial server UNIX accounts –Same user names as TeraGrid training accounts –Password dispatched with tutorial materials –BASH shell environment Tutorial package Tutorial package –In $HOME/SimpleGrid

TeraGrid’07, June 4-8, 2007, Madison, WI 12 Exercise 1: Setup Development Environment Login to one of the three tutorial servers Login to one of the three tutorial servers –SSH login: Environment setup Environment setup cd ~ # add simplegrid-env.sh in your.bashrc vi.simplegrid-env.sh

TeraGrid’07, June 4-8, 2007, Madison, WI 13 Outline Part I: Basic TeraGrid services and tools Part I: Basic TeraGrid services and tools Part II: SimpleGrid API development for Grid-enabled analysis Part II: SimpleGrid API development for Grid-enabled analysis Part III: SimpleGrid portal development Part III: SimpleGrid portal development

TeraGrid’07, June 4-8, 2007, Madison, WI 14 Part I: Basic TeraGrid Services and Tools Questions to answer Questions to answer –Where are your home directories on all 3 TeraGrid sites? – –What is your grid certificate identity? – –How do you create a grid proxy with a specified duration using MyProxy? – –Are you able to transfer a sample dataset to a specified TeraGrid site? – –How to submit a job and return immediately without waiting for its completion?

TeraGrid’07, June 4-8, 2007, Madison, WI 15 DMS Binary Package Deployment SSH login SSH login Setup your TeraGrid account environment Setup your TeraGrid account environment ## content of your.soft # TeraGrid wide Globus 4 and Grid software # Platform recommended development software Deploy DMS binary package to all three sites Deploy DMS binary package to all three sites scp SimpleGrid/applications/dms.uc.tar.gz ssh tar xvfz./dms.uc.tar.gz

TeraGrid’07, June 4-8, 2007, Madison, WI 16 Get a Grid Proxy ~]$ myproxy-logon -l gisolve -t 100 -s myproxy.teragrid.org Enter MyProxy pass phrase: A credential has been received for user gisolve in /tmp/x509up_u502. ~]$ grid-proxy-info subject : /C=US/O=National Center for Supercomputing Applications/CN=Gisolve Community User issuer : /C=US/O=National Center for Supercomputing Applications/CN=Certification Authority identity : /C=US/O=National Center for Supercomputing Applications/CN=Gisolve Community User type : end entity credential strength : 1024 bits path : /tmp/x509up_u502 timeleft : 99:59:54 (4.1 days)

TeraGrid’07, June 4-8, 2007, Madison, WI 17 Transfer a Sample Dataset test]$ globus-url-copy file:/home/tomcat/SimpleGrid/simplegrid/webapp/storage/samples/sample gsiftp://gridftp-hg.ncsa.teragrid.org:2811/~/sample1 test]$ ssh tg-login2 ac/gisolve> ls -l sample1 -rw-r--r-- 1 gisolve lpt :28 sample1

TeraGrid’07, June 4-8, 2007, Madison, WI 18 GRAM Job Submission RSL (for UC) RSL (for UC) Commands Commands &(jobType="single") (count=1) (host_count="1") (project=TG-SES070007N) (directory="/home/gisolve/gisolve/DMS/release") (executable=/home/gisolve/gisolve/DMS/release/process.pl) (arguments="500" "500" "20" "/home/gisolve/sample1" "/home/gisolve/result1") (stdout="stdout.gisolve.test") (stderr="stderr.gisolve.test") $ globusrun -b -f./gt2.rsl -r tg-grid.uc.teragrid.org:2120/jobmanager-pbs globus_gram_client_callback_allow successful GRAM Job submission successful $ globus-job-status DONE

TeraGrid’07, June 4-8, 2007, Madison, WI 19 WS-GRAM Job Submission RSL (XML) RSL (XML) <factoryEndpoint xmlns:gram=" xmlns:wsa=" PBS /home/gisolve/gisolve/DMS/release/process.pl /home/gisolve/gisolve/DMS/release /home/gisolve/sample1 /home/gisolve/result1 /users/gisolve/gisolve/DMS/results/stdout.sample1 /users/gisolve/gisolve/DMS/results/stderr.sample1

TeraGrid’07, June 4-8, 2007, Madison, WI 20 Command: globusrun-ws -submit -f rsl_xml_file Command: globusrun-ws -submit -f rsl_xml_file WS-GRAM Job Submission

TeraGrid’07, June 4-8, 2007, Madison, WI 21 Analysis Process Get a grid proxy Get a grid proxy Transfer a dataset to specified TeraGrid sites Transfer a dataset to specified TeraGrid sites Submit Grid jobs to run DMS binary executables against the transferred dataset Submit Grid jobs to run DMS binary executables against the transferred dataset Collect results back Collect results back Visualize results Visualize results –Will be shown later

TeraGrid’07, June 4-8, 2007, Madison, WI 22 Part II: SimpleGrid API Development for Grid-enabled Analysis How to do Part I in a programming way? How to do Part I in a programming way? Purpose Purpose –Automate the access to TeraGrid resources as a Grid-enabled application Package Package –Location: SimpleGrid/simplegrid/src/ –SimpleGrid API for DMS analysis org.gisolve.demo.app.* org.gisolve.demo.app.* org.gisolve.demo.grid.* org.gisolve.demo.grid.* org.gisolve.demo.util.* org.gisolve.demo.util.* –Libraries All jars from ${GLOBUS_LOCATION}/lib All jars from ${GLOBUS_LOCATION}/lib –Particularly cog-jglobus.jar JFreeChart libraries for visualization JFreeChart libraries for visualization

TeraGrid’07, June 4-8, 2007, Madison, WI 23 Get a Grid Proxy Class Class –org.gisolve.demo.grid.security.SimpleCred Two methods to get a proxy Two methods to get a proxy –Load an existing valid proxy file SimpleCred::load() SimpleCred::load() –Create a proxy by contacting with a MyProxy server SimpleCred::logon() SimpleCred::logon() Export proxy to a file Export proxy to a file –SimpleCred::export()

TeraGrid’07, June 4-8, 2007, Madison, WI 24 Transfer a Sample Dataset Class Class –org.gisolve.demo.grid.data.SimpleTransfer Local remote transfer Local remote transfer –SimpleTransfer::remote2local() –SimpleTransfer::local2remote() Third-party transfer Third-party transfer –Refer to Cog manual (version 1.1)

TeraGrid’07, June 4-8, 2007, Madison, WI 25 GRAM Job Submission Class Class –org.gisolve.demo.grid.job.SimpleRunGT2 –org.gisolve.demo.grid.job.SimpleRSL RSL generation RSL generation –Application specific GT2 job submission GT2 job submission –Use batch mode in which a call returns immediately with a job handle

TeraGrid’07, June 4-8, 2007, Madison, WI 26 GRAM Job Submission: MPI MPI on TeraGrid MPI on TeraGrid –User “softenv | grep mpi” to see different MPI settings MPI job submission through Globus MPI job submission through Globus –Specify “count” element in RSL “count” is the number of processes to spawn “count” is the number of processes to spawn –Specify “host_count” element in RSL “host_count” is the number of CPUs for MPI execution “host_count” is the number of CPUs for MPI execution –“count = host_count” means each CPU runs one MPI process –Specify “jobType=mpi” in RSL

TeraGrid’07, June 4-8, 2007, Madison, WI 27 WS-GRAM Job Submission Class Class –org.gisolve.demo.grid.job.SimpleRunGT4 –org.gisolve.demo.grid.job.SimpleRSL RSL generation RSL generation –Application specific GT4 job submission GT4 job submission –Use batch mode in which a call returns immediately with a job handle –Note that it uses a different globus package org.globus.exec.*

TeraGrid’07, June 4-8, 2007, Madison, WI 28 How to Write RSL? RSL schema RSL schema – n/wsgram/schemas/gram_job_description. html GT2 and GT4 schema comparison GT2 and GT4 schema comparison – ecution/wsgram/WS_GRAM_Migrating_Gui de.html

TeraGrid’07, June 4-8, 2007, Madison, WI 29 Exercise 2 Test SimpleGrid API Test SimpleGrid API –Source simplegrid-env.sh –SimpleGrid/bin/runTest2.sh

TeraGrid’07, June 4-8, 2007, Madison, WI 30 Part III: SimpleGrid Portal Development Science gateways to TeraGrid Science gateways to TeraGrid –Provide an online access points to TeraGrid –Aggregate domain science application-level capabilities –Hide the complexity of using TeraGrid –Portal is commonly used to meet such needs Focus Focus –Provide transparent access to TeraGrid for domain scientists –Build application-oriented workflow inside portal for easy access by users –Technical details for portlet development GridSphere GridSphere PortletAPI PortletAPI GridSphere-based portlet development GridSphere-based portlet development

TeraGrid’07, June 4-8, 2007, Madison, WI 31 GridSphere Features Features – –Open source –PortletAPI (JSR-168) compliant –Object persistence support through Hibernate GridSphere GridSphere –Download: –Requirements: java, ant, tomcat, mysql –Build: ant install Be sure to change hibernate.properties, build.properties Be sure to change hibernate.properties, build.properties Copy mysql jdbc driver to ${CATALINE_HOME}/common/lib/ Copy mysql jdbc driver to ${CATALINE_HOME}/common/lib/ –Development using Eclipse Instructions will be added in our online documentation Instructions will be added in our online documentation

TeraGrid’07, June 4-8, 2007, Madison, WI 32 Exercise 3 Demo Demo –GridSphere interface –New portlet project creation

TeraGrid’07, June 4-8, 2007, Madison, WI 33 SimpleGrid Portlets Location: SimpleGrid/simplegrid Location: SimpleGrid/simplegrid Two portlets Two portlets –UserPortlet Display user information Display user information Initialize or renew grid proxy Initialize or renew grid proxy –Automatic renewal after initialization –DMSPortlet DMS workflow control DMS workflow control Build user interfaces for DMS analysis Build user interfaces for DMS analysis Each tutorial user will build and deploy their version of SimpleGrid portlets (project name is simplegrid_${USER}) Each tutorial user will build and deploy their version of SimpleGrid portlets (project name is simplegrid_${USER})

TeraGrid’07, June 4-8, 2007, Madison, WI 34 Introduction to SimpleGrid Development

TeraGrid’07, June 4-8, 2007, Madison, WI 35 SimpleGrid Project Layout src/org.gisolve.demo.portlets src/org.gisolve.demo.portlets –Portlet action classes lib/ lib/ –Libraries for Globus and JFreeChart webapp/jsp/ webapp/jsp/ –JSP pages for user interface rendering webapp/WEB-INF/persistence/hibernate.properties webapp/WEB-INF/persistence/hibernate.properties –Configuration for backend database access webapp/WEB-INF/portlet.xml webapp/WEB-INF/portlet.xml –Portlet definition Defines unique portlet id, the portlet class, etc. Defines unique portlet id, the portlet class, etc. webapp/simplegrid.properties webapp/simplegrid.properties –SimpleGrid specific configuration about Grid resources –Loaded at the first time the UserPortlet is visited build.xml build.xml –Ant build file to compile, deploy, and install SimpleGrid portlets to GridSphere –Need to change if you have your own libraries or packages developed build.properties build.properties –Define project name and location of GridSphere where SimpleGrid finds dependent GridSphere java classes and PortletAPI (javax.portlet.*) definitions

TeraGrid’07, June 4-8, 2007, Madison, WI 36 Runtime Configurations simplegrid.properties simplegrid.properties

TeraGrid’07, June 4-8, 2007, Madison, WI 37 Portlet Container PortletAPI (JSR-168 specification) PortletAPI (JSR-168 specification) –Portlet specification –What are not defined? Object persistence: store portlet status in permanent storage Object persistence: store portlet status in permanent storage Portlet rendering method Portlet rendering method –JSP, Velocity, GridSphere Visual UI (JSP taglib), Java Server Face GridSphere: JSR-168 compliant portlet container GridSphere: JSR-168 compliant portlet container –Implemented javax.portlet.* –Hibernate as object persistence technologies –JPS-based Visual UI rendering –What are not standardized? ActionPortlet based on Visual UI ActionPortlet based on Visual UI Portlet service framework (from WebSphere) Portlet service framework (from WebSphere) –Other open source portlet containers Apache Jetspeed/Pluto, Sakai Apache Jetspeed/Pluto, Sakai

TeraGrid’07, June 4-8, 2007, Madison, WI 38 PortletAPI (JSR-168 Specification) Sample portlet Sample portlet –GridSphere jsrtutorial: ActionHelloworld Portlet modes Portlet modes –VIEW (doView()): the default display mode –EDIT (doEdit()): preference/configuration editing –HELP (doHelp()): help information Base portlet: GenericPortlet Base portlet: GenericPortlet PorletURL PorletURL –Generate actionURL and renderURL in response page

TeraGrid’07, June 4-8, 2007, Madison, WI 39 PortletAPI (JSR-168 Specification) PortletRequest PortletRequest –Get parameters from portlet container ActionRequest ActionRequest –Used in action processing RenderRequest RenderRequest –Used in rendering PortletResponse PortletResponse –Pass parameters to portlet container ActionResponse ActionResponse –Parameters set in ActionResponse will be passed to RenderRequest RenderResponse RenderResponse –Used in rendering response page Action processing Action processing –processAction(ActionRequest, ActionResponse) Default rendering Default rendering –doView(RenderRequest, RenderResponse)

TeraGrid’07, June 4-8, 2007, Madison, WI 40 PortletAPI (JSR-168 Specification) Portlet definition (portlet.xml) Portlet definition (portlet.xml) SimpleGrid user portlet SimpleGridUserGisolve SimpleGrid user gisolve org.gisolve.demo.portlets.UserPortlet 0 aname avalue text/html view edit help en SimpleGrid User home for gisolve simplegrid-gisolve simplegrid, gisolve, user ……

TeraGrid’07, June 4-8, 2007, Madison, WI 41 Questions Questions –How to direct actions to corresponding action methods? Avoid a big processAction() Avoid a big processAction() –How to get parameters from PortletRequest? –How to render response pages? –How to communicate between portlets? Portlet Development

TeraGrid’07, June 4-8, 2007, Madison, WI 42 Portlet Development GridSphere Visual UI GridSphere Visual UI –Rendering: JSP tag-lib –Action: ActionPortlet Velocity Velocity –Rendering: Velocity templates –Action: VelocityPortlet

TeraGrid’07, June 4-8, 2007, Madison, WI 43 Exercise 4 Deploy your SimpleGrid project (simplegrid_${USER}) to gridsphere container Deploy your SimpleGrid project (simplegrid_${USER}) to gridsphere container –Use “ant install” for a fresh install –Use “ant deploy” for update (it does not clear database content) –Look at $CATALINA_HOME/webapps/simplegrid_${USER}/ WEB-INF/lib to see project jars generated by deployment How does Gridsphere know your project? How does Gridsphere know your project?

TeraGrid’07, June 4-8, 2007, Madison, WI 44 GridSphere-based Portlet Development Visual UI taglib for rendering Visual UI taglib for rendering Portlet class Portlet class –Extend ActionPortlet –All beans are constructed from ActionFormEvent or RenderFromEvent –Get PortletRequest and PortletResponse from FormEvent –Use setNextState() to point to JSP page in rendering methods –Use setNextState() to point to rendering method in action methods

TeraGrid’07, June 4-8, 2007, Madison, WI 45 Example: UserPortlet UserPortlet::show() UserPortlet::show() –Default rendering method which displays user information and grid proxy configuration in JSP –In JSP, Bean is used to render the values of user forms Java code is embedded to directly access RenderRequest for grid proxy information Java code is embedded to directly access RenderRequest for grid proxy information UserPortlet::configSimpleCred() UserPortlet::configSimpleCred() –Action method to retrieve grid proxy either from MyProxy server or locally from a valid proxy file

TeraGrid’07, June 4-8, 2007, Madison, WI 46 UserPortlet Interface

TeraGrid’07, June 4-8, 2007, Madison, WI 47 Velocity-based Portlet Development Portlet definition Portlet definition –Initial template name –velocity.properties Action class Action class –Get parameters: ActionRequest.getParameter() –Rendering: VelocityContext.put(name, object) –Action methods: called based on their names through Java Reflection Velocity template Velocity template #if( !$gisolve_portal_error_info.equals("") ) $gisolve_portal_error_info #end

TeraGrid’07, June 4-8, 2007, Madison, WI 48 DMS Analysis Workflow in Portal Workflow control is done by keeping state information in PortletSession as attributes Workflow control is done by keeping state information in PortletSession as attributes Portlet communication Portlet communication –Need to coordinate two portlets PortletSession.getAttribute(name, PortletSession.APPLICATION_SCOPE) PortletSession.getAttribute(name, PortletSession.APPLICATION_SCOPE) PortletSession.setAttribute(name, value, PortletSession.APPLICATION_SCOPE) PortletSession.setAttribute(name, value, PortletSession.APPLICATION_SCOPE) Learn how SimpleGrid remembers current status of each job Learn how SimpleGrid remembers current status of each job

TeraGrid’07, June 4-8, 2007, Madison, WI 49 DMSPortlet Interface

TeraGrid’07, June 4-8, 2007, Madison, WI 50 Exercise 5 Run DMS portlet and get visualization results Run DMS portlet and get visualization results –Result page plots results after the analysis –Do you see your job is running on TeraGrid? Refresh job status Refresh job status Verify it by using “qstat | grep gisolve” to see the status of your job Verify it by using “qstat | grep gisolve” to see the status of your job –Thread in SimpleGrid portlets File transfer and result visualization access the same portal server and are time-consuming File transfer and result visualization access the same portal server and are time-consuming Threads are used to respond to user requests quickly Threads are used to respond to user requests quickly

TeraGrid’07, June 4-8, 2007, Madison, WI 51 Visualization on TeraGrid SimpleGrid uses JFreeChart for simple local visualization SimpleGrid uses JFreeChart for simple local visualization We are evaluating the integration between GISolve and ParaView on TeraGrid to support advanced visualization We are evaluating the integration between GISolve and ParaView on TeraGrid to support advanced visualization

TeraGrid’07, June 4-8, 2007, Madison, WI 52 Summary SimpleGrid provides basic components to develop science and engineering gateways SimpleGrid provides basic components to develop science and engineering gateways –This tutorial includes code, links, and examples –Based on a real-world GIS application SimpleGrid is also used in GISolve, TeraGrid GIScience gateway SimpleGrid is also used in GISolve, TeraGrid GIScience gateway Gateway server setup instructions and additional materials will be provided in GISolve/TeraGrid online documentation Gateway server setup instructions and additional materials will be provided in GISolve/TeraGrid online documentation

TeraGrid’07, June 4-8, 2007, Madison, WI 53 Q & A Questions and comments? Questions and comments? Thanks! Thanks!