diff options
-rw-r--r-- | aa-local.yaml | 41 | ||||
-rw-r--r-- | aa-server.yaml | 41 | ||||
-rwxr-xr-x[-rw-r--r--] | base-install.sh | 20 | ||||
-rwxr-xr-x | config.sh | 16 | ||||
-rwxr-xr-x | environment_update.sh | 77 | ||||
-rwxr-xr-x | install | 14 | ||||
-rw-r--r-- | jl_keys.yaml | 38 | ||||
-rwxr-xr-x | kernlab.sh | 68 | ||||
-rw-r--r-- | nginx.conf | 43 | ||||
-rwxr-xr-x | openbabel.sh | 39 | ||||
-rwxr-xr-x | opentox-ruby.sh | 92 | ||||
-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 | 26 | ||||
-rwxr-xr-x | redis.sh | 79 | ||||
-rwxr-xr-x | ruby.sh | 83 | ||||
-rw-r--r-- | test-ob-rb.rb | 1 |
18 files changed, 69 insertions, 780 deletions
diff --git a/aa-local.yaml b/aa-local.yaml deleted file mode 100644 index 75cccd0..0000000 --- a/aa-local.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# OpenSSO Authorization -# set ":server: " to disable A&A -:authorization: - :server: AA - :free_request: #request-method not controlled by A&A - - "GET" - - "POST" - - "HEAD" - - "DELETE" - - "PUT" - :authenticate_request: #only for authenticated user - - "" - :authorize_request: #only for authenticated and authorizeduser - - "" -# Exceptions: - :free_uris: #request-method for uri not controlled by A&A - ? - :GET - : - !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:\/\/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:\/\/ESCAPEDSERVERNGINX_PORT\/task/ - ? - :DELETE - : - "http://SERVERNAMENGINX_PORT/task/cleanup" - - :authorize_exceptions: #request-method for uri only authenticated, no authorization - ? - :POST - : - !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 deleted file mode 100644 index 75cccd0..0000000 --- a/aa-server.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# OpenSSO Authorization -# set ":server: " to disable A&A -:authorization: - :server: AA - :free_request: #request-method not controlled by A&A - - "GET" - - "POST" - - "HEAD" - - "DELETE" - - "PUT" - :authenticate_request: #only for authenticated user - - "" - :authorize_request: #only for authenticated and authorizeduser - - "" -# Exceptions: - :free_uris: #request-method for uri not controlled by A&A - ? - :GET - : - !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:\/\/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:\/\/ESCAPEDSERVERNGINX_PORT\/task/ - ? - :DELETE - : - "http://SERVERNAMENGINX_PORT/task/cleanup" - - :authorize_exceptions: #request-method for uri only authenticated, no authorization - ? - :POST - : - !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/base-install.sh b/base-install.sh index 73c9e37..e9e0860 100644..100755 --- a/base-install.sh +++ b/base-install.sh @@ -16,6 +16,7 @@ fi # Utils APTITUDE="`which aptitude`" +GIT="`which git`" APT_CACHE="`which apt-cache`" DPKG="`which dpkg`" @@ -24,10 +25,15 @@ if [ ! -e "$APTITUDE" ]; then exit 1 fi +if [ ! -e "$GIT" ]; then + echo "Git missing. Install git first." 1>&2 + exit 1 +fi + touch $OT_UI_CONF # Pkgs -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" +packs="binutils build-essential cmake 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 udev wget xsltproc zlib1g-dev" echo echo "Base Packages:" @@ -65,7 +71,6 @@ if [ -n "$pack_fail" ]; then sleep 5 fi -echo sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true | sudo /usr/bin/debconf-set-selections echo if [ -n "$pack_arr" ]; then echo "Installing missing packages:" @@ -92,5 +97,16 @@ if [ ! -f $JAVA_CONF ]; then fi fi +if [ ! -d ~/.rbenv ]; then + cmd="$GIT clone git://github.com/sstephenson/rbenv.git ~/.rbenv" && run_cmd "$cmd" "rbenv" +else + echo "'rbenv' already installed. Leaving untouched." +fi + +if ! grep "rbenv" $OT_UI_CONF >/dev/null 2>&1 ; then + echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $OT_UI_CONF + echo 'eval "$(rbenv init -)"' >> $OT_UI_CONF +fi + cd "$DIR" @@ -14,37 +14,29 @@ OT_PREFIX="$HOME/opentox-ruby" 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.4.4" +RUBY_NUM_VER="1.9.3-p125" +OB_NUM_VER="2.3.1" +REDIS_NUM_VER="2.2.2" # 4) Server settings. 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) +OHM_PORT="6381" # set to port (no colon) # Done. ### Nothing to gain from changes below this line. JAVA_CONF="$OT_PREFIX/.sh_java_ot" -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" R_CONF="$OT_PREFIX/.sh_R_ot" -RUBY_VER="ruby-enterprise-$RUBY_NUM_VER" OB_VER="openbabel-$OB_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" R_DEST="$OT_PREFIX/r-packages" -NGINX_DEST="$OT_PREFIX/nginx" REDIS_DEST="$OT_PREFIX/redis-$REDIS_VER" REDIS_SERVER_CONF="$REDIS_DEST/redis.conf" diff --git a/environment_update.sh b/environment_update.sh deleted file mode 100755 index d0beae4..0000000 --- a/environment_update.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# Update script for OpenTox-ruby and webservices -# Authors: Andreas Maunz, David Vorgrimmler -# This script updates a productiv version of IST Opentox Services. All data will be saved and recovered. -# Make sure your web services are down befor running this script. -# You may modify some variables e.g. HOME, OTPREFIX, BACKUP_DIR. -# opentox/install is needed and has to be configured - -HOME="/home/opentox" -. $HOME/.opentox-ui.sh - -OTPREFIX="$HOME/opentox" -BACKUP_DIR="$OTPREFIX/ot-server-backup" -mkdir $BACKUP_DIR >/dev/null 2>&1 -mkdir -p $BACKUP_DIR/tmp/dataset/public >/dev/null 2>&1 -mkdir -p $BACKUP_DIR/tmp/model/public >/dev/null 2>&1 -mkdir -p $BACKUP_DIR/tmp/validation >/dev/null 2>&1 -#mkdir -p $BACKUP_DIR/tmp/log >/dev/null 2>&1 - - -echo "Creating backup of www..." -TAR_NAME=$BACKUP_DIR/"www_`date +%y%m%d`.tar.gz" - -if [ -e $TAR_NAME ] || tar czvf $TAR_NAME "$OTPREFIX/opentox-ruby/www"; then - echo - echo "Will delete www in 10s! Press Ctrl+C to abort..." - sleep 10 - sudo rm -rf "$OTPREFIX/opentox-ruby/www" -fi - - -NGINX="`which nginx`" -RAKE="`which rake`" - -if ! [ -e "$RAKE" ]; then - echo "Rake not found." - exit 1 -fi -if ! [ -e "$NGINX" ]; then - echo "Nginx not found." - exit 1 -fi -if ! cd "$OTPREFIX/install"; then - echo "$OTPREFIX/install dir not found" -fi - - -OTINSTALL="$OTPREFIX/install/opentox-webservices.sh" -if ! [ -e "$OTINSTALL" ]; then - echo "$OTINSTALL not found." - exit 1 -fi -chmod +x $OTINSTALL -`$OTINSTALL` -echo "$OTINSTALL script end." - - -OTRUBYINSTALL="$OTPREFIX/install/opentox-ruby.sh" -if ! [ -e "$OTRUBYINSTALL" ]; then - echo "$OTRUBYINSTALL not found." - exit 1 -fi -chmod +x $OTRUBYINSTALL -`$OTRUBYINSTALL` -echo "$OTRUBYINSTALL script end." - - -echo "Extracting backup of www..." -cd / -DEST_DATASET=`echo "$OTPREFIX/opentox-ruby/www/opentox/dataset/public/*yaml" | sed 's/.\(.*\)/\1/'` -DEST_MODEL=`echo "$OTPREFIX/opentox-ruby/www/opentox/model/public/*yaml" | sed 's/.\(.*\)/\1/'` -DEST_REPORTS=`echo "$OTPREFIX/opentox-ruby/www/opentox/validation/reports" | sed 's/.\(.*\)/\1/'` -tar xzvf $TAR_NAME --wildcards $DEST_DATASET -tar xzvf $TAR_NAME --wildcards $DEST_MODEL -tar xzvf $TAR_NAME $DEST_REPORTS -cd - -echo "End of script." @@ -45,22 +45,10 @@ echo "Cleaning up $HOME/tmp files." rm -rf $HOME/tmp/openbabel* $HOME/tmp/kernlab* $HOME/tmp/ruby* . "./base-install.sh" -. "./ruby.sh" . "./openbabel.sh" -. "./kernlab.sh" -. "./opentox-ruby.sh" - -if [ "$install" != "gem" ] -then - . "./nginx.sh" - . "./redis.sh" - . "./opentox-webservices.sh" -fi echo echo "Installation finished and system configured." echo "Destination: '$OT_PREFIX'" -echo "Nginx: '$NGINX_DEST'" -echo "Redis: '$REDIS_DEST'" -echo "IMPORTANT: Include the file '$OT_UI_CONF' in your shell or system startup to have the system automatically configured." +echo "IMPORTANT: Include '$OT_UI_CONF' in your shell or system startup to have the system automatically configured." echo diff --git a/jl_keys.yaml b/jl_keys.yaml new file mode 100644 index 0000000..22f26ae --- /dev/null +++ b/jl_keys.yaml @@ -0,0 +1,38 @@ +[ + "joelib2.feature.types.FractionRotatableBonds", + "joelib2.feature.types.GeometricalDiameter", + "joelib2.feature.types.GeometricalRadius", + "joelib2.feature.types.GeometricalShapeCoefficient", + "joelib2.feature.types.GraphShapeCoefficient", + "joelib2.feature.types.KierShape1", + "joelib2.feature.types.KierShape2", + "joelib2.feature.types.KierShape3", + "joelib2.feature.types.LogP", + "joelib2.feature.types.MolarRefractivity", + "joelib2.feature.types.MolecularWeight", + "joelib2.feature.types.PolarSurfaceArea", + "joelib2.feature.types.FractionRotatableBonds", + "joelib2.feature.types.RotatableBonds", + "joelib2.feature.types.TopologicalDiameter", + "joelib2.feature.types.TopologicalRadius", + "joelib2.feature.types.ZagrebIndex1", + "joelib2.feature.types.count.AcidicGroups", + "joelib2.feature.types.count.AliphaticOHGroups", + "joelib2.feature.types.count.AromaticBonds", + "joelib2.feature.types.count.AromaticOHGroups", + "joelib2.feature.types.count.BasicGroups", + "joelib2.feature.types.count.HBA1", + "joelib2.feature.types.count.HBA2", + "joelib2.feature.types.count.HBD1", + "joelib2.feature.types.count.HBD2", + "joelib2.feature.types.count.HeavyBonds", + "joelib2.feature.types.count.HeteroCycles", + "joelib2.feature.types.count.HydrophobicGroups", + "joelib2.feature.types.count.NO2Groups", + "joelib2.feature.types.count.NumberOfAtoms", + "joelib2.feature.types.count.NumberOfBonds", + "joelib2.feature.types.count.NumberOfHal", + "joelib2.feature.types.count.OSOGroups", + "joelib2.feature.types.count.SO2Groups", + "joelib2.feature.types.count.OSOGroups" +] diff --git a/kernlab.sh b/kernlab.sh deleted file mode 100755 index aad125d..0000000 --- a/kernlab.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Installs Kernlab. -# Author: Christoph Helma, Andreas Maunz. -# - -. "`pwd`/utils.sh" -DIR="`pwd`" - -if [ "$(id -u)" = "0" ]; then - echo "This script must be run as non-root." 1>&2 - exit 1 -fi - -# Utils -WGET="`which wget`" -if [ ! -e "$WGET" ]; then - echo "'wget' missing. Install 'wget' first. Aborting..." - exit 1 -fi - -R="`which R`" -if [ ! -e "$R" ]; then - echo "'R' missing. Install 'R' first. Aborting..." - exit 1 -fi - -# Pkg -LOG="$HOME/tmp/`basename $0`-log.txt" - -echo -echo "Kernlab ('$LOG')." - -R_DONE=false -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 "$R_DEST" >/dev/null 2>&1; then # if not empty this will fail - R_DONE=true - else - mkdir "$R_DEST" >/dev/null 2>&1 - fi -fi - - -if ! $R_DONE; then - 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 $R_CONF ]; then - - 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 "$R_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then - echo ". \"$R_CONF\"" >> $OT_UI_CONF - fi - -fi - -cd "$DIR" - diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index c15dc02..0000000 --- a/nginx.conf +++ /dev/null @@ -1,43 +0,0 @@ -worker_processes 10; - -events { - worker_connections 1024; -} - -http { - - server_names_hash_bucket_size 256; - - passenger_root RUBY_DEST/lib/ruby/gems/1.8/gems/PASSENGER; - passenger_ruby RUBY_DEST/bin/ruby; - passenger_default_user USER; - 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; - - sendfile on; - keepalive_timeout 65; - - # webservices - server { - listen NGINX_PORT; - client_max_body_size 5000m; - server_name SERVERNAME; - location / { - root WWW_DEST; - passenger_enabled on; - } - passenger_base_uri /compound; - passenger_base_uri /dataset; - passenger_base_uri /algorithm; - passenger_base_uri /model; - passenger_base_uri /task; - passenger_base_uri /validation; - passenger_base_uri /toxcreate; - } - -} diff --git a/openbabel.sh b/openbabel.sh index 3016d95..b51ed17 100755 --- a/openbabel.sh +++ b/openbabel.sh @@ -19,6 +19,11 @@ if [ ! -e "$WGET" ]; then echo "'wget' missing. Install 'wget' first. Aborting..." exit 1 fi +CMAKE="`which cmake`" +if [ ! -e "$CMAKE" ]; then + echo "'cmake' missing. Install 'cmake' first. Aborting..." + exit 1 +fi # Pkg LOG="$HOME/tmp/`basename $0`-log.txt" @@ -45,9 +50,8 @@ if [ ! $OB_DONE ]; then cmd="tar zxf $OB_VER.tar.gz?use_mirror=kent $OB_VER" && run_cmd "$cmd" "Unpack" fi cd "$HOME/tmp/$OB_VER">>$LOG 2>/dev/null - - cmd="./configure --prefix=$OB_DEST" && run_cmd "$cmd" "Configure" - cmd="make" && run_cmd "$cmd" "Make" + cmd="$CMAKE -DCMAKE_INSTALL_PREFIX=$OB_DEST" && run_cmd "$cmd" "Configure" + cmd="make -j2" && run_cmd "$cmd" "Make" cmd="make install" && run_cmd "$cmd" "Install" fi @@ -63,9 +67,6 @@ if [ ! -f "$OB_CONF" ]; then echo "if [ -z \"\$BABEL_DATADIR\" ]; then export BABEL_DATADIR=\"$OB_DEST/share/openbabel/$OB_NUM_VER\"; fi" >> "$OB_CONF" echo "if ! [ -d \"\$BABEL_DATADIR\" ]; then echo \"\$0: '\$BABEL_DATADIR' is not a directory!\"; fi" >> "$OB_CONF" - echo "if echo \"\$RUBYLIB\" | grep -v \"$OB_DEST_BINDINGS\">/dev/null 2>&1; then export RUBYLIB=\"$OB_DEST_BINDINGS:\$RUBYLIB\"; fi" >> "$RUBY_CONF" - echo "if ! [ -d \"$OB_DEST_BINDINGS\" ]; then echo \"\$0: '$OB_DEST_BINDINGS' is not a directory!\"; fi" >> "$RUBY_CONF" - echo "Openbabel configuration has been stored in '$OB_CONF'." if ! grep "$OB_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then echo ". \"$OB_CONF\"" >> $OT_UI_CONF @@ -73,28 +74,4 @@ if [ ! -f "$OB_CONF" ]; then fi -echo "Bindings:" -OB_DONE=false -. "$OT_UI_CONF" -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 -else - if [ "`ls $OB_DEST_BINDINGS | wc -l`" -gt 0 ]; then - OB_DONE=true - fi -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 - +cd "$DIR" diff --git a/opentox-ruby.sh b/opentox-ruby.sh deleted file mode 100755 index 64ac93a..0000000 --- a/opentox-ruby.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# -# Installs Opentox-ruby gem. -# Author: Christoph Helma, Andreas Maunz. -# - -. "`pwd`/utils.sh" -DIR="`pwd`" - -if [ "$(id -u)" = "0" ]; then - echo "This script must be run as non-root." 1>&2 - exit 1 -fi - -# Utils -GIT="`which git`" -if [ ! -e "$GIT" ]; then - echo "'git' missing. Install 'git' first. Aborting..." - exit 1 -fi - -GEM="`which gem`" -if [ ! -e "$GEM" ]; then - echo "'gem' missing. Install 'gem' first. Aborting..." - exit 1 -fi - -RAKE="`which rake`" -if [ ! -e "$RAKE" ]; then - echo "'rake' missing. Install 'rake' first. Aborting..." - exit 1 -fi - - -# Pkg -LOG="$HOME/tmp/`basename $0`-log.txt" - -echo -echo "Opentox-ruby ('$LOG'):" - -for mygem in opentox-ruby builder jeweler; do - if ! $GEM list | sed 's/\ .*//g' | grep -x "$mygem" >/dev/null 2>&1; then - cmd="$GEM install $mygem" && run_cmd "$cmd" "$mygem" - fi -done - - -servername="`hostname`" -serverdomain="`dnsdomainname`" -if [ -n "$serverdomain" ]; then - servername="$servername"."$serverdomain" -fi -escapedserver="`echo $servername | sed 's/\/\\\//'`" - -if [ "$OT_BRANCH" = "development" ]; then - logger=":logger: backtrace" -else - logger="" -fi - -if [ "$OT_INSTALL" = "server" ]; then - aa="https:\/\/opensso.in-silico.ch" -else - aa="" -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,;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 - cd $WWW_DEST/opentox >>$LOG 2>&1 - rm -rf opentox-ruby >>$LOG 2>&1 - $GIT clone git://github.com/opentox/opentox-ruby.git >>$LOG 2>&1 - cd opentox-ruby >>$LOG 2>&1 - $GIT checkout -b $OT_BRANCH origin/$OT_BRANCH >>$LOG 2>&1 - cmd="$RAKE install" && run_cmd "$cmd" "Install" - GEM_LIB=`$GEM which opentox-ruby | sed 's/\/opentox-ruby.rb//'` - rm -rf "$GEM_LIB~" >>$LOG 2>&1 - mv "$GEM_LIB" "$GEM_LIB~" >>$LOG 2>&1 - cmd="ln -sf $WWW_DEST/opentox/opentox-ruby/lib $GEM_LIB" && run_cmd "$cmd" "Linking back" -fi - -cd "$DIR" diff --git a/ot-tools-root.sh b/ot-tools-root.sh deleted file mode 100644 index 064ea29..0000000 --- a/ot-tools-root.sh +++ /dev/null @@ -1,82 +0,0 @@ -# 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 deleted file mode 100644 index 57c6c00..0000000 --- a/ot-tools-user.sh +++ /dev/null @@ -1,83 +0,0 @@ -# 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 -} - diff --git a/packs.R b/packs.R deleted file mode 100644 index b6b1930..0000000 --- a/packs.R +++ /dev/null @@ -1,6 +0,0 @@ -# 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 deleted file mode 100644 index e0f39d4..0000000 --- a/production.yaml +++ /dev/null @@ -1,26 +0,0 @@ -:base_dir: WWW_DEST - -:services: -# make sure to enter a full uri (including training slash) - 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: - - "localhost" - - "SERVERNAME" - - "webservices.in-silico.ch" - - "opentox.informatik.uni-freiburg.de" - -:ohm_port: OHM_PORT - -# Uncomment for verbose logging -LOGGER -:logger: debug -:backtrace: true - diff --git a/redis.sh b/redis.sh deleted file mode 100755 index f07d119..0000000 --- a/redis.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -# -# Installs Redis. -# Author: Christoph Helma, Andreas Maunz. -# - -. "`pwd`/utils.sh" -DIR=`pwd` - -if [ "$(id -u)" = "0" ]; then - echo "This script must be run as non-root." 1>&2 - exit 1 -fi - -# Utils -WGET="`which wget`" -if [ ! -e "$WGET" ]; then - echo "'wget' missing. Install 'wget' first. Aborting..." - exit 1 -fi - -LOG="$HOME/tmp/`basename $0`-log.txt" - -echo -echo "Redis ('$LOG'):" - - -REDIS_DONE=false -mkdir "$REDIS_DEST" >/dev/null 2>&1 -if [ ! -d "$REDIS_DEST" ]; then - echo "Install directory '$REDIS_DEST' is not available! Aborting..." - exit 1 -else - if ! rmdir "$REDIS_DEST" >/dev/null 2>&1; then # if not empty this will fail - REDIS_DONE=true - fi -fi - -if ! $REDIS_DONE; then - echo "vm.overcommit_memory = 1" | sudo tee -a /etc/sysctl.conf >>$LOG 2>&1 - - cd $OT_PREFIX - URI="http://redis.googlecode.com/files/redis-$REDIS_VER.tar.gz" - if ! [ -d "redis-$REDIS_VER" ]; then - cmd="$WGET $URI" && run_cmd "$cmd" "Download" - cmd="tar zxf redis-$REDIS_VER.tar.gz" && run_cmd "$cmd" "Unpack" - fi - cd redis-$REDIS_VER >>$LOG 2>&1 - cmd="make" && run_cmd "$cmd" "Make" - - if ! grep "daemonize yes" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then - echo "daemonize yes" > $REDIS_SERVER_CONF 2>$LOG - fi - - if ! grep "dir `pwd`" $REDIS_SERVER_CONF >>$LOG 2>&1 ; then - echo "dir `pwd`" >> $REDIS_SERVER_CONF 2>$LOG - fi - - 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 - echo ". \"$REDIS_CONF\"" >> $OT_UI_CONF - fi - -fi - -cd "$DIR" diff --git a/ruby.sh b/ruby.sh deleted file mode 100755 index 2e53384..0000000 --- a/ruby.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Installs Ruby enterprise edition and passenger gem. -# A configuration file is created and included in your '$OT_UI_CONF'. -# Author: Christoph Helma, Andreas Maunz. -# - -. "`pwd`/utils.sh" -DIR="`pwd`" - -if [ "$(id -u)" = "0" ]; then - echo "This script must be run as non-root." 1>&2 - exit 1 -fi - -# Utils -WGET="`which wget`" -if [ ! -e "$WGET" ]; then - echo "'wget' missing. Install 'wget' first. Aborting..." - exit 1 -fi - -# Pkg -LOG="$HOME/tmp/`basename $0`-log.txt" - -echo -echo "Ruby Enterprise edition ('$RUBY_DEST', '$LOG')." - - -mkdir "$RUBY_DEST" >/dev/null 2>&1 -if [ ! -d "$RUBY_DEST" ]; then - echo "Install directory '$RUBY_DEST' is not available! Aborting..." - exit 1 -else - if ! rmdir "$RUBY_DEST" >/dev/null 2>&1; then # if not empty this will fail - RUBY_DONE=true - fi -fi - -if [ ! $RUBY_DONE ]; then - cd $HOME/tmp - URI="http://rubyenterpriseedition.googlecode.com/files/$RUBY_VER.tar.gz" - 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 $HOME/tmp/$RUBY_VER/installer --dont-install-useful-gems --no-dev-docs --auto=$RUBY_DEST" && run_cmd "$cmd" "Install" -fi - - - -if ! [ -f "$RUBY_CONF" ]; then - echo "if echo \"\$PATH\" | grep -v \"$RUBY_DEST\">/dev/null 2>&1; then export PATH=\"$RUBY_DEST/bin:\$PATH\"; fi" >> "$RUBY_CONF" - - echo "Ruby configuration has been stored in '$RUBY_CONF'." - if ! grep "$RUBY_CONF" $OT_UI_CONF >/dev/null 2>&1 ; then - echo ". \"$RUBY_CONF\"" >> $OT_UI_CONF - fi -fi -. "$RUBY_CONF" - - -GEM="`which gem`" -if [ ! -e "$GEM" ]; then - echo "'gem' missing. Install 'gem' first. Aborting..." - exit 1 -fi - -if [ "$PASSENGER_SKIP" != "s" ]; then - export PATH="$RUBY_DEST/bin:$PATH" - cmd="$GEM sources -a http://gemcutter.org" && run_cmd "$cmd" "Add Gemcutter" - cmd="$GEM sources -a http://rubygems.org" && run_cmd "$cmd" "Add Rubygems" - GEMCONF="gem: --no-ri --no-rdoc" - if ! grep "$GEMCONF" $HOME/.gemrc >>$LOG 2>&1; then - echo "$GEMCONF" | tee -a $HOME/.gemrc >>$LOG 2>&1 - fi - if ! $GEM list | grep passenger >/dev/null 2>&1; then - cmd="$GEM install passenger" && run_cmd "$cmd" "Install Passenger" - fi - -fi - -cd "$DIR" diff --git a/test-ob-rb.rb b/test-ob-rb.rb deleted file mode 100644 index 62fda1e..0000000 --- a/test-ob-rb.rb +++ /dev/null @@ -1 +0,0 @@ -require 'openbabel' |