12.07.2015 Views

Integration of Applications in UNICORE 6

Integration of Applications in UNICORE 6

Integration of Applications in UNICORE 6

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Applications</strong>◮ <strong>Applications</strong> are def<strong>in</strong>ed on server side◮ Bash◮ Python◮ . . .◮ User only needs to know name <strong>of</strong> application (and maybeversion)◮ Adm<strong>in</strong> configures applications on server side:◮ Path to executable◮ Parameters passed to applicationMigration Workshop , 29th Oct 2008 3


The Incarnation Database◮ <strong>Applications</strong> are def<strong>in</strong>ed <strong>in</strong> the IDB (Incarnation Database) <strong>of</strong>the XNJS◮ XNJS translates abstract job descriptions <strong>in</strong>to executablescripts with the help <strong>of</strong> the IDB< idb:IDB xmlns:idb =" http: // www .fz - juelich .de/ unicore / xnjs / id< idb:IDBApplication >...< idb:TargetSystemProperties >< jsdl:Resources xmlns:jsdl =" http: // schemas . ggf . org / jsdl /...Migration Workshop , 29th Oct 2008 4


<strong>Applications</strong> With ParametersUse question mark ? to denote conditional parameters:< idb:IDBApplication >< idb:ApplicationName >Bash shell < idb:ApplicationVersion >3.1.16 < jsdl:POSIXApplication xmlns:jsdl =" http: // schemas . ggf . org /< jsdl:Executable >/ b<strong>in</strong> / bash < jsdl:Argument >-v$ VERBOSE ?< jsdl:Argument >$ ARGUMENTS ?< jsdl:Argument >$ SOURCE ?Conditional arguments are only <strong>in</strong>cluded if the accord<strong>in</strong>genvironment variables are set.Migration Workshop , 29th Oct 2008 7


Us<strong>in</strong>g <strong>Applications</strong> With The UCCApplication is specified <strong>in</strong> the job file:{}ApplicationName : Date ,Version : 1.0 # OptionalWith environment variables:{}ApplicationName : Bash shell ,Environment : [" SOURCE = <strong>in</strong>put .sh"],Imports : [ { File : "/ home / rbreu / myscript .sh",To: " <strong>in</strong>put .sh"} ],Migration Workshop , 29th Oct 2008 9


Us<strong>in</strong>g <strong>Applications</strong> With The Graphical ClientsGridBeans:◮ Pluggable GUIs for job creation◮ Equivalent to Plug<strong>in</strong>s <strong>in</strong> <strong>UNICORE</strong> 5, but . . .◮ support new Grid standards (JSDL, . . . )◮ <strong>in</strong>dependent from <strong>UNICORE</strong> clients◮ easily distributed via GridBean Download Service◮ Based on high level Grid API◮ GridBeans specialis<strong>in</strong>g on one application allow for specialisedGUI components for:◮ <strong>in</strong>put parameters and <strong>in</strong>put files◮ visualis<strong>in</strong>g the outputMigration Workshop , 29th Oct 2008 10


PovRay GridBeanPovRay GridBean for use with povray applicationMigration Workshop , 29th Oct 2008 11


PovRay GridBeanMigration Workshop , 29th Oct 2008 12


Generic GridBeanGeneric GridBean for use with arbitrary applicationsMigration Workshop , 29th Oct 2008 13


Generic GridBeanMigration Workshop , 29th Oct 2008 14


Generic GridBeanMigration Workshop , 29th Oct 2008 15


Grid Programm<strong>in</strong>g EnvironmentGrid Programm<strong>in</strong>g Environment (GPE) developed by Intel◮ Graphical user <strong>in</strong>terfaces and <strong>in</strong>teroperable GridBeans forapplication development◮ High-level API for programm<strong>in</strong>g Grid clients◮ Language <strong>in</strong>dependent def<strong>in</strong>ition◮ Java reference implementation◮ Supports <strong>UNICORE</strong>-based and Globus Toolkit <strong>in</strong>frastructuresMigration Workshop , 29th Oct 2008 16


ArchitectureMigration Workshop , 29th Oct 2008 17


StructureNice separation <strong>of</strong> the data model and its graphical views◮ Job creation module (GridBean Model)◮◮Def<strong>in</strong>es <strong>in</strong>ternal data representationTranslated to actual job specification (JSDL)◮ One or more plug<strong>in</strong> modules◮ GUIs for gett<strong>in</strong>g user <strong>in</strong>put and present<strong>in</strong>g job output◮ Differ depend<strong>in</strong>g on environment (e.g. application/portalclients)Migration Workshop , 29th Oct 2008 18


GridBean Model:GridBean Model, GPE Job◮ Ma<strong>in</strong>ta<strong>in</strong>s the actual state <strong>of</strong> job sett<strong>in</strong>gs◮ Stores <strong>in</strong>ternal data <strong>in</strong> pairs: key + value◮ Model must implement IGridBeanModel <strong>in</strong>terface◮ Superclass AbstractGridBean implements IGridBeanModelmethods for stor<strong>in</strong>g named GridBean parameters:get(QName key), set(QName key, Object Value)GridBean Model creates GPE Job which specifies:◮ Resource requirements◮ Files to stage-<strong>in</strong>/out◮ Application name and version◮ Named application parameters (fields/options/variations)◮ Application work<strong>in</strong>g directoryMigration Workshop , 29th Oct 2008 19


IGridBean InterfaceModel must implement IGridBean <strong>in</strong>terface methods:◮ setupJobDef<strong>in</strong>ition(Job job) generates JSDL document fromthe data <strong>in</strong> the model◮ parseJobDef<strong>in</strong>ition(Job job) transfers values from the JSDLback <strong>in</strong>to the model◮ getInput/OutputParameters() used for generat<strong>in</strong>g jobimports/exportsMigration Workshop , 29th Oct 2008 20


Plug<strong>in</strong> Interfaces/Superclasses◮ Sw<strong>in</strong>g GridBean plug<strong>in</strong>s implement IGridBeanPlug<strong>in</strong> <strong>in</strong>terfaceor use the superclass GridBeanPlug<strong>in</strong>◮ Portlet plug<strong>in</strong>s are subclasses <strong>of</strong> PortletPlug<strong>in</strong>◮ plug<strong>in</strong>s provide◮ One or more <strong>in</strong>put panel(s)◮ One or more output panel(s)Migration Workshop , 29th Oct 2008 21


Sw<strong>in</strong>g Plug<strong>in</strong> Panel◮ Input panels: preparation and validation <strong>of</strong> user <strong>in</strong>put◮ Output panels: show<strong>in</strong>g output files (e.g. images)◮ Input and output panels must implement IGridBeanPanel<strong>in</strong>terface◮ Superclass GridBeanPanel implements IGridBeanPanelmethods:◮◮◮Component getComponent()Str<strong>in</strong>g getName()void validate(ErrorSet errors)Migration Workshop , 29th Oct 2008 22


Sw<strong>in</strong>g Plug<strong>in</strong> Panel◮ Each graphical component (e.g. JTextField) is bound to adata model element (key + value)◮ Validators check <strong>in</strong>put before writ<strong>in</strong>g to the model◮ Translators may change data formatMigration Workshop , 29th Oct 2008 23


Input and Output Parameters◮ Input parameters declare <strong>in</strong>put files, obta<strong>in</strong>ed from a filestorage or other jobs◮ Output parameters declare output files to be transferred to afile storage or other jobs◮ Four different types <strong>of</strong> <strong>in</strong>put and output parameters:◮◮◮◮GPE File (file at a local or remote location)File Set (a set <strong>of</strong> files, wildcards allowed)Environment variablesResource ParametersMigration Workshop , 29th Oct 2008 24


Input and Output ParametersMigration Workshop , 29th Oct 2008 25


PovRay GridBeanPovRay GridBean for use with povray applicationMigration Workshop , 29th Oct 2008 26


Further Information◮ GridBean Developer Guide on GPE4GTK Project web page,example GridBeans and their source code:http://gpe4gtk.sourceforge.net◮ gpe4unicore and GridBeans sourceshttp://sourceforge.net/projects/unicoreMigration Workshop , 29th Oct 2008 27


Example 1Example 1: DateGridBean with no <strong>in</strong>put parameters:◮ gridbean.xml◮ DateGridBean.java◮ DatePlug<strong>in</strong>.java◮ DateInputPanel.javaMigration Workshop , 29th Oct 2008 28


gridbean.xml< gb:GridBeansInfo xmlns:gb =" http: // gpe . <strong>in</strong>tel . com / gridbeans ">< gb:Name >Date < gb:Author > Sandra Bergmann < gb:Version >1.0 < gb:Application >Date < gb:Description >Date GridBean < gb:Plug<strong>in</strong>Version >1.0 < gb:GridBean >de.fzj . gpe . gridbeans . date . DateGridBean< gb:Plug<strong>in</strong> type =" gb:Sw<strong>in</strong>g ">de.fzj . gpe . gridbeans . date . plug<strong>in</strong> . DatePlug<strong>in</strong>< gb:ApplicationName >Date < gb:ApplicationVersion >1.0 Migration Workshop , 29th Oct 2008 29


DateGridBean.javapublic class DateGridBean extends AbstractGridBean {private static f<strong>in</strong>al long serialVersionUID = 1L;public DateGridBean () { set ( JOBNAME , " Date " ); }public void setupJobDef<strong>in</strong>ition ( Job job ) throws GridBeanException {super . setupJobDef<strong>in</strong>ition ( job );if ( job <strong>in</strong>stance<strong>of</strong> GPEJob ) {GPEJob gpeJob = ( GPEJob ) job ;gpeJob . setApplicationName (" Date " );gpeJob . setApplicationVersion (" 1.0 " );gpeJob . setWork<strong>in</strong>gDirectory (GPEConstants . JobManagement . TEMPORARY_DIR_NAME );gpeJob . setId (" Date " );}else {throw new GridBeanException (" Invalid job type ." );}}public void parseJobDef<strong>in</strong>ition ( Job job ) throws GridBeanException {super . parseJobDef<strong>in</strong>ition ( job );}}public Str<strong>in</strong>g getName () { return " Date "; }Migration Workshop , 29th Oct 2008 30


DatePlug<strong>in</strong>.javapublic class DatePlug<strong>in</strong> extends GridBeanPlug<strong>in</strong> {}public void <strong>in</strong>itialize ( Client client , INode node ) {super . <strong>in</strong>itialize ( client , node );addInputPanel (new DateInputPanel ( client , getParameter ()));}Migration Workshop , 29th Oct 2008 31


DateInputPanel.javapublic class DateInputPanel extends GridBeanPanel {private static f<strong>in</strong>al long serialVersionUID = 1L;public DateInputPanel ( Client client , INode node ) {super ( client , " Date Input " , node );try {buildComponents ();} catch ( DataSetException e) {client . showException (" Failure creat<strong>in</strong>g panel ." , e);}}private void buildComponents () throws DataSetException {setLayout ( new BorderLayout ());setBorder ( BorderFactory . createCompoundBorder (BorderFactory . createRaisedBevelBorder () ,BorderFactory . createLoweredBevelBorder ()));JLabel label = new JLabel (" Date Application " );label . setHorizontalAlignment ( JLabel . CENTER );label . setVerticalAlignment ( JLabel . CENTER );add ( label , BorderLayout . CENTER );}}Migration Workshop , 29th Oct 2008 32


Example 2Example 2: DateGridBean with one <strong>in</strong>put parameters:◮ gridbean.xml◮ DateGridBean.java◮ DatePlug<strong>in</strong>.java◮ DateInputPanel.javaMigration Workshop , 29th Oct 2008 33


DateGridBean.javaSetup environment variables <strong>in</strong> the DateGridBean class:public DateGridBean () {set ( JOBNAME , "Date - Parameter ");EnvironmentVariableParameterValue arguments =new EnvironmentVariableParameterValue ("");getInputParameters (). add ( new GridBeanParameter (ARGUMENTS ,GridBeanParameterType . ENVIRONMENT_VARIABLE , true ));}set ( ARGUMENTS , arguments );Migration Workshop , 29th Oct 2008 34


DateInputPanel.javaAdd text <strong>in</strong>put field and l<strong>in</strong>k it with the correspond<strong>in</strong>g attribute <strong>of</strong>the GridBean Model:JTextField nameTextField = new JTextField (30);add ( argsTextField , BorderLayout . CENTER );l<strong>in</strong>kTextField ( DateGridBean . ARGUMENTS , argsTextField );setValueTranslator ( DateGridBean . ARGUMENTS ,Str<strong>in</strong>gValueTranslator . getInstance ());Migration Workshop , 29th Oct 2008 35


IDBThe accord<strong>in</strong>g IDB entry:< idb:IDBApplication >< idb:ApplicationName >Date < idb:ApplicationVersion >1.0 < jsdl:POSIXApplication xmlns:jsdl =" http: // schemas . ggf . org /< jsdl:Executable >/ b<strong>in</strong> / date < jsdl:Argument >$ ARGUMENTS ?Migration Workshop , 29th Oct 2008 36

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!