diff options
author | rautenberg <rautenberg@in-silico.ch> | 2012-03-13 12:13:23 +0100 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2012-03-13 12:13:23 +0100 |
commit | 65b517dd4494d730bf5602bd070a59d0044efe5b (patch) | |
tree | 7443c67b2813a9f04483ba8c59f0fd8c2a798923 | |
parent | fe3e3f88762df7cc57df76fe4d2a10602a3daa73 (diff) | |
parent | 803ae809cc5092e082ee527dac6eb25c1a63dcf3 (diff) |
Merge branch 'release/v3.1.0'v3.1.0
-rw-r--r-- | README | 86 | ||||
-rw-r--r-- | aa-local.yaml | 32 | ||||
-rw-r--r-- | aa-server.yaml | 32 | ||||
-rw-r--r-- | ambit_descriptors.yaml | 124 | ||||
-rw-r--r-- | base-install.sh | 4 | ||||
-rwxr-xr-x | config.sh | 15 | ||||
-rwxr-xr-x | install | 32 | ||||
-rwxr-xr-x | kernlab.sh | 33 | ||||
-rw-r--r-- | nginx.conf | 3 | ||||
-rwxr-xr-x | nginx.sh | 10 | ||||
-rwxr-xr-x | openbabel.sh | 32 | ||||
-rwxr-xr-x | opentox-ruby.sh | 10 | ||||
-rwxr-xr-x | opentox-webservices.sh | 16 | ||||
-rw-r--r-- | ot-tools-root.sh | 82 | ||||
-rw-r--r-- | ot-tools-user.sh | 83 | ||||
-rw-r--r-- | packs.R | 6 | ||||
-rw-r--r-- | production.yaml | 16 | ||||
-rwxr-xr-x | redis.sh | 7 | ||||
-rwxr-xr-x | ruby.sh | 8 | ||||
-rwxr-xr-x | update | 16 |
20 files changed, 447 insertions, 200 deletions
@@ -13,92 +13,18 @@ Here are some of my goals when writing the installer: - Encapsulated (everything is installed in a sub-directory in $HOME) - Logged (all non-elemtary actions are logged) -Even if we officially support only *one* distro (currently Debian 6.0.1), I tested the installer successfully on various Ubuntus. In the README at the top are the requirements of the installer. By default, everything is installed to $HOME/opentox-ruby (=OT_PREFIX). The configs go to OT_PREFIX/.sh_<Package>_ot.sh for each package. + +Configure your system in config.sh. NOTE for variable NGINX_PORT: leave this empty or set to ":80" to use port 80. If you do this, use the ot-scripts in "ot-tools-root.sh". Otherwise, if NGINX_PORT >1024, use ot-scripts in "ot-tools-user.sh". + +Even if we officially support only *one* distro (currently Debian 6.0.1), I tested the installer successfully on various Ubuntus. In this README at the top are the requirements of the installer. By default, everything is installed to $HOME/opentox-ruby (=OT_PREFIX). The configs go to OT_PREFIX/.sh_<Package>_ot.sh for each package. After running the installer, configure the system by editing the startup file of your favorite shell (in my case, BASH with the file ~ /. bashrc) to include ~/.opentox-ui.sh (in my case with 'source ...'). This file is the only one that the installer creates outside OT_PREFIX. Thus, the system is fully configured: If you now open a new shell, all environment variables will be adjusted. To start the system I run the following (but that is not part of the installer): -sudo nohup $HOME/opentox-ruby/redis-2.2.2/src/redis-server $HOME/opentox-ruby/redis-2.2.2/redis.conf & -sudo nohup $HOME/opentox-ruby/nginx/sbin/nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf & +nohup $HOME/opentox-ruby/redis-2.2.2/src/redis-server $HOME/opentox-ruby/redis-2.2.2/redis.conf & +nohup $HOME/opentox-ruby/nginx/sbin/nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf & To uninstall the system simply delete the link from the startup file: Done. To save disc space delete directory OT_PREFIX. Anyone can run multiple Opentox versions on the same machine: Just install again, but to a different OT_PREFIX. The switch works manually: Include the sh_<Package>_ot.sh files from the desired OT_PREFIX in $HOME/opentox-ui.sh (only one installation may be activated at any time). -Some useful scripts to put in your ~/.bashrc in case you are using bash (assuming OT_PREFIX is '~/opentox-ruby'): - -# Load server config -otconfig() { - source $HOME/.opentox-ui.sh -} - -# Update the development version -otupdate() { - START_DIR=`pwd` - otconfig - cd $HOME/opentox-ruby/www/opentox - for d in `find -not -name "." -type d -maxdepth 1 2>/dev/null`; do echo $d ; cd $d ; git pull ; echo ; cd - ; done - cd $HOME/opentox-ruby/www/opentox/algorithm/libfminer - mv libbbrc/Makefile libbbrc/Makefile~ - mv liblast/Makefile liblast/Makefile~ - if ! git pull; then - echo "Error! Pull for Fminer failed." - return 1 - fi - mv libbbrc/Makefile~ libbbrc/Makefile - mv liblast/Makefile~ liblast/Makefile - make -C libbbrc/ clean - make -C libbbrc/ ruby - make -C liblast/ clean - make -C liblast/ ruby - cd - - cd $HOME/opentox-ruby/www/opentox/algorithm/last-utils - if ! git pull; then - echo "Error! Pull for Last-Utils failed." - return 1 - fi - cd - - cd opentox-ruby - LINK_DIR=`gem which opentox-ruby | sed 's/\/opentox-ruby.rb//'` - if [ -h $LINK_DIR ]; then - rm -f $LINK_DIR - fi - rake install - if ! [ -h $LINK_DIR ]; then - echo "Warning! Your lib $LINK_DIR is no symlink. Linking back for you..." - rm -rf "$LINK_DIR~" - mv "$LINK_DIR" "$LINK_DIR~" - ln -sf $HOME/opentox-ruby/www/opentox/opentox-ruby/lib `echo ${LINK_DIR::${#LINK_DIR}-4}` - fi - echo "Please execute 'otstart' to restart." - cd "$START_DIR" -} - -# Start the server -otstart() { - otkill - sudo bash -c "source $HOME/.opentox-ui.sh; nohup redis-server $HOME/opentox-ruby/redis-2.2.2/redis.conf >/dev/null 2>&1 &" - sudo bash -c "source $HOME/.opentox-ui.sh; nohup nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 &" - sleep 2 - if ! pgrep nginx>/dev/null 2>&1; then echo "Failed to start nginx."; fi - if ! pgrep redis-server>/dev/null 2>&1; then echo "Failed to start redis."; fi -} - -# Display log -alias otless='less $HOME/.opentox/log/production.log' - -# Tail log -alias ottail='tail -f $HOME/.opentox/log/production.log' - -# Reload the server -otreload() { - sudo bash -c "source $HOME/.opentox-ui.sh; nginx -s reload" -} -# Kill the server -otkill() { - sudo killall nginx >/dev/null 2>&1 - sudo bash -c "source $HOME/.opentox-ui.sh; redis-cli shutdown >/dev/null 2>&1" - while ps ax | grep PassengerWatchdog | grep -v grep >/dev/null 2>&1; do sleep 1; done - while ps ax | grep Rack | grep -v grep >/dev/null 2>&1; do sleep 1; done - for p in `pgrep R 2>/dev/null`; do sudo kill -9 $p; done -} diff --git a/aa-local.yaml b/aa-local.yaml index fe86a2e..ee75705 100644 --- a/aa-local.yaml +++ b/aa-local.yaml @@ -14,25 +14,27 @@ # Exceptions: :free_uris: #request-method for uri not controlled by A&A ? - :GET - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - - "http://SERVERNAME/model" - - "http://SERVERNAME/dataset" - - "http://SERVERNAME/validation" - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/resources/ - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/algorithm/ + - "http://SERVERNAMENGINX_PORT/model" + - "http://SERVERNAMENGINX_PORT/dataset" + - "http://SERVERNAMENGINX_PORT/validation" + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/validation\/resources/ + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/validation\/[a-z,A-Z,\/,_\-]*$/ ? - :GET - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate\/[a-z,A-Z,\/,_\-]*$/ - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/toxcreate\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/task/ + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/compound/ - !ruby/regexp /sign_(in|out)$/ ? - :PUT - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/task/ + ? - :DELETE + : - "http://SERVERNAMENGINX_PORT/task/cleanup" :authorize_exceptions: #request-method for uri only authenticated, no authorization ? - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - - "http://SERVERNAME/dataset" - - "http://SERVERNAME/model" - - "http://SERVERNAME/validation" - - !ruby/regexp /http\:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/algorithm/ + - "http://SERVERNAMENGINX_PORT/dataset" + - "http://SERVERNAMENGINX_PORT/model" + - "http://SERVERNAMENGINX_PORT/validation" + - !ruby/regexp /http\:\/\/ESCAPEDSERVERNGINX_PORT\/validation\/[a-z,A-Z,\/,_\-]*$/ diff --git a/aa-server.yaml b/aa-server.yaml index fe86a2e..ee75705 100644 --- a/aa-server.yaml +++ b/aa-server.yaml @@ -14,25 +14,27 @@ # Exceptions: :free_uris: #request-method for uri not controlled by A&A ? - :GET - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - - "http://SERVERNAME/model" - - "http://SERVERNAME/dataset" - - "http://SERVERNAME/validation" - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/resources/ - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/algorithm/ + - "http://SERVERNAMENGINX_PORT/model" + - "http://SERVERNAMENGINX_PORT/dataset" + - "http://SERVERNAMENGINX_PORT/validation" + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/validation\/resources/ + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/validation\/[a-z,A-Z,\/,_\-]*$/ ? - :GET - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate\/[a-z,A-Z,\/,_\-]*$/ - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ - - !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/toxcreate\/[a-z,A-Z,\/,_\-]*$/ + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/task/ + - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/compound/ - !ruby/regexp /sign_(in|out)$/ ? - :PUT - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/task/ + ? - :DELETE + : - "http://SERVERNAMENGINX_PORT/task/cleanup" :authorize_exceptions: #request-method for uri only authenticated, no authorization ? - :POST - : - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/ - - "http://SERVERNAME/dataset" - - "http://SERVERNAME/model" - - "http://SERVERNAME/validation" - - !ruby/regexp /http\:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/ + : - !ruby/regexp /http:\/\/ESCAPEDSERVERNGINX_PORT\/algorithm/ + - "http://SERVERNAMENGINX_PORT/dataset" + - "http://SERVERNAMENGINX_PORT/model" + - "http://SERVERNAMENGINX_PORT/validation" + - !ruby/regexp /http\:\/\/ESCAPEDSERVERNGINX_PORT\/validation\/[a-z,A-Z,\/,_\-]*$/ diff --git a/ambit_descriptors.yaml b/ambit_descriptors.yaml new file mode 100644 index 0000000..1e2c347 --- /dev/null +++ b/ambit_descriptors.yaml @@ -0,0 +1,124 @@ +--- +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.LengthOverBreadthDescriptor: + :category: "geometrical" + :name: "Length Over Breadth" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.KierHallSmartsDescriptor: + :category: "topological" + :name: "Kier & Hall SMARTS" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.FragmentComplexityDescriptor: + :category: "topological" + :name: "Fragment Complexity" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.APolDescriptor: + :category: "electronic" + :name: "Atomic Polarizabilities" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.LargestChainDescriptor: + :category: "constitutional" + :name: "Largest Chain" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ChiPathDescriptor: + :category: "topological" + :name: "Chi Path Indices" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.PetitjeanNumberDescriptor: + :category: "topological" + :name: "Petitjean Number" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.LongestAliphaticChainDescriptor: + :category: "constitutional" + :name: "Longest Aliphatic Chain" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.KappaShapeIndicesDescriptor: + :category: "topological" + :name: "Kier and Hall kappa molecular shape indices" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.AromaticBondsCountDescriptor: + :category: "constitutional" + :name: "Aromatic Bonds Count" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.CPSADescriptor: + :category: "cpsa" + :name: "Charged Partial Surface Areas" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.VAdjMaDescriptor: + :category: "topological" + :name: "Vertex adjacency information magnitude" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.AutocorrelationDescriptorMass: + :category: "topological" + :name: "Moreau-Broto Autocorrelation (mass) descriptors" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.RuleOfFiveDescriptor: + :category: "constitutional" + :name: "Lipinski's Rule of Five" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.GravitationalIndexDescriptor: + :category: "geometrical" + :name: "Gravitational Index" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.WienerNumbersDescriptor: + :category: "topological" + :name: "Wiener Numbers" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ChiPathClusterDescriptor: + :category: "topological" + :name: "Chi Path-Cluster Indices" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.AtomCountDescriptor: + :category: "constitutional" + :name: "Atoms Count" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.MomentOfInertiaDescriptor: + :category: "geometrical" + :name: "Moments of Inertia" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.CarbonTypesDescriptor: + :category: "topological" + :name: "Carbon Types" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.AutocorrelationDescriptorPolarizability: + :category: "topological" + :name: "Moreau-Broto Autocorrelation (polarizability) descriptors" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.EccentricConnectivityIndexDescriptor: + :category: "topological" + :name: "Eccentric Connectivity Index" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.BCUTDescriptor: + :category: "hybrid" + :name: "BCUT" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.AromaticAtomsCountDescriptor: + :category: "constitutional" + :name: "Aromatic Atoms Count" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.WHIMDescriptor: + :category: "hybrid" + :name: "WHIM" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ALOGPDescriptor: + :category: "constitutional" + :name: "ALogP" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptor: + :category: "constitutional" + :name: "XLogP" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.PetitjeanShapeIndexDescriptor: + :category: "topological" + :name: "Petitjean Number" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.MDEDescriptor: + :category: "topological" + :name: "Molecular Distance Edge" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ChiChainDescriptor: + :category: "topological" + :name: "Chi Chain Indices" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.BondCountDescriptor: + :category: "constitutional" + :name: "Bonds Count" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.MannholdLogPDescriptor: + :category: "constitutional" + :name: "Mannhold LogP" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.BPolDescriptor: + :category: "electronic" + :name: "Bond Polarizabilities" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.AutocorrelationDescriptorCharge: + :category: "topological" + :name: "Moreau-Broto Autocorrelation (charge) descriptors" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ZagrebIndexDescriptor: + :category: "topological" + :name: "Zagreb Index" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ChiClusterDescriptor: + :category: "topological" + :name: "Chi Cluster Indices" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.RotatableBondsCountDescriptor: + :category: "constitutional" + :name: "Rotatable Bonds Count" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.TPSADescriptor: + :category: "topological" + :name: "Topological Polar Surface Area" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.HBondDonorCountDescriptor: + :category: "electronic" + :name: "Hydrogen Bond Donors" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.HBondAcceptorCountDescriptor: + :category: "electronic" + :name: "Hydrogen Bond Acceptors" +http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.LargestPiSystemDescriptor: + :category: "constitutional" + :name: "Largest Pi Chain" diff --git a/base-install.sh b/base-install.sh index 373df1f..73c9e37 100644 --- a/base-install.sh +++ b/base-install.sh @@ -27,14 +27,14 @@ fi touch $OT_UI_CONF # Pkgs -packs="binutils build-essential git-core gnuplot hostname libcurl4-openssl-dev libgsl0-dev libreadline5-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libxslt1-dev lsb-release psmisc pwgen raptor-utils r-base r-base-core r-base-dev sqlite3 sun-java6-jdk wget xsltproc zlib1g-dev" +packs="binutils build-essential git-core gnuplot hostname libcurl4-openssl-dev libgsl0-dev libreadline6-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libxslt1-dev lsb-release openjdk-6-jdk psmisc pwgen raptor-utils r-base r-base-core r-base-dev sqlite3 wget xsltproc zlib1g-dev" echo echo "Base Packages:" pack_arr="" for p in $packs; do - if $DPKG -s "$p" >/dev/null 2>&1; then + if $DPKG -S "$p" >/dev/null 2>&1; then printf "%50s%30s\n" "'$p'" "Y" else printf "%50s%30s\n" "'$p'" "N" @@ -7,21 +7,23 @@ # 1) Base setup OT_DIST="debian" # Linux distribution (debian) OT_INSTALL="local" # Type (gem, local, server) -OT_BRANCH="development" # Maturity (development, master) +OT_BRANCH="development" # Maturity (development -you need SSH key at Github-, master) # 2) Where all binaries are installed. OT_PREFIX="$HOME/opentox-ruby" -OT_JAVA_HOME="/usr/lib/jvm/java-6-sun" +OT_JAVA_HOME="/usr/lib/jvm/java-6-openjdk" # 3) What versions to install. RUBY_NUM_VER="1.8.7-2011.03" OB_NUM_VER="2.2.3" KL_NUM_VER="0.9-11" -REDIS_NUM_VER="2.2.2" +REDIS_NUM_VER="2.4.4" # 4) Server settings. -NGINX_SERVERNAME="localhost" +NGINX_SERVERNAME="toxcreate3.in-silico.ch" WWW_DEST="$OT_PREFIX/www" +NGINX_PORT="" # set to empty string ("") for port 80 otherwise set to port *using colon* e.g. ":8080" +OHM_PORT="6379" # set to port (no colon) # Done. @@ -32,17 +34,16 @@ RUBY_CONF="$OT_PREFIX/.sh_ruby_ot" REDIS_CONF="$OT_PREFIX/.sh_redis_ot" NGINX_CONF="$OT_PREFIX/.sh_nginx_ot" OB_CONF="$OT_PREFIX/.sh_OB_ot" -KL_CONF="$OT_PREFIX/.sh_R_ot" +R_CONF="$OT_PREFIX/.sh_R_ot" RUBY_VER="ruby-enterprise-$RUBY_NUM_VER" OB_VER="openbabel-$OB_NUM_VER" -KL_VER="$KL_NUM_VER" REDIS_VER="$REDIS_NUM_VER" RUBY_DEST="$OT_PREFIX/$RUBY_VER" OB_DEST="$OT_PREFIX/$OB_VER" OB_DEST_BINDINGS="$OT_PREFIX/openbabel-ruby-install" -KL_DEST="$OT_PREFIX/r-packages" +R_DEST="$OT_PREFIX/r-packages" NGINX_DEST="$OT_PREFIX/nginx" REDIS_DEST="$OT_PREFIX/redis-$REDIS_VER" @@ -7,7 +7,33 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi -LOG="/tmp/`basename $0`-log.txt" +echo +echo "Warning! If all IST services are stoppped press return, else <Ctrl+C> to stop installation." +echo "Note: Your data will be backupped." +read help_var +echo + +mkdir -p $HOME/tmp/ >/dev/null 2>&1 +DATE=`date +_%Y%m%d_%H_%M` +if [ -f "$HOME/.opentox-ui.sh" ] +then + mv -v --backup=numbered $HOME/.opentox-ui.sh $HOME/.opentox-ui.sh$DATE +else + echo "$HOME/.opentox-ui.sh not found (nothing to backup)." +fi +if [ -d "$HOME/.opentox" ] +then + mv -v --backup=numbered -T $HOME/.opentox $HOME/.opentox$DATE +else + echo "$HOME/.opentox not found (nothing to backup)." +fi +if [ -d "$HOME/opentox-ruby" ] +then + mv -v --backup=numbered -T $HOME/opentox-ruby $HOME/opentox-ruby$DATE +else + echo "$HOME/opentox-ruby not found (nothing to backup)." +fi +LOG="$HOME/tmp/`basename $0`-log.txt" . "./utils.sh" echo echo "Opentox-ruby installation." @@ -15,8 +41,8 @@ echo "You may need to give root password for some privileged actions right now a echo cmd="sudo echo -n \"\"" && run_cmd "$cmd" "Acquire privileges" -echo "Cleaning up /tmp files." -sudo rm -rf /tmp/openbabel* /tmp/kernlab* /tmp/ruby* /tmp/passenger* +echo "Cleaning up $HOME/tmp files." +rm -rf $HOME/tmp/openbabel* $HOME/tmp/kernlab* $HOME/tmp/ruby* . "./base-install.sh" . "./ruby.sh" @@ -26,43 +26,40 @@ if [ ! -e "$R" ]; then fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Kernlab ('$LOG')." R_DONE=false -mkdir "$KL_DEST" >/dev/null 2>&1 -if [ ! -d "$KL_DEST" ]; then - echo "Install directory '$KL_DEST' is not available! Aborting..." +mkdir "$R_DEST" >/dev/null 2>&1 +if [ ! -d "$R_DEST" ]; then + echo "Install directory '$R_DEST' is not available! Aborting..." exit 1 else - if ! rmdir "$KL_DEST" >/dev/null 2>&1; then # if not empty this will fail + if ! rmdir "$R_DEST" >/dev/null 2>&1; then # if not empty this will fail R_DONE=true else - mkdir "$KL_DEST" >/dev/null 2>&1 + mkdir "$R_DEST" >/dev/null 2>&1 fi fi if ! $R_DONE; then - cd /tmp - URI="http://cran.r-project.org/src/contrib/Archive/kernlab/kernlab_$KL_VER.tar.gz" - cmd="$WGET $URI" && run_cmd "$cmd" "Download" - - export R_LIBS="$KL_DEST" # To install non-global - cmd="$R CMD INSTALL kernlab_$KL_VER.tar.gz" && run_cmd "$cmd" "Install" + export R_LIBS="$R_DEST" # To install non-global + cmd="$R CMD BATCH packs.R" && run_cmd "$cmd" "R packages" + eval "$cmd" fi -if [ ! -f $KL_CONF ]; then +if [ ! -f $R_CONF ]; then - echo "if echo \"\$R_LIBS\" | grep -v \"$KL_DEST\">/dev/null 2>&1; then export R_LIBS=\"$KL_DEST\"; fi" >> "$KL_CONF" - echo "if ! [ -d \"$KL_DEST\" ]; then echo \"\$0: '$KL_DEST' is not a directory!\"; fi" >> "$KL_CONF" - echo "R package destination has been stored in '$KL_CONF'." + echo "if echo \"\$R_LIBS\" | grep -v \"$R_DEST\">/dev/null 2>&1; then export R_LIBS=\"$R_DEST\"; fi" >> "$R_CONF" + echo "if ! [ -d \"$R_DEST\" ]; then echo \"\$0: '$R_DEST' is not a directory!\"; fi" >> "$R_CONF" + echo "R package destination has been stored in '$R_CONF'." - if ! grep "$KL_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then - echo ". \"$KL_CONF\"" >> $OT_UI_CONF + if ! grep "$R_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then + echo ". \"$R_CONF\"" >> $OT_UI_CONF fi fi @@ -14,6 +14,7 @@ http { passenger_log_level 2; passenger_spawn_method conservative; #passenger_use_global_queue on; + passenger_max_pool_size 30; include NGINX_DEST/conf/mime.types; default_type application/octet-stream; @@ -23,7 +24,7 @@ http { # webservices server { - listen 80; + listen NGINX_PORT; client_max_body_size 5000m; server_name SERVERNAME; location / { @@ -26,7 +26,7 @@ if [ ! -e "$GIT" ]; then fi -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Nginx ('$LOG'):" @@ -53,7 +53,15 @@ servername=`hostname` $GIT checkout nginx.conf>>$LOG 2>&1 cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,;s,WWW_DEST,$WWW_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config" cmd="sed -i -e \"s,USER,`whoami`,\" ./nginx.conf" && run_cmd "$cmd" "User" + +if [ -z "$NGINX_PORT" ]; then + NGINX_PORT=80 +else + NGINX_PORT=`echo "$NGINX_PORT" | sed 's/^.//g'` +fi +cmd="sed -i -e \"s,NGINX_PORT,$NGINX_PORT,\" ./nginx.conf" && run_cmd "$cmd" "NGINX_PORT" cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy" +$GIT checkout nginx.conf>>$LOG 2>&1 if [ ! -f $NGINX_CONF ]; then echo "if ! echo \"\$PATH\" | grep \"$NGINX_DEST\">/dev/null 2>&1; then export PATH=$NGINX_DEST/sbin:\$PATH; fi" >> "$NGINX_CONF" diff --git a/openbabel.sh b/openbabel.sh index 4e55ff8..3016d95 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -21,7 +21,7 @@ if [ ! -e "$WGET" ]; then fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Openbabel ('$OB_DEST', '$LOG'):" @@ -38,13 +38,13 @@ else fi if [ ! $OB_DONE ]; then - cd "/tmp">>$LOG 2>/dev/null + cd "$HOME/tmp">>$LOG 2>/dev/null URI="http://downloads.sourceforge.net/project/openbabel/openbabel/$OB_NUM_VER/$OB_VER.tar.gz?use_mirror=kent" - if ! [ -d "/tmp/$OB_VER" ]; then + if ! [ -d "$HOME/tmp/$OB_VER" ]; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" cmd="tar zxf $OB_VER.tar.gz?use_mirror=kent $OB_VER" && run_cmd "$cmd" "Unpack" fi - cd "/tmp/$OB_VER">>$LOG 2>/dev/null + cd "$HOME/tmp/$OB_VER">>$LOG 2>/dev/null cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" cmd="make" && run_cmd "$cmd" "Make" @@ -76,7 +76,7 @@ fi echo "Bindings:" OB_DONE=false . "$OT_UI_CONF" -mkdir "$OB_DEST_BINDINGS">/dev/null 2>&1 +mkdir -p "$OB_DEST_BINDINGS">/dev/null 2>&1 if [ ! -d "$OB_DEST_BINDINGS" ]; then echo "Install directory '$OB_DEST_BINDINGS' is not available! Aborting..." exit 1 @@ -86,15 +86,15 @@ else fi fi -#if ! $OB_DONE ; then - OB_SRC_DIR="/tmp/$OB_VER/scripts/ruby/" - cd "$OB_SRC_DIR" - cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0 --with-openbabel-lib=$OB_DEST/lib" && run_cmd "$cmd" "Code" - cmd="make" && run_cmd "$cmd" "Make" - cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Install" - cmd="ln -sf $OB_DEST_BINDINGS/openbabel.so $RUBY_DEST/lib/ruby/site_ruby/1.8/`uname -m`-linux/" && run_cmd "$cmd" "Link" - cd "$DIR" - . "`pwd`/utils.sh" - cmd="ruby test-ob-rb.rb" && run_cmd "$cmd" "Load" -#fi +if ! $OB_DONE ; then + OB_SRC_DIR="$HOME/tmp/$OB_VER/scripts/ruby/" + cd "$OB_SRC_DIR" + cmd="ruby extconf.rb --with-openbabel-include=$OB_DEST/include/openbabel-2.0 --with-openbabel-lib=$OB_DEST/lib" && run_cmd "$cmd" "Code" + cmd="make" && run_cmd "$cmd" "Make" + cmd="cp openbabel.so $OB_DEST_BINDINGS" && run_cmd "$cmd" "Install" + cmd="ln -sf $OB_DEST_BINDINGS/openbabel.so $RUBY_DEST/lib/ruby/site_ruby/1.8/`uname -m`-linux/" && run_cmd "$cmd" "Link" + cd "$DIR" + . "`pwd`/utils.sh" + cmd="ruby test-ob-rb.rb" && run_cmd "$cmd" "Load" +fi diff --git a/opentox-ruby.sh b/opentox-ruby.sh index 5f8cc65..64ac93a 100755 --- a/opentox-ruby.sh +++ b/opentox-ruby.sh @@ -33,13 +33,13 @@ fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Opentox-ruby ('$LOG'):" for mygem in opentox-ruby builder jeweler; do - if ! $GEM list | grep "$mygem" >/dev/null 2>&1; then + if ! $GEM list | sed 's/\ .*//g' | grep -x "$mygem" >/dev/null 2>&1; then cmd="$GEM install $mygem" && run_cmd "$cmd" "$mygem" fi done @@ -66,12 +66,14 @@ fi mkdir -p "$HOME/.opentox/config" >>$LOG 2>&1 mkdir -p "$HOME/.opentox/log" >>$LOG 2>&1 +mkdir -p "$HOME/.opentox/tmp" >>$LOG 2>&1 $GIT checkout production.yaml >>$LOG 2>&1 $GIT checkout aa-$OT_INSTALL.yaml >>$LOG 2>&1 -cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" -cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" +cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,;s,NGINX_PORT,$NGINX_PORT,;s,OHM_PORT,$OHM_PORT,\" production.yaml > $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 1" +cmd="sed -e \"s,SERVERNAME,$servername,;s,ESCAPEDSERVER,$escapedserver,;s,LOGGER,$logger,;s,AA,$aa,;s,WWW_DEST,$WWW_DEST,;s,NGINX_PORT,$NGINX_PORT,;s,OHM_PORT,$OHM_PORT,\" aa-$OT_INSTALL.yaml >> $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config 2" +cmd="cp ambit_descriptors.yaml $HOME/.opentox/config/" && run_cmd "$cmd" "Ambit" if [ "$OT_BRANCH" = "development" ] || expr match "$OT_BRANCH" "release"; then mkdir -p $WWW_DEST/opentox >>$LOG 2>&1 diff --git a/opentox-webservices.sh b/opentox-webservices.sh index ef98ded..88f864c 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -37,7 +37,7 @@ if [ ! -e "$RUBY" ]; then exit 1 fi -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Webservices ('$LOG'):" @@ -46,11 +46,7 @@ mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1 cd "$WWW_DEST/opentox" >>$LOG 2>&1 for s in compound dataset algorithm model toxcreate task validation; do rm -rf "$s" >>$LOG 2>&1 - if [ "$OT_BRANCH" = "development" ] || expr match "$OT_BRANCH" "release"; then - $GIT clone "git@github.com:opentox/$s.git" "$s" >>$LOG 2>&1 - else - $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 - fi + $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 $GIT checkout -b $OT_BRANCH origin/$OT_BRANCH >>$LOG 2>&1 #rm -rf public >>$LOG 2>&1 @@ -69,21 +65,21 @@ cmd="$GIT submodule update" && run_cmd "$cmd" "Fminer Update" cd "libfminer/libbbrc">>$LOG 2>&1 $GIT checkout $OT_BRANCH>>$LOG 2>&1 $GIT pull >>$LOG 2>&1 -cd - +cd - >>$LOG 2>&1 cd "libfminer/liblast">>$LOG 2>&1 $GIT checkout $OT_BRANCH>>$LOG 2>&1 $GIT pull >>$LOG 2>&1 -cd - +cd - >>$LOG 2>&1 for mylib in bbrc last; do cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile; sed -i 's,^LDFLAGS_OB.*,LDFLAGS_OB\ =\ -L$OB_DEST/lib,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (OB)" cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/`uname -m`-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (RB)" done cd "libfminer/libbbrc">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" -cd - +cd - >>$LOG 2>&1 cd "libfminer/liblast">>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make LAST" -cd - +cd - >>$LOG 2>&1 cd "last-utils">>$LOG 2>&1 $GIT checkout $OT_BRANCH>>$LOG 2>&1 $GIT pull >>$LOG 2>&1 diff --git a/ot-tools-root.sh b/ot-tools-root.sh new file mode 100644 index 0000000..064ea29 --- /dev/null +++ b/ot-tools-root.sh @@ -0,0 +1,82 @@ +# Some useful scripts to put in your ~/.bashrc in case you are using bash (assuming OT_PREFIX is '~/opentox-ruby'): +# USE ONLY IF YOUR NGINX PORT IS less or equal to 1024 (PRIVILEGED) + +# Load server config +otconfig() { + source $HOME/.opentox-ui.sh +} + +# Update the version +otupdate() { + START_DIR=`pwd` + otconfig + cd $HOME/opentox-ruby/www/opentox + for d in `find -not -name "." -type d -maxdepth 1 2>/dev/null`; do echo ; echo $d ; cd $d ; MYBRANCH=`git branch | grep "*" | sed 's/.*\ //g'`; git pull origin $MYBRANCH ; cd - ; done + cd $HOME/opentox-ruby/www/opentox/algorithm/libfminer + mv libbbrc/Makefile libbbrc/Makefile~ + mv liblast/Makefile liblast/Makefile~ + if ! git pull; then + echo "Error! Pull for Fminer failed." + return 1 + fi + mv libbbrc/Makefile~ libbbrc/Makefile + mv liblast/Makefile~ liblast/Makefile + make -C libbbrc/ clean + make -C libbbrc/ ruby + make -C liblast/ clean + make -C liblast/ ruby + cd - + cd $HOME/opentox-ruby/www/opentox/algorithm/last-utils + if ! git pull; then + echo "Error! Pull for Last-Utils failed." + return 1 + fi + cd - + cd opentox-ruby + LINK_DIR=`gem which opentox-ruby | sed 's/\/opentox-ruby.rb//'` + if [ -h $LINK_DIR ]; then + rm -f $LINK_DIR + fi + rake install + if ! [ -h $LINK_DIR ]; then + echo "Warning! Your lib $LINK_DIR is no symlink. Linking back for you..." + rm -rf "$LINK_DIR~" + mv "$LINK_DIR" "$LINK_DIR~" + ln -sf $HOME/opentox-ruby/www/opentox/opentox-ruby/lib `echo ${LINK_DIR::${#LINK_DIR}-3}` + fi + echo "Please execute 'otstart' to restart." + cd "$START_DIR" +} + +# Start the server +otstart() { + otconfig + otkill + sudo bash -c "source $HOME/.opentox-ui.sh; nohup redis-server $HOME/opentox-ruby/redis-*/redis.conf >/dev/null 2>&1 &" + sudo bash -c "source $HOME/.opentox-ui.sh; nohup nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 &" + sleep 2 + if ! pgrep -u root nginx>/dev/null 2>&1; then echo "Failed to start nginx."; fi + if ! pgrep -u root redis-server>/dev/null 2>&1; then echo "Failed to start redis."; fi +} + +# Display log +alias otless='less $HOME/.opentox/log/production.log' + +# Tail log +alias ottail='tail -f $HOME/.opentox/log/production.log' + +# Reload the server +otreload() { + otconfig + sudo bash -c "source $HOME/.opentox-ui.sh; nginx -s reload" +} + +# Kill the server +otkill() { + otconfig + sudo killall -u root nginx >/dev/null 2>&1 + sudo bash -c "source $HOME/.opentox-ui.sh; redis-cli -p $OHM_PORT shutdown >/dev/null 2>&1" + while sudo ps x | grep PassengerWatchdog | grep -v grep >/dev/null 2>&1; do sleep 1; done + while sudo ps x | grep Rack | grep -v grep >/dev/null 2>&1; do sleep 1; done + for p in `pgrep -u root R 2>/dev/null`; do sudo kill -9 $p; done +} diff --git a/ot-tools-user.sh b/ot-tools-user.sh new file mode 100644 index 0000000..57c6c00 --- /dev/null +++ b/ot-tools-user.sh @@ -0,0 +1,83 @@ +# Some useful scripts to put in your ~/.bashrc in case you are using bash (assuming OT_PREFIX is '~/opentox-ruby'): +# USE ONLY IF YOUR NGINX PORT IS >1024 (NOT PRIVILEGED) + +# Load server config +otconfig() { + source $HOME/.opentox-ui.sh +} + +# Update the version +otupdate() { + START_DIR=`pwd` + otconfig + cd $HOME/opentox-ruby/www/opentox + for d in `find -not -name "." -type d -maxdepth 1 2>/dev/null`; do echo ; echo $d ; cd $d ; MYBRANCH=`git branch | grep "*" | sed 's/.*\ //g'`; git pull origin $MYBRANCH ; cd - ; done + cd $HOME/opentox-ruby/www/opentox/algorithm/libfminer + mv libbbrc/Makefile libbbrc/Makefile~ + mv liblast/Makefile liblast/Makefile~ + if ! git pull; then + echo "Error! Pull for Fminer failed." + return 1 + fi + mv libbbrc/Makefile~ libbbrc/Makefile + mv liblast/Makefile~ liblast/Makefile + make -C libbbrc/ clean + make -C libbbrc/ ruby + make -C liblast/ clean + make -C liblast/ ruby + cd - + cd $HOME/opentox-ruby/www/opentox/algorithm/last-utils + if ! git pull; then + echo "Error! Pull for Last-Utils failed." + return 1 + fi + cd - + cd opentox-ruby + LINK_DIR=`gem which opentox-ruby | sed 's/\/opentox-ruby.rb//'` + if [ -h $LINK_DIR ]; then + rm -f $LINK_DIR + fi + rake install + if ! [ -h $LINK_DIR ]; then + echo "Warning! Your lib $LINK_DIR is no symlink. Linking back for you..." + rm -rf "$LINK_DIR~" + mv "$LINK_DIR" "$LINK_DIR~" + ln -sf $HOME/opentox-ruby/www/opentox/opentox-ruby/lib `echo ${LINK_DIR::${#LINK_DIR}-3}` + fi + echo "Please execute 'otstart' to restart." + cd "$START_DIR" +} + +# Start the server +otstart() { + otconfig + otkill + bash -c "nohup redis-server $HOME/opentox-ruby/redis-*/redis.conf >/dev/null 2>&1 &" + bash -c "nohup nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 &" + sleep 2 + if ! pgrep -u $USER nginx>/dev/null 2>&1; then echo "Failed to start nginx."; fi + if ! pgrep -u $USER redis-server>/dev/null 2>&1; then echo "Failed to start redis."; fi +} + +# Display log +alias otless='less $HOME/.opentox/log/production.log' + +# Tail log +alias ottail='tail -f $HOME/.opentox/log/production.log' + +# Reload the server +otreload() { + otconfig + bash -c "nginx -s reload" +} + +# Kill the server +otkill() { + otconfig + killall nginx >/dev/null 2>&1 + bash -c "redis-cli -p $OHM_PORT shutdown >/dev/null 2>&1" + while ps x | grep PassengerWatchdog | grep -v grep >/dev/null 2>&1; do sleep 1; done + while ps x | grep Rack | grep -v grep >/dev/null 2>&1; do sleep 1; done + for p in `pgrep -u $USER R 2>/dev/null`; do kill -9 $p; done +} + @@ -0,0 +1,6 @@ +# CRAN package installer for opentox-ruby +# AM, 2012 + +# set mirror to avoid questioning the user +options(repos="http://mirrors.softliste.de/cran") +install.packages(c("caret", "doMC", "e1071", "foreach", "iterators", "kernlab", "multicore", "plyr", "reshape", "randomForest", "RANN")) diff --git a/production.yaml b/production.yaml index 09efad0..e0f39d4 100644 --- a/production.yaml +++ b/production.yaml @@ -2,13 +2,13 @@ :services: # make sure to enter a full uri (including training slash) - opentox-compound: "http://SERVERNAME/compound/" - opentox-dataset: "http://SERVERNAME/dataset/" - opentox-algorithm: "http://SERVERNAME/algorithm/" - opentox-model: "http://SERVERNAME/model/" - opentox-task: "http://SERVERNAME/task/" - opentox-toxcreate: "http://SERVERNAME/toxcreate/" - opentox-validation: "http://SERVERNAME/validation/" + opentox-compound: "http://SERVERNAMENGINX_PORT/compound/" + opentox-dataset: "http://SERVERNAMENGINX_PORT/dataset/" + opentox-algorithm: "http://SERVERNAMENGINX_PORT/algorithm/" + opentox-model: "http://SERVERNAMENGINX_PORT/model/" + opentox-task: "http://SERVERNAMENGINX_PORT/task/" + opentox-toxcreate: "http://SERVERNAMENGINX_PORT/toxcreate/" + opentox-validation: "http://SERVERNAMENGINX_PORT/validation/" opentox-ontology: "http://apps.ideaconsult.net:8080/ontology" :json_hosts: @@ -17,6 +17,8 @@ - "webservices.in-silico.ch" - "opentox.informatik.uni-freiburg.de" +:ohm_port: OHM_PORT + # Uncomment for verbose logging LOGGER :logger: debug @@ -19,7 +19,7 @@ if [ ! -e "$WGET" ]; then exit 1 fi -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Redis ('$LOG'):" @@ -59,10 +59,15 @@ if ! $REDIS_DONE; then if ! grep "save 900 1" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then echo "save 900 1" >> $REDIS_SERVER_CONF 2>$LOG fi + + if ! grep "port $OHM_PORT" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then + echo "port $OHM_PORT" >> $REDIS_SERVER_CONF 2>$LOG + fi fi if [ ! -f $REDIS_CONF ]; then echo "if ! echo \"\$PATH\" | grep \"$REDIS_DEST\">/dev/null 2>&1; then export PATH=$REDIS_DEST/src:\$PATH; fi" >> "$REDIS_CONF" + echo "export OHM_PORT=$OHM_PORT" >> "$REDIS_CONF" echo "Redis configuration has been stored in '$REDIS_CONF'." if ! grep ". \"$REDIS_CONF\"" $OT_UI_CONF; then @@ -21,7 +21,7 @@ if [ ! -e "$WGET" ]; then fi # Pkg -LOG="/tmp/`basename $0`-log.txt" +LOG="$HOME/tmp/`basename $0`-log.txt" echo echo "Ruby Enterprise edition ('$RUBY_DEST', '$LOG')." @@ -38,13 +38,13 @@ else fi if [ ! $RUBY_DONE ]; then - cd /tmp + cd $HOME/tmp URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - if ! [ -d "/tmp/$RUBY_VER" ]; then + if ! [ -d "$HOME/tmp/$RUBY_VER" ]; then cmd="$WGET $URI" && run_cmd "$cmd" "Download" cmd="tar xzf $RUBY_VER.tar.gz" && run_cmd "$cmd" "Unpack" fi - cmd="sh /tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" + cmd="sh $HOME/tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" fi @@ -1,16 +0,0 @@ -#!/bin/sh -. /etc/profile -gem update opentox-ruby -dir=`pwd` -cd /var/www/opentox -for s in *; do - echo $s - cd $s - git pull - cd - -done -cd /var/www/algorithm -rake fminer:update -kill `cat /opt/nginx/logs/nginx.pid` -/opt/nginx/sbin/nginx -cd $dir |