Using Opal to deploy a real scientific application as a Web service

righteousgaggleΔιαχείριση Δεδομένων

31 Ιαν 2013 (πριν από 4 χρόνια και 6 μήνες)

130 εμφανίσεις

Using Opal to deploy a real scientific application as a
Web service

Sriram Krishnan

sriram@sdsc.edu

Downloads


Opal Tutorial


This presentation


JDK 1.5:


http://java.sun.com/javase/downloads


Apache Ant:


http://ant.apache.org/


Apache Tomcat:


http://nbcr.net/services/downloads/tutorial/jakarta
-
tomcat
-
5_0_30.zip


Opal 1.9 Distribution


From the Opal website

Goals


Start off with a clean slate


Install software prerequisites


Install the Opal toolkit


Deploy scientific application as Web
service


Access service via command
-
line client

Before we get started


Should have JAVA and ANT already installed


And environment variables JAVA_HOME and
ANT_HOME set correctly


Java:
http://java.sun.com/javase/downloads


Ant:
http://ant.apache.org/


Make sure that these can be accessed from the
command prompt


Type “
java



Type “
ant


Download Software Prerequisites


Create a new directory called “
Tutorial



Download and Extract Tomcat


http://nbcr.net/services/downloads/tutorial/jakarta
-
tomcat
-
5_0_30.zip


Extract inside Tutorial directory

Download Opal


Download and extract Opal


Extract inside the
Tutorial

directory


Compile the sources


On the command prompt, cd to the above
location


Open the “
build.properties
” and modify the
variable “
catalina.home
” with the path where
you installed tomcat (previous slide)


Type “
ant jar



Watch for error messages

Edit Opal properties


Open the file “
etc/opal.properties
” inside
the Opal installation


Look over the various properties being set


Modify the property “
tomcat.url
” by replacing

localhost
” with the the IP address of your
machine


Type “
ifconfig
-
a
” to figure out your IP address

Opal Properties


# parallel parameters


num.procs=1


mpi.run=/Users/sriramkrishnan/Misc/mpich
-
1.2.7/bin/mpirun



# the base URL for the tomcat installation


tomcat.url=http://localhost:8080



# database information


database.use=false


database.url=jdbc:postgresql://localhost/app_db


database.user=app_user


database.passwd=app_passwd



# drmma information


drmaa.use=false


drmaa.pe=mpich



# globus information


globus.use=false


globus.gatekeeper=localhost:2119/jobmanager
-
sge


globus.service_cert=/Users/sriramkrishnan/certs/app_service.cert.pem


globus.service_privkey=/Users/sriramkrishnan/certs/app_service.privkey

Deploy Opal inside Tomcat


From the Opal directory, type the following command:



ant install




Start Tomcat from the command prompt


Type “
cd $CATALINA_HOME/bin



Type “

chmod +x *.sh
” (so this only once)



Type “
./startup.sh
” (use this command to start the server)




Test the Opal installation


http://localhost:
8080
/opal/happyaxis.jsp


Watch for error messages, warnings are OK


If you wanna stop the Tomcat server type

./shutdown.sh


Download Scientific Application


We will use the application OpenBabel


Designed to support molecular modeling,
chemistry, and many related areas, including
inter
-
conversion of file formats and data.


Download appropriate version from:


http://openbabel.sourceforge.net/


Extract inside the “
Tutorial/Babel
” directory


Type “babel” from the above directory to ensure
that it installed fine

Edit Babel Config


Open the file “
configs/babel_config.xml

inside the Opal installation


Look over the various elements


Change the value of the “
binaryLocation
” to
point to your Babel executable


Babel Config


<appConfig xmlns="http://nbcr.sdsc.edu/opal/types"


xmlns:xsd="http://www.w3.org/2001/XMLSchema">


<metadata>


<usage><![CDATA[./babel [
-
i<input
-
type>] <name> [
-
o<output
-
type>] <name>]]></usage>


<info xsd:type="xsd:string">


<![CDATA[


...


Currently supported input types

alc
--

Alchemy file

prep
--

Amber PREP file

...


Currently supported output types


caccrt
--

Cacao Cartesian file

cacint
--

Cacao Internal file


...


Additional options :


...


]]>


</info>


</metadata>


<binaryLocation>/Users/sriramkrishnan/bin/babel</binaryLocation>


<defaultArgs></defaultArgs>


<parallel>false</parallel>

</appConfig>

Deploy application using Ant


On the command prompt, cd to your Opal
installation


To deploy application, type the following:


ant deploy
-
DserviceName=BabelServicePort


-
DappConfig=configs/babel_config.xml


Check list of services


http://localhost:
8080
/opal/services

Run command line client


On the command prompt, cd to your Opal installation


Set classpath by typing “
. etc/classpath.sh
” (on Bash)



To run the job, type the following:


java edu.sdsc.nbcr.opal.GenericServiceClient


-
l http://localhost:
8080
/opal/services/BabelServicePort


-
a ”
-
ipdb sample.pdb
-
opdb out.pdb"
-
f etc/sample.pdb
-
r launchJob


To query status, type the following:


java edu.sdsc.nbcr.opal.GenericServiceClient


-
l http://localhost:
8080
/opal/services/BabelServicePort


-
r queryStatus
-
j <job_id>

What’s Next?


To add another service, you just need to
add another application config


And deploy using Ant
-

that’s all!


You can write custom clients for your Web
services


e.g. Java, Python, Perl, JavaScript

Advanced Configuration


Database:


http://nbcr.net/software/opal/docs/database.html


For persisting job metadata and access logs


Scheduler:


http://nbcr.net/software/opal/docs/scheduler.html


To access local schedulers via DRMAA or GRAM


GSI Security:


http://nbcr.net/software/opal/docs/security.html


To enable GSI
-
based authentication and
authorization

More Information


http://nbcr.net/software/opal


Downloads, Papers, Presentations


More documentation


Advanced configuration like Database, Scheduler,
and Security setup


Feel free to drop us a note
-

contacts
available from our web page