GTLAB Installation Tutorial for SciDAC 2009


Published on

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

GTLAB Installation Tutorial for SciDAC 2009

  1. 1. Installing and Building GTLAB Marlon Pierce Indiana Univeristy
  2. 2. GTLAB and OGCE <ul><li>OGCE contains multiple sub-projects </li></ul><ul><ul><li>Portlet-based Grid portal (with GridSphere and Tomcat). </li></ul></ul><ul><ul><li>Workflow suite (services and add-ins to the portal) </li></ul></ul><ul><ul><li>Information Web services </li></ul></ul><ul><ul><li>Gadget container </li></ul></ul><ul><ul><li>Cyberaide JavaScript libraries </li></ul></ul><ul><ul><li>GTLAB </li></ul></ul><ul><li>These are packaged with Maven and include everything you need except Java and (for some services) MySQL. </li></ul><ul><li>We try to make things installable with minimal fuss. </li></ul><ul><ul><li>Consistent directory structures across projects </li></ul></ul><ul><ul><li>Edit one config file (pom.xml) </li></ul></ul><ul><ul><li>Run one command (mvn clean install) </li></ul></ul><ul><ul><li>You may need to futz a little with MySQL </li></ul></ul>
  3. 3. Overview and Examples
  4. 4. User’s Browser Portlet, Gadget Containers iGoogle, Facebook GTLAB Gadgets TeraGrid Services (GRAM, GridFTP, INCA) Google GData Services, Twitter Feeds, etc RPS, RDS, GPIR Services GTLAB’s Relationship to Other Components
  5. 5. Various GTLAB applications deployed as portlets: Remote directory browsing, proxy management, and LoadLeveler queues.
  6. 6. GTLAB Applications as Google Gadgets: MOAB dashboard, remote directory browser, and proxy management.
  7. 7. MyProxy Example <h:form id=&quot;form&quot;> <h:outputText value=&quot;Username:&quot;/> <h:inputText value=&quot;#{resource.username}&quot; required=&quot;true&quot;/> <h:outputText value=&quot;Password: &quot;/> <h:inputSecret value=&quot;#{resource.password}&quot; required=&quot;true&quot;/> <h:outputText value=&quot;MyProxy Server: &quot;/> <h:inputText value=&quot;#{resource.myproxyHostname}&quot; required=&quot;true&quot;/> <o:submit id=&quot;submit&quot; value=&quot;Submit&quot; binding=&quot;#{builder.body}&quot; action=&quot;#{builder.junkAction}&quot; > <o:multitask id=&quot;multi&quot; persistent=&quot;true&quot; taskname=&quot;#{resource.taskname}&quot;> <o:myproxy id=&quot;mypr&quot; hostname=&quot;#{resource.myproxyHostname}&quot; lifetime=&quot;2&quot; password=&quot;#{resource.password}&quot; port=&quot;7512&quot; username=&quot;#{resource.username}&quot;/> </o:multitask> </o:submit> </h:form>
  8. 8. Executing Multiple Task <o:submit id=&quot;submit&quot; value=&quot;Submit&quot; binding=&quot;#{builder.body}&quot; action=&quot;#{builder.junkAction}&quot; > <o:multitask id=&quot;multi&quot; persistent=&quot;true&quot; taskname=&quot;#{resource.taskname}&quot;> < o:jobsubmit id=&quot;js&quot; myfaces=&quot;true&quot; arguments=&quot;#{resource.arguments}&quot; executable=&quot;#{resource.executable}&quot; hostname=&quot;#{resource.hostname}&quot; provider=&quot;#{resource.provider}&quot; stdout=&quot;#{resource.stdout}&quot;/> < o:filetransfer id=&quot;ft&quot; myfaces=&quot;true&quot; from=&quot;#{resource.from}&quot; to=&quot;#{}&quot; /> <o:dependency id=&quot;dep&quot; task=&quot;ft&quot; dependsOn=&quot;js&quot;/> </o:multitask> </o:submit>
  9. 9. Resource Prediction Service Client with GTLAB <o:submit id=&quot;submit&quot; value=&quot;Submit&quot; binding=&quot;#{builder.body}&quot; action=&quot;#{builder.junkAction}&quot;> <o:multitask id=&quot;multi&quot; persistent=&quot;true&quot; taskname=&quot;#{resources.taskname”> <o:rpsOptimal resource=&quot;task1-resources&quot; id=&quot;rpsoptimal-exec&quot; myfaces=&quot;true&quot;/> </o:multitask> </o:submit>
  10. 10. Example with Dependency <o:submit id=&quot;submit” …> <o:multitask id=&quot;multi” …> <o:rpsAddModel resource=&quot;task1-resources&quot; id=&quot;rpsAddModel-exec&quot; myfaces=&quot;true&quot;/> <o:rpsManager resource=&quot;task1-resources&quot; id=&quot;rpsManager-exec&quot; myfaces=&quot;true&quot;/> <o:dependency id=&quot;deps-rpsstuff” task=&quot;rpsManager-exec&quot; dependsOn=&quot;rpsAddModel-exec&quot;/> </o:multitask> </o:submit>
  11. 11. More Detail: Available Tags and Features
  12. 12. GTLAB Features <ul><li>Extends Java Server Faces. </li></ul><ul><ul><li>Tag components wrap major COG Abstraction Layer features </li></ul></ul><ul><ul><li>And Web Service clients, GridShib , etc. </li></ul></ul><ul><ul><li>Supports tag inter-dependencies . </li></ul></ul><ul><li>Allows you to do standalone development. </li></ul><ul><li>Use JSF portlet bridge to convert into portlets </li></ul><ul><ul><ul><li>No new coding, just add/modify XML config files and jars. </li></ul></ul></ul><ul><ul><ul><li>Process is automated </li></ul></ul></ul><ul><li>Or forget about portlets </li></ul><ul><ul><li>Convert into Google Gadgets </li></ul></ul><ul><ul><li>Develop as a Facebook application </li></ul></ul><ul><ul><li>Etc. </li></ul></ul>
  13. 13. Getting GTLAB <ul><li>See </li></ul><ul><li>You can use your favorite SVN client to check out. </li></ul><ul><ul><li>svn co (latest) </li></ul></ul><ul><ul><li>svn co (tagged) </li></ul></ul><ul><li>“ Latest” will give you easy access to any updates </li></ul><ul><ul><li>“ svn update” </li></ul></ul><ul><ul><li>Best option if you want to actively develop and get fixes right away. </li></ul></ul>
  14. 14. No SVN? Get the TAR <ul><li>SourceForge’s SVN/CVS viewer now provides a “Download GNU Tar” option. </li></ul><ul><li> for latest. </li></ul><ul><li> for tag </li></ul>
  15. 15. Levels of Abstraction in GTLAB code <ul><li>Note JSF is compatible with JSP, so you can mix and match. </li></ul><ul><li>And you can embed JavaScript </li></ul><ul><ul><li>YUI, Scriptaculous user interface goodies. </li></ul></ul><ul><ul><li>Google and Facebook APIs. </li></ul></ul>You can use prepackaged gadgets/portlets. You can develop new applications using existing tag libraries. You can make new tags for your services You can hack or steal the code
  16. 16. Tag Description MyProxy Gets a proxy credential (COG) JobSubmit Runs remote commands (COG) FileOperation Create, delete, list remote files and dirs (COG) FileTransfer GridFTP downloads, 3 rd party transfers (COG) XSubmissionOutput Format outputs of job and file operations ResourceDiscovery Clients for the RDS ResourcePrediction Clients for the RPS MyCommunityProxy Get and decorate TG Community credentials with Grid Shib Community Log Log use of TG Community credentials
  17. 17. These will work as gadgets, portlets, or standalone applications GTLAB Example Description MyProxyExample Get a credential and store in OGCE global proxy store. JobSubmitExamples Various examples showing how to submit a grid job and get output. Dashboard Examples Runs showq on Big Red, Cobalt, and Mercury and formats output. DirectoryBrowser Displays and downloads files on a remote host via GridFTP MultipleTaskExample Shows how to couple file transfers, operations, and
  18. 18. Gadgets and Portlets
  19. 19. GTLAB Gadgets Code Base GTLAB Portlets Code Base Tomcat Web Server Tomcat Web Server + Portlet Container iGoogle Client Aggregator Compile and deploy into server Decorate with bridge and container jars, xml config files. GTLAB gadgets can also run as portlets with no code changes by using the JSF portlet bridge.
  20. 20. Making GTLAB Google Gadgets <ul><li>A Gadget is a standalone application that is integrated into your personal iGoogle display. </li></ul><ul><ul><li>They can run on your Web server . </li></ul></ul><ul><ul><li>You can use SSL/HTTPS </li></ul></ul><ul><li>Google Gadgets have two versions </li></ul><ul><ul><li>http : these use Google’s JavaScript APIs </li></ul></ul><ul><ul><li>url : these wrap external applications with Iframes. </li></ul></ul><ul><li>We currently support “url” gadgets. </li></ul>
  21. 21. Example Gadget Config File <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?> <Module> <ModulePrefs title=&quot;MyProxy Gadget Example&quot; scrolling=&quot;true&quot; height=&quot;500&quot;/> <Content type=&quot;url&quot; href=&quot;http://…/:8080/GTLAB/examples/MyProxyExample.jsf&quot;> </Content> </Module> Save this as MyProxy.xml and place in a Web accessible place.
  22. 22. Other Gadgets Providers Tomcat + GTLAB Gadgets Grid and Web Services (TeraGrid, OSG, etc) Other Gadgets Providers Social Network Services (Orkut, LinkedIn,etc) RSS Feed, Cloud, etc Services Gadget containers aggregate content from multiple providers . Content is aggregated on the client by the user. Nearly any web application can be a simple gadget (as Iframes)
  23. 23. Click “Add stuff” and then “Add feed or gadget”. Type the URL of your gadget.
  24. 24. GTLAB Applications as Google Gadgets: MOAB dashboard, remote directory browser, and proxy management.
  25. 25. Tomcat + Portlets and Container Grid and Web Services (TeraGrid, OSG, etc) Grid and Web Services (TeraGrid, OSG, etc) Grid and Web Services (TeraGrid, OSG, etc) HTML/HTTP SOAP/HTTP Common science gateway architecture. Aggregation is in the portlet container. Users have limited selections of components.
  26. 26. Making GTLAB Gadgets into Portlets <ul><li>Do all development in jsf_standalone directory </li></ul><ul><ul><li>This is where your template tags will be placed </li></ul></ul><ul><li>When you are ready to convert: </li></ul><ul><ul><li>Download and build the OGCE portal </li></ul></ul><ul><ul><li>cd GTLAB/transition </li></ul></ul><ul><ul><li>mvn clean process-resources </li></ul></ul><ul><ul><li>cd GTLAB/portlets </li></ul></ul><ul><ul><li>mvn clean install </li></ul></ul><ul><li>You will need to make small edits to portlet.xml, group.xml, and layout.xml in GTLAB/portlet/src/main/webapp/WEB-INF/ </li></ul><ul><li>That’s it. </li></ul>
  27. 27. Various GTLAB applications deployed as portlets: Remote directory browsing, proxy management, and LoadLeveler queues.
  28. 28. Getting Started with GTLAB
  29. 29. GTLAB Directory Structure
  30. 30. Build GTLAB <ul><li>Unpack or checkout code </li></ul><ul><li>Cd GTLAB </li></ul><ul><ul><li>All commands are executed from here. </li></ul></ul><ul><li>Edit properties at the top of pom.xml. </li></ul><ul><ul><li>Change IP </li></ul></ul><ul><ul><li>Change project.home if you unpack someplace besides $HOME. </li></ul></ul><ul><li>Run “mvn clean install” </li></ul><properties> <portal.server.ip> </portal.server.ip> <host.base.url> http://${portal.server.ip}:8080/ </host.base.url> <project.home> ${env.HOME}/GTLAB </project.home> <tomcat.version> apache-tomcat-5.5.27 </tomcat.version> <catalina.home> ${project.home}/portal_deploy/${tomcat.version}/ </catalina.home> <dot.globus.home> ${env.HOME}/.globus/ </dot.globus.home> </properties>
  31. 31. Run Examples <ul><li>From GTLAB, start tomcat with ./ </li></ul><ul><li>From GTLAB, stop Tomcat with ./ </li></ul><ul><li>Point browser to http://localhost:8080/GTLAB </li></ul><ul><li>Start with MyProxy Example </li></ul>
  32. 32. Next Steps <ul><li>Play with examples. </li></ul><ul><ul><li>These are really bare bones. Make something interesting. </li></ul></ul><ul><li>Make a Google gadget. </li></ul><ul><li>Mix and match tags in a pipeline to make a new application. </li></ul><ul><ul><li>Use the dependency tag. </li></ul></ul><ul><ul><li>Note you can mix and match JSF and JSP if you are not familiar with JSF. </li></ul></ul><ul><li>Try making a new tag. </li></ul><ul><ul><li>Explained next. </li></ul></ul>
  33. 33. Making New Tags and Examples
  34. 34. Making a New JSF Page from Tags <ul><li>I recommend starting from the examples . </li></ul><ul><ul><li>jsf_standalone/src/main/webapp/examples </li></ul></ul><ul><li>“ Build” the examples with </li></ul><ul><ul><li>mvn –o clean install –f jsf_standalone/pom.xml </li></ul></ul><ul><li>The “-o” option is used to build offline . Will also avoid unnecessary Maven repository updates. </li></ul><ul><li>The “-f” specifies only build this specific module. </li></ul><ul><li>I recommend not futzing with the deployed versions under portal_deploy. </li></ul><ul><ul><li>A computer is a state machine. State must be reproducible. </li></ul></ul>
  35. 35. Making a New Tag <ul><li>Run the following command from GTLAB: </li></ul><ul><ul><li>mvn clean process-resources -Dprojectname=Test -f templateTag/pom.xml </li></ul></ul><ul><ul><li>Add -Ddest.dir=/tmp for a dry run. </li></ul></ul><ul><li>Replace “test” with the name of your tag. </li></ul><ul><li>Replace “Test” with the name for your Bean. </li></ul><ul><li>This will make 4 files </li></ul><ul><ul><li> ,, , </li></ul></ul><ul><li>Edits also 3 config files </li></ul><ul><ul><li>gtlab-factory.xml, managed-beans.xml , components.xml </li></ul></ul><ul><li>This will compile but to implement something useful, you will need to edit the highlighted files. </li></ul>
  36. 36. Implementing a Tag <ul><li>The place to start is (or whatever you used for –Dprojectname=…). </li></ul><ul><li>This includes several inherited methods that can be implemented. </li></ul><ul><ul><li>Most important is submit() . Use the try/catch block. This is where the action is. </li></ul></ul><ul><ul><li>If you want to hook tags into chains, implement getOutput() and setInput() . </li></ul></ul><ul><ul><li>Also take a look at the other beans. </li></ul></ul>
  37. 37. Suggested Tags: A Wish List <ul><li>What can you do in your bean? Anything server-side Java can do. </li></ul><ul><li>Some suggestions: </li></ul><ul><ul><li>Implement a tag client to a remote Web service. Amazon has some interesting ones…. </li></ul></ul><ul><ul><li>Implement an RSS/Atom feed client to Twitter, your blog, Facebook, etc. </li></ul></ul><ul><ul><li>Combine the feeds as a mash-up . </li></ul></ul><ul><ul><li>Connect to a database with JDBC. </li></ul></ul><ul><ul><li>Implement a JMS publisher or subscriber. </li></ul></ul><ul><ul><li>Use Google Java APIs to interact with Blogger, Calendar, and YouTube. </li></ul></ul><ul><ul><li>Try interacting with Facebook . </li></ul></ul>
  38. 38. INCA Tags: An Extended Example
  39. 39. Example: Make an INCA Dashboard <ul><li>INCA is used as the testing framework for the TeraGrid. </li></ul><ul><li>You can get the latest INCA test results from the URL </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li>See Sangmi’s notes at </li></ul></ul><ul><li>You’ll get back some fine looking XML. </li></ul><ul><li>Let’s make a little dashboard out of this. </li></ul>
  40. 40. First, Create a New, Empty Tag <ul><ul><li>mvn clean process-resources </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li>-Dprojectname=IncaStatus </li></ul></ul><ul><ul><li>-f templateTag/pom.xml </li></ul></ul>
  41. 41. Second, Implement the Bean <ul><li>Main thing is to implement IncaStatusBean’s submit() method. </li></ul><ul><li>Code is hard to put in a PPT slide </li></ul><ul><li>See </li></ul>
  42. 42. Third, Implement a JSF Page <ul><li>Actual tag is shown below. </li></ul><ul><li>Full example is </li></ul><ul><li>It includes some boilerplate (can be automated). </li></ul><o:incastatus id=”mytest&quot; resource=&quot;task1-resources” myfaces=&quot;true&quot;/>
  43. 43. Here’s the resulting page. You can make into a portlet in a couple of steps. You can also tie to other tags in a pipeline.
  44. 44. Next Steps: Make a Pipeline <ul><li>Implement the setInput() and getOutput() methods. </li></ul><ul><li>Pipeline it with the Resource Description and Resource Prediction Service tags. </li></ul><ul><li>Integrate QBETS tags </li></ul><ul><ul><li>Currently unwritten </li></ul></ul><ul><li>Integrate with Job Submission </li></ul>Find Running Hosts (INCA or RDS) Find Best Host for YourJob (RPS) Find Host with Shortest Wait Time (QBETS) Submit Job
  45. 46. More Stuff about GTLAB <ul><li>Supports linear tag dependencies . </li></ul><ul><ul><li>Removed dependence on COG graph processing (still use the COG) </li></ul></ul><ul><ul><li>We can support graphs of any tag you care to write. </li></ul></ul><ul><ul><li>Only support pipelines currently, not full DAGs </li></ul></ul><ul><li>Redesigned to simplify writing new tags . </li></ul><ul><ul><li>Extensive use of factories. </li></ul></ul><ul><ul><li>You no longer have to change core code to add a tag </li></ul></ul><ul><ul><li>Templates for 4 Java files and 3 XML config files now can be done in one (mvn) step </li></ul></ul><ul><ul><ul><li>Typically you will only need to edit one Java file. </li></ul></ul></ul>