Title: Using Opal to deploy a real scientific application as a Web service
1Using Opal to deploy a real scientific
application as a Web service
- Sriram Krishnan
- sriram_at_sdsc.edu
2Downloads
- 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/jakart
a-tomcat-5_0_30.zip - Opal 1.9 Distribution
- From the Opal website
3Goals
- 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
4Before 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
5Download Software Prerequisites
- Create a new directory called Tutorial
- Download and Extract Tomcat
- http//nbcr.net/services/downloads/tutorial/jakart
a-tomcat-5_0_30.zip - Extract inside Tutorial directory
6Download 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
7Edit 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
8Opal Properties
parallel parameters num.procs1
mpi.run/Users/sriramkrishnan/Misc/mpich-1.2.7/bin
/mpirun the base URL for the tomcat
installation tomcat.urlhttp//localhost8080
database information
database.usefalse database.urljdbcpostgresq
l//localhost/app_db database.userapp_user
database.passwdapp_passwd drmma
information drmaa.usefalse
drmaa.pempich globus information
globus.usefalse globus.gatekeeperlocalhost2
119/jobmanager-sge globus.service_cert/Users/
sriramkrishnan/certs/app_service.cert.pem
globus.service_privkey/Users/sriramkrishnan/certs
/app_service.privkey
9Deploy 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//localhost8080/opal/happyaxis.jsp
- Watch for error messages, warnings are OK
- If you wanna stop the Tomcat server type
./shutdown.sh
10Download 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
11Edit 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
12Babel Config
ltappConfig xmlns"http//nbcr.sdsc.edu/opal/types
" xmlnsxsd"http//www.w3.org/2001/XML
Schema"gt ltmetadatagt ltusagegtlt!CDATA./babel
-iltinput-typegt ltnamegt -oltoutput-typegt
ltnamegtgtlt/usagegt ltinfo xsdtype"xsdstring"gt
lt!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 ... gt lt/infogt
lt/metadatagt ltbinaryLocationgt/Users/sriramkrishna
n/bin/babellt/binaryLocationgt ltdefaultArgsgtlt/defa
ultArgsgt ltparallelgtfalselt/parallelgt lt/appConfiggt
13Deploy application using Ant
- On the command prompt, cd to your Opal
installation - To deploy application, type the following
- ant deploy -DserviceNameBabelServicePort
-DappConfigconfigs/babel_config.xml - Check list of services
- http//localhost8080/opal/services
14Run 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//localhost8080/opal/services/BabelServi
cePort - -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//localhost8080/opal/services/BabelServi
cePort - -r queryStatus -j ltjob_idgt
15Whats Next?
- To add another service, you just need to add
another application config - And deploy using Ant - thats all!
- You can write custom clients for your Web
services - e.g. Java, Python, Perl, JavaScript
16Advanced 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
17More 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