25
Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Embed Size (px)

Citation preview

Page 1: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Designing Grid Tag Libraries and Grid Beans

Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey FoxGCE 2006Tampa, FL

Page 2: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Introduction Science portals and gateways gain importance by

providing portable and useful tools for community. TeraGrid User portal and Science Gateways

There are efforts to provide reusable Grid portlets and portal containers for Grid community JSR-168 compatible portlets

uPortal, GridSphere, Jetspeed2

Grid portlets from OGCE, GridSphere, and others Portlets can be shared between members of the Grid

community Work across JSR 168 compliant containers

Page 3: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Problems with portlet development Grid portlets typically wrap each single Grid capability in a

separate portlet Credential generation and management Job Submission File transfer and operations Workflow management

Problem is that Grid portlets need to combine these operations Portlets are entire web applications We need a way of making it easier to build Grid portlets out of reusable parts We need a component model for portlets

Why is JSFsuitable for Grid Portals? OGCE community used templates to develop portlets

Velocity and JSP (web development templates) JSF uses Inversion of Control pattern to implement its Model-View-

Controller architecture Remove dependencies on the Servlet API. Backing beans are just beans, so can be reused more easily outside of web

and portlet applications. JSF also provides an extensible framework (tag libraries)

Page 4: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Related Work Grid Portlets 1.3 of GridSphere

Now they are trying to decouple with GridSphere. It’s called Vine (Portlet Vine) as separate project

Grid Portlets 1.3 provide API and UI tags to build Grid portlets RSF (Reasonable Server Faces)

Derived from JSF, but it separates HTML pages and backing beans RSF provides non-visual components unlike JSF Beans can be contained by Spring like containers.

Lifecycles of beans managed by Spring OGCE portlets

Packages Velocity, JSP and JSF portlets Provides portlet package for several Grid applications such as Globus,

Condor, SRB and GPIR

Page 5: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

GTLAB: Grid Tag Libraries and Beans Grid tag libraries are built using JSF custom component

development techniques Grid tags are associated with Grid services via Grid beans.

Grid Beans wrap the Java COG Kit (version 4) We show an example JSF page section below.

This allows you to develop new Grid portlets with no additional Java code.

<html> <body> <f:form> <o:submit id=”test” action=”next_page” />

<o:myproxy id=”pr” hostname=”gf1.ucs.indiana.edu” port=”7512” lifetime=”2” username=“mnacar” password=”***” /><o:jobsubmit id=”task” hostname=”cobalt.ncsa.teragrid.org”

provider=”GT4” executable=”/bin/ls” stdout=”tmp/result stderr=”tmp/error” /> </o:submit> </f:form> </body></html>

Page 6: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Grid Tags Associated Grid Beans Features

<submit/> ComponentBuilderBean Creating components, job handlers, submitting jobs

<handler/> MonitorBean Handling monitoring page actions

<multitask/> MultitaskBean Constructing simple workflow

<dependency/> MultitaskBean Defining dependencies among sub jobs

<myproxy/> MyproxyBean Retrieving myproxy credential

<fileoperation/> FileOprationBean Providing Gridftp operations

<jobsubmission/> JobSubmitBean Providing GRAM job submissions

<filetransfer/> FileTransferBean Providing Gridftp file transfer

ResourceBean Describes common properties among all tags and beans. Passing values given by standard visual JSF components.

Page 7: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Advanced Operations GTLAB can be used to associate multiple Grid tasks

with a single <form> action click. We call this a “multitask”

This is a form of workflow (DAG) We build on top of CoG workflow capabilities. We are investigating how to abstract this to use other

workflow engines. Each multitask should be associated with a submit

button. This allows many multitasks in a JSF form. It’s useful in some cases to bind relatively different

multitask with the same user input parameters.

Page 8: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Multitask Multitask

provides a simple workflow

Directed Acyclic Graph (DAG)

This example demonstrates a composite Grid job using Grid tags

depends

depends

Input

Multi-staged task

Task DFile Transfer

Task AFile Operation

(mkdir)

Task BFile Transfer

Task CJob Submission

Output

depends

Page 9: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

<o:submit id=”test” action=”next_page” /> <o:multitask id=”mytask” taskname=”test” persistent=”true” > <o:myproxy id=”pr” hostname=”gf1.ucs.indiana.edu” port=”7512” lifetime=”2” username=“nacar” password=”***” /> <o:fileoperation id=”taskA” command=”mkdir” hostname=”cobalt.ncsa.teragrid.org” path=”/home/manacar/tmp/” /> <o:filetransfer id=”taskB” from=”gridftp://gf1.ucs.indiana.edu:2811/home/manacar/input_file” to=”gridftp://cobalt.ncsa.teragrid.org:2811/home/manacar/tmp/input_file” /> <o:jobsubmit id=”taskC” hostname=”cobalt.ncsa.teragrid.org” provider=”GT4” executable=”/bin/execute” stdin=”tmp/input_file” stdout=”tmp/result” stderr=”tmp/error” /> <o:filetransfer id=”taskD” from=”gridftp://cobalt.ncsa.teragrid.org:2811/home/manacar/tmp/result” to=” gridftp://gf1.ucs.indiana.edu:2811/home/manacar/result” /> <o:dependency id=”dep1” task=”taskB” dependsOn=”taskA” /> <o:dependency id=”dep2” task=”taskC” dependsOn=”taskB” /> <o:dependency id=”dep3” task=”taskD” dependsOn=”taskC” /> </o:multitask></o:submit>

GTLAB: Multitask Example JSF Page

Page 10: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Going Beyond JSF Tag Libraries JSF Tag Libraries framework is a starting point,

but we had to extend it in several ways to support GTLAB requirements.Parsing XML tag library description and

constructing the workflow Maintaining jobs within a session

Bean and listener tables keep handler informationSharing job handlers between multiple tags in

different pages. Job submission forms create job handlers Monitoring pages retrieve handlers from tables and list

the status information

Page 11: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Component and session management We need to handle JSF component model to import Grid tags

that embedded into JSF page ComponentBuilderBean (CBB) parses JSF page and extracts Grid tags

Standard JSF session can also manage only one job submission at a time

But GTLAB framework provide session management to handle multiple jobs in a session

Most of the Grid jobs are either batch or takes long time to finish.

Obviously portlet pages should not block while the job runs Need to manage job sessions

GTLAB allows users proceeding to next pages Depending on the navigation rules, users can move on to monitoring

pages

Page 12: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Architecture CBB handles user

requests using JSF form pages

CBB parses custom components embedded into JSF view page.

Creates corresponding Grid task using Factory bean

· Parse Grid tags· Create Grid beans· Create multitask· Register bean table· Register listener table· Submit multitask

Component Builder BeanUser form page

Submit

n times

CoG layer

Myproxy GRAM GridFTP

Register

t1

t2

tn

h1

h2

hn

Bean Table Listener Table

Stored in session memory

Constructs the workflow by using Multitask bean with dependencies Maintains task handlers and task objects in the session Submit multitasks to Grid services

Page 13: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

GTLAB Portal Applications Virtual Laboratory for Earth and Planetary Materials

(VLAB) Focuses on computational material science Scientists launch PWSCF simulations and get visual

results. Composite tasks are orchestrated within a workflow

Preparing entry parameters, simulation submissions, transferring results, starting visualization applications

Common Instrument Middleware Architecture (CIMA) Focuses on X-Ray crystallography, instruments and sensor

data. Scientists launch SAINT application

Integrates CCD image frames Example of simple workflow through portlets.

Page 14: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Advantages of GTLAB Grid tags provide rich selection of attributes to

initialize Grid beans. Composite tasks can contain an unlimited

number of subtasks GTLAB gives flexibility to developers to use

their own Grid beans library or add more Grid beans to the existing ones.Following the method name convention of GTLAB

Grid bean methods are bound to tags with attributes to simplify the building of new Grid portlets

Page 15: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Conclusion and Future Work We have developed GTLAB Tag Libraries and Java

Beans for Java Server Faces. Encapsulate common Grid tasks Build Grid portlets out of reusable components Support multiple Grid tasks in a single user action. Adapt JSF to consume tag workflow expressions and

manage multiple Grid jobs. We will investigate use of sub-graphs within

<multitask> We are investigating abstracting our approach to

support different workflow engines. Investigate integrating AJAX with our session

management and monitoring.

Page 16: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Acknowledgments

OGCE http://www.collab-ogce.org/ogce2/ This work is supported by the National

Science Foundation’s Information Technology Research (NSF grant ITR-0428774, 0427264, 0426867 VLab) and Middleware Initiative (NSF Grant SCI 0330613) programs.

Page 17: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Additional Slides

Page 18: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Overview of JSF Tag Development

Basically JSF uses JSP Standard Tag Library (JSTL) and Expression Language (EL) for tag development.

There are two types of JSF standard components Visual: CommandButton, InputText etc. Non-visual: form, param etc.

Two classes required for development of the tags: UIComponent: Describes encoding/decoding HTML. ComponentTag: Describes attributes

Tag classes should describe attribute bindings. Value binding -> #{bean.property} Method binding -> #{bean.method}

Grid tags are embedded into JSF view pages and decorated with standard JSF form, input, output and button components

Page 19: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Grid tags and attributes<?xml version="1.0" encoding="UTF-8"?><o:root xmlns:o="http://www.ogce.org/gsf/task"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ogce.org/gsf/task GridTagsXMLSchema.xsd ">

<o:submit action="" id=""> <o:multitask handler="" id="" persistent="true" taskname=""> <o:myproxy handler="" hostname="" id="" lifetime="" password="" port=""

username=""/> <o:fileoperation command="" handler="" hostname="" id="" path="" port=""

provider=""/> <o:jobsubmit arguments="" executable="" handler="" hostname="" id=""

provider="" stderr="" stdin="" stdout=""/> <o:filetransfer from="" handler="" id="" to=""/> <o:dependency dependsOn="" id="" task=""/> </o:multitask> </o:submit></o:root>

Page 20: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

<?xml version="1.0" encoding="UTF-8"?><xsd:schema targetNamespace="http://www.ogce.org/gsf/task"

xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:o="http://www.ogce.org/gsf/task"><xsd:element name="dependency"><xsd:complexType><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="task" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="dependsOn" type="xsd:string" use="required"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="myproxy"><xsd:complexType><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="hostname" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="port" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="lifetime" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="username" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="password" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="handler" type="xsd:string" use="required"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="multitask"><xsd:complexType><xsd:sequence minOccurs="1" maxOccurs="1"><xsd:element ref="o:myproxy" minOccurs="0" maxOccurs="1"></xsd:element><xsd:element ref="o:fileoperation" minOccurs="0" maxOccurs="unbounded"></xsd:element><xsd:element ref="o:jobsubmit" minOccurs="0" maxOccurs="unbounded"></xsd:element><xsd:element ref="o:filetransfer" minOccurs="0" maxOccurs="unbounded"></xsd:element><xsd:element ref="o:dependency" minOccurs="0" maxOccurs="unbounded"></xsd:element></xsd:sequence><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="taskname" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="handler" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="persistent" type="xsd:boolean" use="required"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="fileoperation"><xsd:complexType><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="command" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="hostname" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="provider" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="port" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="path" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="handler" type="xsd:string" use="required"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="jobsubmit"><xsd:complexType><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="hostname" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="provider" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="executable" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="arguments" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="stdin" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="stdout" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="stderr" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="handler" type="xsd:string" use="required"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="filetransfer"><xsd:complexType><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="from" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="to" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="handler" type="xsd:string" use="required"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="root"><xsd:complexType><xsd:sequence minOccurs="1" maxOccurs="1"><xsd:element ref="o:submit"></xsd:element></xsd:sequence></xsd:complexType></xsd:element>

<xsd:element name="submit"><xsd:complexType><xsd:sequence minOccurs="1" maxOccurs="1"><xsd:element ref="o:multitask"></xsd:element></xsd:sequence><xsd:attribute name="action" type="xsd:string" use="required"></xsd:attribute><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute></xsd:complexType></xsd:element>

<xsd:element name="handler"><xsd:complexType><xsd:attribute name="id" type="xsd:string" use="optional"></xsd:attribute><xsd:attribute name="action" type="xsd:string"></xsd:attribute><xsd:attribute name="actionListener" type="xsd:string"></xsd:attribute></xsd:complexType></xsd:element>

</xsd:schema>

Page 21: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Sequence diagram

FactoryBean

submit()

ResourceBean

getParams()

params

MonitorBean

beans : Vector

listeners : Vector

TaskListener

Hit monitor

getStatus()

status

User

User

GenericGridBean

create()

createDAG()

ComponentBuilderBean

HttpSession

MultitaskBean

addTask()

addDependency()

submitDAG()

createTask()

get()

instantiate

beans

get()

handlers

storeBean

storeListener

JobSubmitBean

UISubmit

Hit Submit

Page 22: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Monitoring and management MonitorBean keeps track of status information

Updates archival storage Retrieves information about jobs

Status, input parameters, results and time MonitorBean caches the monitoring info within the session.

Monitoring pages list jobs within HTML Data Table Refreshing the page updates the job list with current

information MonitorBean allows users to manage job archive:

Delete tasks, rename for resubmission Download output files or transfer to the storages

Action methods of MonitorBean are fired off by handler tag

Page 23: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Input values and navigation handling Grid tags are primarily non-visual tags

They need to bind to JSF form, input and output tags A mediator (ResourceBean) collects user-provided Resource bean describes common property values

Values are hostname, provider, taskname, username etc. Values are bound to tags using expression language semantic.

Grid tags decouples submit pages and monitoring pages Users need not wait on the submit page until it is completed.

Directed to the next page immediately. JSF page navigation is done by configuration file called faces-

config.xml which describes navigation rules.

Page 24: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

Background Grid tags have advantages:

Provides more attributes specific to Grid tags that are self-contained and can be customized easily

Composite tasks can contain an unlimited number of subtasks

It gives flexibility to developers to use their own Grid beans library or add more Grid beans to the existing ones.

Grid bean methods are bound to tags with attributes to simplify the building of new Grid portlets

JSF eliminates intervention by proposing JSF tags that separate backing bean and server pages.

Mediates between visual tags and non-visual tags using standard JSF components.

Page 25: Designing Grid Tag Libraries and Grid Beans Mehmet Nacar, Marlon Pierce, Gordon Erlebacher, Geoffrey Fox GCE 2006 Tampa, FL

JSF Grid Beans Using the factory bean for constructing GenericGridBean

beans. We create and manage multiple beans for each task.

That is, I submit the job four times in one session. Beans have listeners and maintain state called TaskListener

Unsubmitted, submitted, active, suspended, resumed are “live”

Failed, canceled, completed, unknown are “dead” Stored in archive (WS-Context or other)

Core beans are: ResourceBean - No action methods defined MonitorBean, ComponentBuilderBean (CBB) - Action

methods