JABAWS MANUAL
JABAWS Configuration
- JABAWS Configuration
- Local Engine Configuration
- Cluster Engine Configuration
- Executable Configuration
- Defining Environment Variables for Executables
- Configure JABAWS to Work with Mafft
- Limiting the size of the job accepted by JABAWS Server
- Using a different version of the alignment program with JABAWS
- Load balancing
- Reviewing JABAWS configuration via web browser
- Testing JABA Web Services
- JABAWS requests logging
- JABAWS internal logging
- Monitoring JABAWS
- JABAWS War File Content
JABAWS Configuration
There are three parts of the system you can configure. The local and the cluster engines, and the paths to the individual executables for each engine. These settings are stored in configuration files within the web application directory (for an overview, then take a look at the war file content table).
Initially, JABAWS is configured with only the local engine enabled, with job output written to directory called "jobsout" within the web application itself. This means that JABAWS will work out of the box, but may not be suitable for serving a whole lab or a university.
Local Engine Configuration
The Local execution engine configuration is defined in the
properties file conf/Engine.local.properties. The supported
configuration settings are:
engine.local.enable=true - #
enable or disable local engine, valid values true | false
local.tmp.directory=D:\\clusterengine\\testoutput
- a directory to use for temporary files storage, optional,
defaults to java temporary directory
engine.local.thread.number=4 -
Number of threads for tasks execution (valid values between 1 and
2x cpu. Where x is a number of cores available in the system).
Optional defaults to the number of cores for core number <=4 and
number of cores-1 for greater core numbers.
If the local engine going to be heavily loaded (which is often the case if you do not have a cluster) it is a good idea to increase
the amount of memory available for the web application server. If
you are using Apache-Tomcat, then you can define its memory
settings in the JAVA_OPTS environment variable. To specify which
JVM to use for Apache-Tomcat, put the full path to the JRE
installation in the JAVA_HOME environment variable (We would
recommend using Sun Java Virtual Machine (JVM) in preference to
Open JDK). Below is an example of code which can be added to <tomcat_dir>/bin/setenv.sh script
to define which JVM to use and a memory settings for Tomcat server.
Tomcat server startup script (catalina.sh) will execute setenv.sh on each server start
automatically.
export
JAVA_HOME=/homes/ws-dev2/jdk1.6.0_17/
export JAVA_OPTS="-server -Xincgc -Xms512m -Xmx1024m"
Cluster Engine Configuration
Supported configuration settings:
engine.cluster.enable=true - #
enable or disable local engine true | false, defaults to
false
cluster.tmp.directory=/homes/clustengine/testoutput-
a directory to use for temporary files storage. The value must be
an absolute path to the temporary directory. Required. The value
must be different from what is defined for local engine. This
directory must be accessible from all cluster nodes.
For the cluster engine to work, the SGE_ROOT and LD_LIBRARY_PATH
environment variables have to be defined. They tell the cluster
engine where to find DRMAA libraries. These variables
should be defined when the web application server starts up, e.g.
SGE_ROOT=/gridware/sge
LD_LIBRARY_PATH=/gridware/sge/lib/lx24-amd64
Finally, do not forget to configure executables for the cluster execution, they may be the same as for the local execution but may be different. Please refer to the executable configuration section for further details.
Executable Configuration
All the executable programs
are configured in conf/Executable.properties file. Each executable
is configured with a number of options. They are: local.X.bin.windows=<path to executable under windows
system, optional>
local.X.bin=<path to the executable under non-windows system,
optional>
cluster.X.bin=<path to the executable on the cluster, all
cluster nodes must see it, optional>
X.bin.env=<semicolon separated list of environment variables
for executable, use hash symbol as name value separator,
optional>
X.--aamatrix.path=<path to the directory containing
substitution matrices, optional>
X.presets.file=<path to the preset configuration file, optional
>
X.parameters.file=<path to the parameters configuration file,
optional>
X.limits.file=<path to the limits configuration file,
optional>
X.cluster.settings=<list of the cluster specific options,
optional>
Where X is either clustal, muscle, mafft, probcons or tcoffee.
Default JABAWS configuration includes path to local executables to be run by the local engine only, all cluster related settings are commented out, but they are there for you as example. Cluster engine is disabled by default. To configure executable for cluster execution un comment the X.cluster settings and change them appropriately.
By default limits are set well in excess of what you may want to offer to the users outside your lab, to make sure that the tasks are never rejected. The default limit is 100000 sequences of 100000 letters on average for all of the JABA web services. You can adjust the limits according to your needs by editing conf/settings/<X>Limit.xml files.
After you have completed the editing your configuration may look like
this:local.mafft.bin.windows=
local.mafft.bin=binaries/mafft
cluster.mafft.bin=/homes/cengine/mafft
mafft.bin.env=MAFFT_BINARIES#/homes/cengine/mafft;FASTA_4_MAFFT#/bin/fasta34;
mafft.--aamatrix.path=binaries/matrices
mafft.presets.file=conf/settings/MafftPresets.xml
mafft.parameters.file=conf/settings/MafftParameters.xml
mafft.limits.file=conf/settings/MafftLimits.xml
mafft.cluster.settings=-q bigmem.q -l h_cpu=24:00:00 -l
h_vmem=6000M -l ram=6000M
Please not that relative paths must only be specified for the files that reside inside web application directory, all other paths must be supplied as absolute!
Furthermore, you should avoid using environment variables within the paths or options - since these will not be evaluated correctly. Instead, please explicitly specify the absolute path to anything normally evaluated from an environment variable at execution time.
If you are using JABAWS to submit jobs to the cluster (with cluster engine enabled), executables must be available from all cluster nodes the task can be sent to, also paths to the executables on the cluster e.g. cluster.<exec_name>.bin must be absolute.
Executables can be located anywhere in your system, they do not have to reside on the server as long as the web application server can access and execute them.
Cluster settings are treated as a black box, the system will just pass whatever is specified in this line directly to the cluster submission library. This is how DRMAA itself treats this settings. More exactly DRMAA JobTemplate.setNativeSpecification() function will be called.
Defining Environment Variables for Executables
Environment variables can be defined in property x.bin.env Where x is
one of five executables supported by JABAWS. Several environment
variables can be specified in the same line. For example.
mafft.bin.env=MAFFT_BINARIES#/homes/cengine/mafft;FASTA_4_MAFFT#/bin/fasta34;
The example above defines two environment variables with names MAFFT-BINARIES and FASTA_4_MAFFT and values /homes/cengine/mafft and /bin/fasta34 respectively. Semicolon is used as a separator between different environment variables whereas hash is used as a separator for name and value of the variable.
Configure JABAWS to Work with Mafft
If you use default configuration you do not need to read any further. The default configuration will work for you without any changes, however, if you want to install Mafft yourself then there is a couple of more steps to do.
Mafft executable needs to know the location of other files supplied with Mafft. In addition some Mafft functions depends on the fasta executable, which is not supplied with Mafft, but is a separate package. Mafft needs to know the location of fasta34 executable.
To let Mafft know where the other files from its package are change the value of MAFFT-BINARIES environment variables. To let Mafft know where is the fasta34 executable set the value of FASTA_4_MAFFT environment variable to point to a location of fasta34 program. The latter can be added to the PATH variable instead. If you are using executables supplied with JABAWS, the path to Mafft binaries would be like <relative path to web application directory>/binaries/src/mafft/binaries and the path to fasta34 binary would be <relative path to web application directory>/binaries/src/fasta34/fasta34. You can specify the location of Mafft binaries as well as fasta34 program elsewhere by providing an absolute path to them. All these settings are defined in conf/Executable.properties file.
Limiting the size of the job accepted by JABAWS
JABAWS can be configured to reject excessively large tasks. This is useful if you operate JABAWS service for many users. By defining a maximum allowed task size you can provide an even service for all users and prevents waist of resources on the tasks too large to complete successfully. You can define the maximum number of sequences and the maximum average sequence length that JABAWS accepts for each JABA Web Service independently.
Furthermore, you can define different limits for different presets of the same web service.
By default limits are set well in excess of what you may want to offer to the users outside your lab, to make sure that the tasks are never rejected. The default limit is 100000 sequences of 100000 letters on average for all of the JABA web services. You can adjust the limits according to your needs by editing conf/settings/<X>Limit.xml files.
Using a different version of the alignment program with JABAWS
JABAWS supplied with binaries and source code of the executables which version it supports. So normally you would not need to install your own executables. However, if you have a different version of an executable (e.g. an alignment program) which you prefer, you could use it as long as it supports all the functions JABAWS executable supported. This could be the case with more recent executable. If the options supported by your chosen executable is different when the standard JABAWS executable, than you need to edit ExecutableNameParamaters.xml configuration file.
Load balancing
If your cluster is busy and have significant waiting times you can achieve a faster response by allowing the server machine to calculate small tasks and the reserve the cluster for bigger jobs. This works especially well if your server is a powerful machine with many CPUs. To do this you need to enable and configure both the cluster and the local engines. Once this is done decide on the maximum size of a task to be run on the server locally. Then, edit "# LocalEngineExecutionLimit #" preset in <ServiceName>Limits.xml file accordingly. JABAWS server then will balance the load according to the following rule: If the task size is smaller then the maximum task size for local engine, and the local engine has idle threads, then calculate task locally otherwise submit the task to the cluster.
Reviewing JABAWS configuration via web browser
Access to configuration files is prohibited to any unauthorized users by means of security constrain defined in web application descriptor file. There is a special user role called admin who can access these files. This comes handy if you would like to keep an eye on any of the task outputs stored in jobsout, or would like to view the configuration files. To access the configuration files add admin user into your application server. The way you do it depends on where you would like the user passwords to come from and your web application server. If you use Tomcat, then the simplest way is to use Tomcat Memory Realm which is linked to a plain text configuration file. To define the user in Tomcat server add an entry in conf/tomcat-user.xml file. <role rolename="admin"/>
<user username="admin" password="your password here " roles="admin"/>
Once this is done make sure the servlet that returns the web application directory listings is enabled. Look in the <tomcatroot>/conf/web.xml file for the following <param-name>listings</param-name>
<param-value>true</param-value>
The whole section that defines default listing servlet is below
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
These listings are read only by default.
Testing JABA Web Services
You can use a command line client (part of the client only package) to test your JABAWS installation as described here. If you downloaded a JABAWS server package, you can use <your_jaba_context_name>/WEB-INF/lib/jaba-client.jar to test JABAWS installation as described in here. If you downloaded the source code, then you could run a number of test suits defined in the build.xml Apache Ant file.
JABAWS requests logging
Enable Tomcat log valve. To do this uncomment the following section of <tomcat_root>/conf/server.xml configuration file.
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
The following information will be logged:
Remote IP | Date | Method server_URL protocol | HTTP status | Response size in bytes |
---|---|---|---|---|
10.31.11.159 | [10/Feb/2010:16:51:32 +0000] | "POST /jws2/MafftWS HTTP/1.1" | 200 | 2067 |
Which can be processed in various programs for log analysis , such as WebAlizer, Analog, AWStats.
JABAWS internal logging
JABAWS can be configured to log what it is doing. This comes handy if you would like to see who is using your web services or need to chase some problems. JABAWS uses log4j to do the logging, the example of log4j configuration is bundled with JABAWS war file. You will find it in the /WEB-INF/classes/log4j.properties file. All the lines in this file are commented out. The reason why the logging is disabled by default it simple, log4j have to know the exact location where the log files should be stored. This is not known up until the deployment time. To enable the logging you need to define logDir property in the log4j.properties and uncomment section of the file which corresponds to your need. More information is given in the log4j.properties file itself. Restart the Tomcat or the JABAWS web application to apply the settings.
After you have done this, assuming that you did not change the log4j.properties file yourself, you should see the application log file called activity.log. The amount of information logged can be adjusted using different logging levels, it is reduced in the following order of log levels TRACE, DEBUG, INFO, WARN, ERROR, FATAL.
If you would like to know who is using your services, you might want to enable Tomcat request logging.
Monitoring JABAWS
JABAWS stores cluster task ids for all tasks which were run on the cluster. Using cluster ids the detailed statistics can be extracted from cluster accounting system. Due to the fact that each cluster supported by JABAWS have different accounting system it was not possible to provide ready to use statistics.
For the local execution the starting and finishing time in nano seconds can be found in STARTED and FINISHED files respectively. In time we will provide the tools to extract execution time statistics, so keep the content of your working directory ready!
JABAWS War File Content
Directory | Content description |
---|---|
conf/ | contains configuration files such as Executable.properties, Engine.local.properties, Engine.cluster.properties |
conf/settings | Contains individual executable description files. In particular XXXParameters.xml, XXXPresets.xml, XXXLimits.xml where XXX is the name of the executable |
jobsout/ | Contains directories generated when running an individual executable. E.g. input and output files and some other task related data. (optional) |
binaries/ | Directory contains native executables - programs, windows binaries (optional) |
binaries/src | Contains source of native executables and Linux i386 binaries. |
binaries/matrices | Substitution matrices |
WEB-INF | Web application descriptor |
WEB-INF/lib | Web application libraries |
WEB-INF/classes | log4j.properties - log configuration file (optional) |
Help Pages | |
/ | help pages, index.html is the starting page |
dm_javadoc | javadoc for JABAWS client (the link is available from How To pages) |
prog_docs | documentation for programs that JABAWS uses |
images | images referenced by html pages |