Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASM Hands-on. What will we learn? ● How to install an ASM-based web-application in gUSE ● How to develop ASM-related parts of an interface for – Importing.

Similar presentations


Presentation on theme: "ASM Hands-on. What will we learn? ● How to install an ASM-based web-application in gUSE ● How to develop ASM-related parts of an interface for – Importing."— Presentation transcript:

1 ASM Hands-on

2 What will we learn? ● How to install an ASM-based web-application in gUSE ● How to develop ASM-related parts of an interface for – Importing a workflow – Submiting a workflow – And so on...

3 AutoDock workflow ● Run docking simulations ● AutoGrid: – Role: generator (n job instances) – Creates inputs for AutoDock ● AutoDock: – Runs as a PS job – Performs the docking simulations ● Collector: – Examines the results – Collects m best results Inputs to be uploaded receptor.pdb placed in port 0 Number of job instances to be created as Command Line Argument Output placed to port 1 of Collector job

4 Introduction Would like to have : 4

5 Open the development framework and compile Autodock portlet ● Login to your cloud image: – ssh -X lpds@ – (here you will have a pre-installed WS-PGrade/gUSE 3.5.6) ● Get a copy of ASM based on Maven from Sourceforge – mkdir asm – cd asm – svn export svn://svn.code.sf.net/p/guse/svn/asm/branches/asm-3.4.4_mvn asm-3.4.4_mvn ● Start netbeans: – Netbeans – Close the 3 projects by selecting them all in Projects panel, then right click-> close – Open project ASM: Right click on Project panel -> open Project -> asm-3.4.4_mvn – Click to Open project – Click to Modules → Then right click on AutoDockPortlet and select Open Project – then navigate in Autodock Portlet go to Source Packages – hu.sztaki.lpds.autodock package – and finally click AutoDockPortlet.java for edition 5

6 Open the development framework and Autodock portlet ● Login to your cloud image: – ssh lpds@ 3 times (one for editing, one for commands, one for logs) – (here you will have a pre-installed WS-PGrade/gUSE 3.5.6) ● Get a copy of ASM based on Maven from Sourceforge – mkdir asm – cd asm – svn export svn://svn.code.sf.net/p/guse/svn/asm/branches/asm-3.4.4_mvn asm-3.4.4_mvn ● Open an exitor (mcedit/nano whatever) – mcedit asm- 3.4.4_mvn/samples/AutoDockPortlet/src/main/java/hu/sztaki/lpds/autodock/AutoDockPortlet.java 6

7 Implement method for workflow import //// EXCERCISE 1: Import a workflow, implement doImport method ### //// // Predefinitely we know on what prefix used for the exported workflow name String workflowPrefix = "autoDock_" + userId; // Predefinitely we know who exported the workflow String developerID = "10196"; // get the type of the workflow exported (it's been exported as Application) String impWfType = RepositoryItemTypeConstants.Application; // get the instance of ASMService singleton ASMService asmService = ASMService.getInstance(); // get the workflow ID to be imported Vector list = asmService.getWorkflowsFromRepository(developerID, impWfType); // it returns a list, grab the last one, the list is ordered according to time ASMRepositoryItemBean workflowToImport= list.lastElement(); // invoke ImportWorkflow method with the parameters asmService.ImportWorkflow(userId, workflowPrefix, developerID, impWfType, workflowToImport.getId().toString()); 7

8 Upload an input file //// ### EXCERCISE 2.: Upload and associate inputs and command line interfaces ### //// // get instance of ASMService singleton ASMService asmService = ASMService.getInstance(); // get the name of the job which has the input file to be set String jobName = "AutoGrid"; // upload the file to the portal server once File uploadedFile = asmService.uploadFiletoPortalServer(file,userId,fileName); // than upload it to the storage and associate it to the given job's given port asmService.placeUploadedFile(userId, uploadedFile, workflowName, jobName, portNumber); 8

9 Implement a method to submit a workflow //Implement doSubmit method (can be found by searching for Excercise 3 in the code) try { // get userID from ActionRequest object String userID = (String) request.getRemoteUser(); // get the ASMService instance ASMService asmService = ASMService.getInstance(); String workflowName = request.getParameter("selectedWorkflow"); // notifytext and notifyType can be added as empty strings. String notifyText = ""; String notifyType = ""; // invoke its submit function with the parameters asmService.submit(userID, workflowName, notifyText, notifyType); // catch all exceptions } catch (ClassNotFoundException ex) { Logger.getLogger(AutoDockPortlet.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(AutoDockPortlet.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(AutoDockPortlet.class.getName()).log(Level.SEVERE, null, ex); } 9

10 Compilation Compile all the Maven project by right-clicking to the name of the project in the Project panel and selecting Clean and build. The web archive will be created in /samples/AutoDockPortlet/target 10

11 Compilation Navigate to AutoDockPortlet folder (where you can find a pom.xml) Then type : mvn package [INFO] Building war: /home/lpds/asm/asm-3.4.4_mvn/samples/AutoDockPortlet/target/AutoDockPortlet.war [INFO] WEB-INF/web.xml already added, skipping [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 27.809s [INFO] Finished at: Fri Jul 05 09:38:34 UTC 2013 [INFO] Final Memory: 18M/44M The web archive will be created in /samples/AutoDockPortlet/target 11

12 Deployment and execution

13 Add new page for AutoDock portlet go to the portal: – http:// :8080/liferay- portal-6.1.0/ Sign in : – username: test@liferay.com – Password: lpds On the upper menu click to Add, then select Page link Name the page to AutoDock

14 Import workflow Get workflow from http://goo.gl/tZMWPhttp://goo.gl/tZMWP Select „Workflow” / „Upload” Browse the downloaded workflow file Click „Upload” „The upload is successful!”

15 Deploy the compiled web archive On the upper menu click to Go to, then Control Panel finally select Plugins installation down on the left hand side. Click to Install more portlets button Click to Upload File link Choose the compiled web archive file : (asn.3.4.4_mvn/samples/AutoDockPortlet/target AutoDockPortlet.war) Click to Install Note: In the terminal you should see this among the lines: 1 portlet for AutoDockPortlet is available for use

16 Deploy the compiled web archive Use HotDeploy possibility of Liferay: Copy AutoDockPortlet.war to $HOME/guse/deploy folder In target folder type this: cp AutoDockPortlet.war $HOME/guse/deploy

17 In the logs you should see something like this: 09:41:39,399 INFO [AutoDeployDir:167] Processing AutoDockPortlet.war 09:41:39,587 INFO [PortletAutoDeployListener:71] Copying portlets for /home/lpds/guse/deploy/AutoDo ckPortlet.war Expanding: /home/lpds/guse/deploy/AutoDo ckPortlet.war into /home/lpds/guse/apache- tomcat- 6.0.37/temp/20130705094139625 Copying 1 file to /home/lpds/guse/apache- tomcat- 6.0.37/temp/20130705094139625 /WEB-INF/classes Copying 1 file to /home/lpds/guse/apache- tomcat- 6.0.37/temp/20130705094139625 /WEB-INF/jsp Copying 103 files to /home/lpds/guse/apache- tomcat- 6.0.37/webapps/AutoDockPortle t Copying 1 file to /home/lpds/guse/apache- tomcat- 6.0.37/webapps/AutoDockPortle t Deleting directory /home/lpds/guse/apache- tomcat- 6.0.37/temp/20130705094139625 09:41:41,552 INFO [PortletAutoDeployListener:81] Portlets for /home/lpds/guse/deploy/AutoDo ckPortlet.war copied successfully. Deployment will start in a few seconds. Jul 5, 2013 9:41:48 AM org.apache.catalina.startup.Hos tConfig deployDirectory INFO: Deploying web application directory AutoDockPortlet 09:41:55,702 INFO [PluginPackageUtil:1099] Reading plugin package for AutoDockPortlet 09:41:55,712 WARN [PluginPackageUtil:1058] Plugin package on context AutoDockPortlet cannot be tracked because this WAR does not contain a liferay-plugin- package.xml file 09:41:57,581 INFO [PortletHotDeployListener:614] Registering portlets for AutoDockPortlet 09:41:57,736 WARN [PortletLocalServiceImpl:720] Portlet with the name AutoDockPortlet_WAR_AutoDo ckPortlet is described in portlet.xml but does not have a matching entry in liferay- portlet.xml 09:41:58,185 INFO [PortletHotDeployListener:433] 1 portlet for AutoDockPortlet is available for use

18 Register AutoDock Portlet as gUSE Component Note: You must do this only at first time! Click to Settings, then to Internal Services, finally click New to add new gUSE component represents ASM-based webapp. Type of component: portal Service group: guse URL of Component: http:// :8080/AutoDockPortlet URL to initialize Component: http:// :8080/AutoDockPortlet/init Public URL of Component: http:// :8080/AutoDockPortlet State: active Click to Save

19 Register AutoDock Portlet as gUSE Component Click to Copy component properties Set Component from to http:// :8080/wspgrade Set Component to to http:// :8080/AutoDockPortlet Click to copy Don't worry it is the good response :) : Sytem message???servicecall.propertyimport??? In the logs you should see this :http:// :8080/AutoDockPortlet-- http:// :8080/wspgrade

20 Restart the portal EXAMPLE: lpds@ubuntu:~$ ps aux | grep java lpds 1008 0.0 0.0 8128 616 pts/3 R+ 08:46 0:00 grep --color=auto java lpds 14882 0.7 66.2 3134236 1358020 ? Sl Jun25 19:15 /usr/bin/java - Djava.util.logging.config.file=/home/lpds/guse/apache-tomcat-6.0.37/conf/logging.properties - Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xms256m -Xmx1024m - XX:MaxPermSize=512m -Dfile.encoding=UTF8 -Duser.timezone=UTC - Djava.security.auth.login.config=/home/lpds/guse/apache-tomcat-6.0.37/conf/jaas.config - DcrlUpdateInterval=0s -DcrlEnabled=false -Dorg.globus.tcp.port.range=20000,25000 - Djava.endorsed.dirs=/home/lpds/guse/apache-tomcat-6.0.37/endorsed -classpath /home/lpds/guse/apache- tomcat-6.0.37/bin/bootstrap.jar -Dcatalina.base=/home/lpds/guse/apache-tomcat-6.0.37 - Dcatalina.home=/home/lpds/guse/apache-tomcat-6.0.37 -Djava.io.tmpdir=/home/lpds/guse/apache- tomcat-6.0.37/temp org.apache.catalina.startup.Bootstrap start lpds@ubuntu:~$ kill -9 14882 go to terminal./guse/apache-tomcat-6.0.37/bin/shutdown.sh ps aux | grep java kill -9./guse/apache-tomcat-6.0.37/bin/startup.sh NOTE : please do not use start.sh

21 Then start the portal with start.sh Check startup process: tailf ~/guse/apache-tomcat- 6.0.37/logs/catalina.out After a time you should see this as last line: INFO: Server startup in 116990 ms Then in the browser the initialization process must be invoked. Please follow its instructions. http:// :8080/information – Username: admin – Password: admin – JDBC Driver: org.gjt.mm.mysql.Driver – URI: jdbc:mysql://localhost:33 06/guse (IP must be changed to localhost) – User: guse – Password: guse – Please do NOT accept to provide my portal's location information :)

22 Then go back to the portal : – http:// :80 80/life ray- portal- 6.1.0/ – And sign in... #Add weba pplic ation Click to Auto Dock menu item Add - > More -> undef ined - -> Auto Dock Portl et #Set Layo ut Mana ge -> Page Layo ut -> 1 colu mn - > Save

23 Finally check your application by – Uploading receptor.pdb located in /test folder of AutoDock web application – Creating new measurement – Executing it – Checking its status (by clicking to AutoDock link) – Downloading the results

24 End of Hands-On Thanks for your attention! Questions?


Download ppt "ASM Hands-on. What will we learn? ● How to install an ASM-based web-application in gUSE ● How to develop ASM-related parts of an interface for – Importing."

Similar presentations


Ads by Google