[[TracNav(xQTL)]] = [wiki:xQTL xQTL workbench] - Installation and maintanance = xQTL can be installed, ran and updated on any machine that has Java installed. For safety, we recommend you perform these action as a regular UNIX user and not as root. === Installation === You will need: [http://ant.apache.org/ Ant], [http://git-scm.com/ Git], [http://www.java.com/ Java].[[BR]] [[BR]] Create a directory somewhere to work in, e.g. `/Users/johndoe/xqtl`, and `cd` to there. Run these commands:[[BR]] [[BR]] `git clone https://www.github.com/molgenis/molgenis.git`[[BR]] `git clone https://www.github.com/molgenis/molgenis_apps.git`[[BR]] `ant -f molgenis_apps/xqtl_dev.xml make_run`[[BR]] [[BR]] By the way, Ant can be made faster by giving it more memory. Use e.g. `export ANT_OPTS=-Xmx512m`[[BR]] The application is now running at: `http://localhost:8080/xqtl`[[BR]] Then login with user/pw: `admin` / `admin`[[BR]][[BR]] You are taken to the homepage, where a special prompt appears that allows you to setup the application with example users and data with one click.[[BR]]This prompt only appears if you are logged in as admin, and if the application contains no investigations or other users. This concludes setting up the application.[[BR]][[BR]]PLEASE NOTICE: For subsequent starts of the application, use:[[BR]] `ant -f molgenis_apps/xqtl_dev.xml`[[BR]][[BR]] To avoid regeneration and recompilation. It calls the default target '`run`'. Things you should do next are.. [[BR]] * Change the admin password[[BR]] * Load the example data/users. Or let users register themselves and put them in the group 'biologist' or 'bioinformatician'. You can even add users manually.[[BR]] * Install R so the ''Rplot'' plugin will work. And install the R packages to be able to run QTL mapping locally.[[BR]] * Run a default analysis to see that everything is setup correctly. === Updating === Consider creating an SH script to do the updating for you. For example, this script kills/starts the application on port 9000 and assumes you have used the above installation/checkour dirs:[[BR]] {{{#!html kill -9 `lsof -i :9000 -t`
cd ~/xqtl/molgenis
git pull origin master
cd ~/xqtl/molgenis_apps
git pull origin master
ant -f xqtl_dev.xml clean_make
nohup ant -f xqtl_dev.xml runOn -Dport=9000 &
}}} At the moment, `clean_make` will drop your entire database, so be careful! The alternative[[BR]] `ant -f xqtl_dev.xml recompile`[[BR]] Does a 'soft' update: it only updates the code and recompiles this without touching the database. However, some changes require regeneration and (implicitly) a fresh database because of potential datamodel changes. Some more script examples: http://gbic.target.rug.nl/forum/showthread.php?tid=592 === Development and deployment === ''Go into the application source for convenient access to the Ant scripts:''[[BR]] `cd molgenis_apps`[[BR]] '''Run the application on a specified port''', and only this port:[[BR]] `ant -f xqtl_dev.xml runOn -Dport=9000`[[BR]] '''Update the application''':[[BR]] `git pull origin master`[[BR]] Followed by at least recompilation. This is the 'fast but may fail' option.[[BR]] `ant -f xqtl_dev.xml recompile`[[BR]] For some updates you must remake the application, which includes MOLGENIS generation and recompilation. This is the 'safe but slow' option.[[BR]] `ant -f xqtl_dev.xml clean_make`[[BR]] You can '''run the data- and webtest''' yourself to find out if your version is stable:[[BR]] `ant -f xqtl_dev.xml test`[[BR]] `ant -f xqtl_selenium.xml webtest` (if this fails: try running as root due to permissions) You can '''remove all generated and compiled code''':[[BR]] `ant -f xqtl_dev.xml clean`[[BR]] Followed by e.g. a make:[[BR]] `ant -f xqtl_dev.xml make`[[BR]] And even delete the HSQL database:[[BR]] `ant -f xqtl_dev.xml deletedb`[[BR]] For '''further details''' you can consult the source of the various scripts: [https://github.com/joerivandervelde/molgenis_apps/blob/master/xqtl_dev.xml development], [https://github.com/joerivandervelde/molgenis_apps/blob/master/xqtl_selenium.xml webtesting], [https://github.com/joerivandervelde/molgenis_apps/blob/master/xqtl_jar.xml jarbuilding]. === Download source into development IDE (OSX, UNIX, Windows): === 1. Install the [http://www.eclipse.org Eclipse] IDE[[BR]] 2. Install [http://www.eclipse.org/egit/ EGit] for Eclipse[[BR]] 3. Install JBoss tools [http://download.jboss.org/jbosstools/updates/development/indigo/ Freemarker] for Eclipse[[BR]] 4. Add Git repositories https://www.github.com/molgenis/molgenis.git and https://www.github.com/molgenis/molgenis_apps.git [[BR]] 5. Clone/import the master branch of both repositories [[BR]] 6. Setup classpath by running '''update-eclipse''' in '''build_xgap.xml''' using Ant.[[BR]] 7. Now generate and compile by executing `apps/xgap/org/molgenis/xgap/xqtlworkbench/XqtlGenerate.java` or '''clean_make''' in '''xqtl_dev.xml'''.[[BR]] 8. Refresh and start the application with `modules/webserver/boot/RunStandalone.java` or '''run''' in '''xqtl_dev.xml'''. (the default target)