This document describes how to configure a computer running RedHat Linux to work on the development of the ModelDesigner platform.
This document is intended to be read by developpers working in the Symbiose team at IRISA, Rennes.
To work on the development of the Model Designer platform, the following libraries/softwares are required:
Ant 1.5.x, from the Apache Software Foundation,
Java 2 Software Development Kit - Standard Edition (J2SE), from Sun Microsystems.
Eclipse 3.x, from the Eclipse Foundation.
Concurrent Versions System (CVS), from Cyclic software.
Tomcat 5.5, from the Apache Software Foundation,
In addition, if you have to update the ModelDesigner documentation (such as this manual), you need DocBook.
ModelDesigner development process uses release 1.5.4 of Apache Ant.
Change directory to /local:
nuon% cd /localRetrieve the Ant archive and deploy it in /local:
nuon% cp /udd/belleann/Bio/ModelDesigner/install/apache-ant-1.5.4.tar.gz . nuon% gunzip apache-ant-1.5.4.tar.gz nuon% tar xf apache-ant-1.5.4.tar nuon% rm -f apache-ant-1.5.4.tar
ModelDesigner development process uses J2SDK 1.4.2_05.
Change directory to /local:
nuon% cd /localRetrieve the J2SDK archive and deploy it in /local:
nuon% cp /udd/belleann/Bio/archivage/ModelDesigner/install/j2sdk1.4.2_05.tar.gz . nuon% gunzip j2sdk1.4.2_05.tar.gz nuon% tar xf j2sdk1.4.2_05.tar nuon% rm j2sdk1.4.2_05.tar
Eclipse is already installed on your computer. You can check the installation by starting Eclipse manually:
nuon% /soft/jeclipse_hd/Linux/eclipse3.0.1/eclipse -data /udd/$USER/workspace -vm /local/j2sdk1.4.2_05/bin/java
CVS is already installed on your computer. You can check the installation by starting CVS manually:
nuon% cvsYou should see the cvs help message on the terminal window.
Note: the ModelDesigner project is located on the INRIA GForge server scm.gforge.inria.fr.
Do not proceed to this installation now.
Installation of Tomcat is explained in the section related to the deployment of the Model Designer Server application (Model Designer Tomcat Server).
Do not worry about the installation of DocBook: at INRIA, the Linux based computers are shipped with DocBook. To be sure, you can try to execute the following DocBook tool:
nuon% docbook2htmlAs a result, you should see an help message.
Using your favorite text editor, open the file '.cshrc_perso' located in your home directory. In this file does not exist, create one. In the file, add the following lines:
#Java setenv JDK_HOME /local/j2sdk1.4.2_05 set path=($JDK_HOME/bin $path) setenv JAVA_HOME $JDK_HOME # Ant setenv ANT_HOME /local/apache-ant-1.5.4 set path=( $path $ANT_HOME/bin ) #CVS setenv CVS_RSH /usr/bin/ssh
Then, execute the following command to 'install' the environment variables:
nuon% source ~/.cshrc_perso
In order to use the CVS server scm.gforge.inria.fr from Eclipse, you have to use the ssh public/private keys authentication system. For that purpose, you need to generate the public/private keys on your computer. If you already use that CVS server from Eclipse with another development project, you can skip the following procedure.
Go in the directory '.ssh' located in your home directory :
nuon% cd /udd/$USER/.ssh
Generate the public/private keys:
nuon% ssh-keygen -t rsa
and follow the instruction on the screen.
Register your private key to the ssh authentication system
nuon% ssh-add id_rsa
Note: you have to register that key EACH time you log into your computer
and BEFORE you start Eclipse. If you fail to do so, CVS connections won't
work from Eclipse.
Go to the INRIA GForge web site to add your ssh public key. To do so, log in on the GForge, then select the ModelDesigner project. The project page contains several tabs, one of them is 'SCM'. Click on this tab, then follow the instructions on the 'SCM' page to upload your public ssh key on the GForge cvs server.
Start Eclipse as follows:
nuon% /soft/jeclipse_hd/Linux/eclipse3.0.1/eclipse -data /udd/$USER/workspace -vm /local/j2sdk1.4.2_05/bin/javaThat command line is quite long, so you can put it in a shell script file for easy reusability. Why this command is so long ? Simply because you have to specify your Eclipse workspace (the directory where Eclipse saves your configuration) and the Java Virtual Machine to use.
As soon as Eclipse is started, open the CVS perspective by choosing ->-> in the menu bar. A dialog box opens where you can select the CVS perspective. Eclipse displays on the left of its window a frame entitled 'CVS repositories'. Right click on the middle of that frame, then select -> in the pulldown menu. Eclipse opens a dialog box, where you can enter the following values:
Host: enter the value scm.gforge.inria.fr
Repository path: enter the value /cvsroot/mdesigner
User: enter you login name
Password: does not enter anything
Connection type: select the value ext. Check on 'Use Default Port' and check off 'Use Port', 'Validate Connection on Finish' and 'Save Password'.
That is all for the moment, we see later on how to use the repository to get the source code of Model Designer.
Model Designer is a Client-Server application allowing to scan biological sequence databases using theoretical models written with a String Variable Grammar (SVG) based language. The Client application allows the user to do the job of designing graphically SVG based models, while the Server application is responsible for searching such models in the databases.
The Client application is a 100% pure Java 1.4.2 software, while the server consists in a set of Servlets (a Java-based technology) working together with a dedicated Prolog software.
Installing the development release of Model Designer requires to install the source code of the application as well as the server.
Model Designer client/server source code is distributed within several libraries, or modules (more details on modules are given in the section Model Designer modules). When working on the Model Designer source code, you have to install on your computer a local copy of some of these modules. This is done using the CVS server, as explained below (Getting a module from CVS). For the complete system to work, you also need to install the Model Designer Server.
The Model Designer Tomcat server (hereafter called MDServer), is responsible for executing services invoked by the Model Designer client. Two types of services are handled by MDServer: query execution (i.e. execution of an SVG- based model against a sequence database), and database upload (i.e. a client sends to the server a new database).
The entire MDServer is written using a particular Java technology known as Servlet. This technology enables the creation of distributed application using the state of the art Web protocol: HTTP. Since MDServer itself is just a Servlet application that has to work in association with an HTTP server, it requires a Servlet engine. The standard Java Virtual Machine is used to execute a Java application on a desktop, so it is for Servlet: a Java Application Server is required to execute a Servlet-based application. To run the MDServer, we use Tomcat, the Servlet engine freely provided by the Apache Software Foundation.
The Model Designer server has the following directory structure:
<ServerHomeDir>
|
|- databases
|- prolog
|- tmp
|- tomcat
Directory ServerHomeDir is the location of the Model Designer Server application. As explained in the next section, that directory should refer to /local/mdesigner_devel.
Directory databases contains some databases that can be used to test the whole client/server system. It is the content of this directory that is used to create the list of available databases sent to the client when a user start a query submission to the server.
Directory prolog contains the Prolog programs that form the search engine of Model Designer Server application. This directory also contains the Unix shell script allowing to start the Prolog servers.
Directory tmp contains queries and databases sent by the client to the server.
Directory tomcat contains the ready-to-run Tomcat server along with the compiled Model Designer servlets.
To install the Model Designer server (hereafter called MDServer), do the following:
Go in the directory /local :
nuon% cd /local
Create the MDServer directory, and go into that directory:
nuon% mkdir mdesigner_devel
nuon% cd mdesigner_devel
Retrieve the MDServer archive from the CVS server:
nuon% cvs -d :ext:$USER@scm.gforge.inria.fr:/cvsroot/mdesigner checkout devel_appserver_bundle
Note: CVS may return a 'checkout aborted' error. Do not worry about that,
the archive should be ok.
Deploy the MDServer:
nuon% mv devel_appserver_bundle/mdserver.tar.gz .
nuon% rm -rf devel_appserver_bundle/
nuon% gunzip mdserver.tar.gz
nuon% tar xf mdserver.tar
nuon% rm -f mdserver.tar
You have now install in the /local directory of your computer the directory structure (along with some files) required by the ModelDesigner server. Chapter Working with Model Designer will explain how to deploy, start and stop the server itself (i.e., the set of servlets).
Model Designer source code is distributed within three modules:
appserver: the source code of MDServer,
core: the source code of the core of Model Designer client/server application.
gui: the source code of the Graphical User Interface of Model Designer client application.
To work on these modules, you have to get a copy from the CVS server. The following sections explain how to do so.
Each Model Designer development module has a particular directory structure:
<Module>
|
|- conf
|- jar
|- lib
|- scripts
|- src
Directory conf contains configuration files needed by the module.
Directory doc contains the compiled Javadoc of the module.
Directory jar contains librairies needed to compile/run the module.
Directory lib contains compiled source files (.class).
Directory scripts contains Ant scripts to manage a module from the command-line.
Directory src contains the Java source files of the module (.java) along with some Javadoc source files (.html).
In addition to those directories, the appserver module also has a directory named logol containing some Prolog source files needed by the Model Designer server.
For each module, all but the doc and lib directories are stored in the CVS repository. Directories doc and lib are automatically created while working on a module. It is strictly forbidden to commit them in the CVS repository.
Each module comes with some Ant scripts that can be used to handle the development process of a module from the command-line. To be used, those scripts have to be copied from the scripts directory to the module directory.
The organization of the doc module is described in the README file located in the root directory of that module. This file is available as soon as you check out the doc module from CVS.
There are two non compatible ways to manage the development process of the Model Designer platform using CVS:
using the command-line CVS client application,
using Eclipse.
Depending on your choice, there is no way back: if you choose to work using CVS on the command-line, you CAN NOT use the CVS embedded in Eclipse at the same time.
Getting a Model Designer development module from the CVS repository means that you will have a complete copy of the development files in your home directory. For that purpose, you need to prepare the following directory structure:
/udd/$USER
|
-- ModelDesigner
|
-- devel
|
|- appserver
|- core
-- gui
Starting from your home directory, you thus have to create a directory that will be called the Model Designer development home directory. Here that directory is ModelDesigner (in this example, that directory is directly under your home dir, but you can put the Model Designer development home directory anywhere else). In that directory, you have to create the devel directory, and then there you create the module directories: appserver, core and gui. Note that if you are going to only work on a unique module, you just have to create the directory for that module.
The directory structure is now prepared to receive the Model Designer source code modules from the CVS repository.
If you plan to work on the ModelDesigner documentation (for example, if you plan to update this manual), you need to add a doc directory under the ModelDesigner one, as follows:
/udd/$USER
|
-- ModelDesigner
|
-- devel
| |
| ...
|
-- doc
Here is the procedure to get a Model Designer development module using CVS on the command-line. The module names that have to be passed to CVS are as follows: devel_core, devel_gui, devel_appserver (these are the three source code modules) and doc.
Depending on the module you want to check out from the CVS repository, you first have to go in the corresponding directory. For the purpose of this document, we suppose that you want to get the gui module (it contains the ModelDesigner client application). Here is the procedure:
Register your ssh private key, so that CVS won't ask anymore for a password :
nuon% ssh-add /udd/$USER/.ssh/id_rsa
Go into the Model Designer development home directory:
nuon% cd /udd/$USER/ModelDesigner/devel
Check out the module gui:
nuon% cvs -d :ext:$USER@scm.gforge.inria.fr:/cvsroot/mdesigner checkout -d gui devel_gui
Change directory to gui, then copy the Ant scripts from the scripts directory into the current directory of the gui module:
nuon% cd gui
nuon% cp ./scripts/* .
(do not pay attention if cp complains about copying CVS directory)
start the compilation:
nuon% ant comp
You are done, the ModelDesigner client application is ready to be used !
A similar procedure can be used to get the ModelDesigner documentation module, doc. Here is the procedure:
Only if it is not already done, register your ssh private key, so that CVS won't ask anymore for a password :
nuon% ssh-add /udd/$USER/.ssh/id_rsa
Go into the Model Designer doc home directory:
nuon% cd /udd/$USER/ModelDesigner/doc
Check out the module doc:
nuon% cvs -d :ext:$USER@scm.gforge.inria.fr:/cvsroot/mdesigner checkout -d doc doc
Open the ./doc/README file to get more information about the ModelDesigner documentaion managament.
Here is the procedure to get a Model Designer development module using Eclipse.
Register your ssh private key, then start Eclipse :
nuon% ssh-add /udd/$USER/.ssh/id_rsa
nuon% /soft/jeclipse_hd/Linux/eclipse3.0.1/eclipse -data /udd/$USER/workspace -vm /local/j2sdk1.4.2_05/bin/java
Switch to the CVS perspective and locate the ModelDesigner repository, which should appear as :ext:$USER@scm.gforge.inria.fr:/cvsroot/mdesigner. If you cannot see the ModelDesigner repository, try to reconfigure Eclipse to target the CVS server by using extssh instead of ext. To do that, go back to section Configuring Eclipse to use CVS and, for Connection Type, select extssh instead of ext.
Unroll the :ext:$USER@scm.gforge.inria.fr:/cvsroot/mdesigner branch.
Unroll the Head branch, then select one of the Model Designer development modules (appserver, core or gui).
Right-click on the module you need, then select the command to open the Checkout As dialog box.
In that dialog box, select Check out as a project configured using the New Project wizard, then click on the [Next] button to switch to the Select Tag dialog box.
In that dialog box, be sure that Head tag is selected, then click on the [Finish] button.
Eclipse automatically starts the New Project Wizard. There, you select Java Project, then click on the [Next] button to switch to the New Java Project dialog box.
In that dialog box, you start by entering a project name. That name should be formatted as ModelDesigner_devel_xxx where xxx is the module name (appserver, core or gui). Then, you select Create project at external location and click on the [Browse button] to open the Browse directory dialog box.
In that dialog box, go within one of the directory you created above to store you local copy of the Model Designer development modules (for exemple, if you are in the process to check out the core module, go in the directory /udd/$USER/ModelDesigner/devel/core). Click on the [Ok] button to go back to the New Java Project dialog box, and click on the [Finish] button.
Eclipse displays a dialog box to ask you to switch to the Java perspective. Click the [Ok] button. Eclipse then starts to check your module out from the CVS repository. After that, Eclipse starts an automatic build of the project... which should fail, because Eclipse is not yet configured to do such a build.
Locate your project in the Java perspective, right-click on it and select the command to open the Properties dialog box.
In that dialog box, select Java build path on the left pane of the Properties dialog box to display, on the right pane, the Java properties of your project.
Select the Source tab in the the right pane. There are two parts in that tab. Source folders on build path on the top, and Default output folder on the bottom.
Configuring the source folders to compile
Click on the [Add Folder...] button to open a dialog box where you can check the src directory (it contains all the Java sources of the Model Designer module you are going to work on). Click on the [Ok] button to close that dialog box.
Configuring the default output folder
Click on the [Browse...] button to open the Folder selection dialog box. Select the project itself, then click on the [Create new folder button]. Using the newly opened dialog box, enter the name lib in the appropriate field. Close that dialog box, then close the Folder selection dialog box.
Select the Librairies tab in the the right pane of the Properties dialog box. Click on the [Add JARs...] button to open a dialog box listing all your Eclipse projects. Locate the current project you are configuring right now, and unroll it. Unroll the jar directory which contains all the libraries needed to compile the project. Select all of them, then close the dialog box.
Now, you can close the Properties dialog box by clicking on its [Ok] button. Eclipse displays a dialog box to inform you that something changed in the configuration of your project. Click on [ok] to let Eclipse proceed further to recompile the entire project... without any errors.
You are done!
The client application of Model Designer is spreaded across the two modules core and gui. The core module contains the low level librairies of Model Designer which mainly consists in the modelling system and their associated graphical interfaces. The gui module contains high level graphical user interfaces of the Model Designer client application.
The gui module is currently the only one that contains the code to start a standalone application, namely the Model Designer client application. More precisely, the class model.designer.ui.MDesigner contains the main() method, i.e. the starter code of the whole application. For that reason, we begin to explain how to work on Model Designer GUI, and how to start it.
The following section supposed that you checked the gui module out from the CVS repository. If it is not the case, please refer to the section Getting a module from CVS. There are two ways to start the Model Designer GUI: from the command-line and from Eclipse.
Go into the Model Designer GUI development directory:
nuon% cd /udd/$USER/ModelDesigner/devel/gui
According to your configuration, that directory has to be adjusted: it has to point to the directory containing the gui module of Model Designer. Refer to the section Getting a module from CVS for more information on the directory structure of the development release of Model Designer.
If it is not yet done, copy the Ant scripts from the scripts directory into the current directory of the gui module:
nuon% cp ./scripts/* .
(do not pay attention if cp complains about copying CVS directory)
start the client:
nuon% ant run
You are done ! However, you just have started the client... and you do not have any access to the Model Designer server. We shall explain how to do that later on.
While being in the Java perspective, select -> to show the Run dialog box.
Click on the [New] button located on the bottom left corner of that dialog box. Eclipse creates a new Configuration and it selects it in the list located above the [New] button. On the right of that list, you can see a tabbed panel that allows you to configure your application so that it can be started from Eclipse.
Switch your attention to that right panel. Give a name to your application: MDesigner. Then, proceed to the Main tab located just below the application name.
Click on the [Browse] button located on the right of the Project: field. In the newly displayed dialog box, select the ModelDesigner_devel_gui project, then close the dialog box.
Click on the [Search...] button located on the right of the Main class: field. In the newly displayed dialog box, select the MDesigner class, then close the dialog box.
Select the Arguments tab.
Enter the following values in the field entitled VM Arguments:
-Xmx256M -Xms256M -Dmodeler.devel=true -Dmodeler.home=/udd/$USER/ModelDesigner/devel/gui
According to your configuration, the value associated to modeler.home has to be adjusted: it has to point to the directory containing the gui module of Model Designer. Refer to the section Getting a module from CVS for more information on the directory structure of the development release of Model Designer.
Click on the [Apply] button (located at the bottom right corner of the Run dialog box) to save that configuration.
Click on the [Run] button (located at the bottom right corner of the Run dialog box) to start Model Designer (client only).
This procedure has to be done only once. To start again Model Designer (client only), just go to the menu, then select MDesigner.
The first time you start Model Designer client application, it has to create a particular directory structure (see Model Designer Client directory structure) and it needs you your email address (used by the Model Designer server to send you an email notifying that a query is done). At the end of this procedure, Model Designer stops.
The first time the client application of Model Designer is started, a particular directory structure is created in your home directory:
/udd/$USER
|
-- .mdesigner_devel
|
|- conf
|- databases
|- models
|- queries
Directory conf contains configuration files needed by the client.
Directory databases contains the list of databases uploaded by you (while using the client application) onto the Model Designer server.
Directory models contains examples of SVG-based models.
Directory queries contains the list of queries sent by you (while using the client application) to the Model Designer server.
Directory .mdesigner_devel itself contains log files created by the Model Designer client application during its execution. Those log files may be usefull to track bugs.
Before trying to start the Model Designer server (hereafter called MDServer), you have to install it, as explained in the section Model Designer Tomcat Server.
Here is the procedure to start MDServer from the command-line (this cannot be done from Eclipse):
Go into the Model Designer GUI development directory:
nuon% cd /udd/$USER/ModelDesigner/devel/gui
According to your configuration, that directory has to be adjusted: it has to point to the directory containing the gui module of Model Designer. Refer to the section Getting a module from CVS for more information on the directory structure of the development release of Model Designer.
If it is not yet done, copy the Ant scripts from the scripts directory into the current directory of the gui module:
nuon% cp ./scripts/* .
(do not pay attention if cp complains about copying CVS directory)
start the Prolog servers:
nuon% ant prolog &
This has to be done only ONCE: as soon as the Prolog servers are started, they will be up and running until either you kill them or you restart you computer. To check if the Prolog servers are running, use the following command:
nuon% ps -ef | grep prolog
If you cannot see any Prolog servers running, then you should start them.
start the MDServer:
nuon% ant start &
Again, this has to be done only ONCE: as soon as the MDServer is started, it will be up and running until either you stop it or you restart you computer. To check if the MDserver is running, use the following command:
nuon% ps -ef | grep tomcat
To check if the MDServer is up and running, switch to your web browser, and try the following URL:
http://localhost:8090/mdserver/version
This URL invokes MDServer and displays its current status. Another way to test MDServer consists in using the Model Designer client!
You have to be aware that using the MDServer means that some network ports on your computer are opened to the IRISA internal network. There is no real security problems here, but keep in mind that ports 8090 (opened by Tomcat, i.e. the Java Application Server running MDServer) and 760X (opened by several Prolog servers running in parallel; X ranges from, and including, 0 to 9) are opened. Now, if you prefer to close those ports when not using Model Designer, you have to shut the server down.
Go into the Model Designer GUI development directory:
nuon% cd /udd/$USER/ModelDesigner/devel/gui
stop the MDserver:
nuon% ant stop
to stop the Prolog servers, you have to kill them manually:
nuon% ps -ef | grep prolog
As an example, you should see on the terminal window something like that:
pdurand 7097 5048 0 16:57 pts/2 00:00:00
/bin/sh /local/apache-ant-1.5.4/bin/ant prolog
pdurand 7111 1 2 16:57 pts/2 00:00:00
/soft/sicstus/bin/sicstus -l /local/mdesigner_devel/prolog/mdserver.pl
--goal main(7600,'127.0.0.1').
pdurand 7112 1 2 16:57 pts/2 00:00:00
/soft/sicstus/bin/sicstus -l /local/mdesigner_devel/prolog/mdserver.pl
--goal main(7601,'127.0.0.1').
The line ant prolog refers the ant command used to start the Prolog servers, while the two other lines refer to two Prolog servers. You have to kill them all:
nuon% kill 7097
nuon% kill 7111
nuon% kill 7112
Before proceeding further in this section, be sure you have installed the entire Model Designer client-server application and that the server is started.
To test the whole system, you just need to send a query to the server. Proceed as follows:
Start the Model Designer client as explained in section Starting the GUI. When the GUI starts, select 'Protein' as the sequence type.
Select the command ->. In the 'Open' dialog box, enter in the directory models/protein, then open the model called 'mip_motif1.mdx'.
Select the command ->. In the 'Databases' dialog box, select the Aquaporines database (it is a small db with only 36 sequences, which is enough for testing purpose). Click on the button [Ok] to send the query to the server. Model Designer display a dialog box containing the ID of your query.
Note: if you get an error when selecting command ->, it means that the server is not started or not well-configured. In such a case, please check your Model Designer server installation.
Select the command -> to display the dialog box where you can see the execution status of your query. As soon as the status is 'done' (refresh the content of the dialog box by using the [Refresh] button), click on the [Fetch] button to retrieve the results. Model Designer will then display the results of your query in the Model Analyser module.
As soon as you have made some update in the documentation, source code, scripts, configuration files of ModelDesigner, commit you changes using CVS. Of course, do these commits only after valid testing of the changes!
The core module is used by gui and appserver. So, you have to create a Java archive file containing the core module. Here is the procedure to create the core library:
Go into the core directory:
nuon% cd /udd/$USER/ModelDesigner/devel/core
make the library (it'll be placed in the /udd/$USER/ModelDesigner/devel/core/distrib directory):
nuon% ant distrib
Now, you have to manually copy the freshly created core library to the jar directory of gui and appserver modules (and do not forget to commit the new library).
The appserver module is used by gui. So, you have to create a Java archive file containing the appserver module. Here is the procedure to create the appserver library:
Go into the appserver directory:
nuon% cd /udd/$USER/ModelDesigner/devel/appserver
make the library (it'll be placed in the /udd/$USER/ModelDesigner/devel/appserver/distrib directory):
nuon% ant distrib
Now, you have to manually copy the freshly created appserver library to the jar directory of gui module (and do not forget to commit the new library).