summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-08-04 18:27:25 +0200
committermr <mr@mrautenberg.de>2011-08-04 18:27:25 +0200
commit29b728125b4eaac8972cf2a102bd6b6e4dc9a0e6 (patch)
tree7490efdf294f05204487ef64178ff962b6a8c79b
parentaa021809f4de4ff32b3a59de28ebb5bc1806cb50 (diff)
parent056ebff67469b5474897f7e7abc4384dfbe3f1b4 (diff)
solve merge conflicts with release/v2.1.0
-rw-r--r--README46
-rw-r--r--aa-local.yaml3
-rw-r--r--aa-server.yaml3
-rw-r--r--[-rwxr-xr-x]base-install.sh2
-rwxr-xr-xconfig.sh2
-rwxr-xr-xenvironment_update.sh77
-rw-r--r--nginx.conf2
-rwxr-xr-xnginx.sh1
-rwxr-xr-xopenbabel.sh15
-rwxr-xr-xopentox-webservices.sh32
-rw-r--r--test-ob-rb.rb1
11 files changed, 157 insertions, 27 deletions
diff --git a/README b/README
index 6746ce7..83ddf02 100644
--- a/README
+++ b/README
@@ -31,6 +31,49 @@ 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"
+>>>>>>> release/v2.1.0
+}
+
# Start the server
otstart() {
otkill
@@ -56,4 +99,7 @@ otreload() {
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 c01c1ed..7c3bbce 100644
--- a/aa-local.yaml
+++ b/aa-local.yaml
@@ -18,13 +18,14 @@
: - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/
- "http://SERVERNAME/model"
- "http://SERVERNAME/validation"
+ - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/resources/
- !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/
? - :GET
- :POST
: - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate/
- !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/
- !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/
-
+ - !ruby/regexp /sign_(in|out)$/
? - :PUT
: - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/
diff --git a/aa-server.yaml b/aa-server.yaml
index c01c1ed..7c3bbce 100644
--- a/aa-server.yaml
+++ b/aa-server.yaml
@@ -18,13 +18,14 @@
: - !ruby/regexp /http:\/\/ESCAPEDSERVER\/algorithm/
- "http://SERVERNAME/model"
- "http://SERVERNAME/validation"
+ - !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/resources/
- !ruby/regexp /http:\/\/ESCAPEDSERVER\/validation\/[a-z,A-Z,\/,_\-]*$/
? - :GET
- :POST
: - !ruby/regexp /http:\/\/ESCAPEDSERVER\/toxcreate/
- !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/
- !ruby/regexp /http:\/\/ESCAPEDSERVER\/compound/
-
+ - !ruby/regexp /sign_(in|out)$/
? - :PUT
: - !ruby/regexp /http:\/\/ESCAPEDSERVER\/task/
diff --git a/base-install.sh b/base-install.sh
index 0a13c68..373df1f 100755..100644
--- a/base-install.sh
+++ b/base-install.sh
@@ -27,7 +27,7 @@ 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 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 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"
echo
echo "Base Packages:"
diff --git a/config.sh b/config.sh
index 5a13b3a..ae90af3 100755
--- a/config.sh
+++ b/config.sh
@@ -7,7 +7,7 @@
# 1) Base setup
OT_DIST="debian" # Linux distribution (debian)
OT_INSTALL="local" # Type (gem, local, server)
-OT_BRANCH="master" # Maturity (development, master)
+OT_BRANCH="development" # Maturity (development, master)
# 2) Where all binaries are installed.
OT_PREFIX="$HOME/opentox-ruby"
diff --git a/environment_update.sh b/environment_update.sh
new file mode 100755
index 0000000..d0beae4
--- /dev/null
+++ b/environment_update.sh
@@ -0,0 +1,77 @@
+#!/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."
diff --git a/nginx.conf b/nginx.conf
index d3a8324..c89efe2 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -10,7 +10,7 @@ http {
passenger_root RUBY_DEST/lib/ruby/gems/1.8/gems/PASSENGER;
passenger_ruby RUBY_DEST/bin/ruby;
- passenger_default_user opentox;
+ passenger_default_user USER;
passenger_log_level 2;
passenger_spawn_method conservative;
#passenger_use_global_queue on;
diff --git a/nginx.sh b/nginx.sh
index 6b10a5c..800165e 100755
--- a/nginx.sh
+++ b/nginx.sh
@@ -52,6 +52,7 @@ cd - >>$LOG 2>&1
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"
cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy"
if [ ! -f $NGINX_CONF ]; then
diff --git a/openbabel.sh b/openbabel.sh
index 3257146..4e55ff8 100755
--- a/openbabel.sh
+++ b/openbabel.sh
@@ -86,14 +86,15 @@ else
fi
fi
-if ! $OB_DONE ; then
- cd "/tmp/$OB_VER/scripts/ruby/"
+#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 -s $OB_DEST_BINDINGS/openbabel.so $RUBY_DEST/lib/ruby/site_ruby/1.8/`uname -m`-linux/" && run_cmd "$cmd" "Link"
-fi
-
-cd "$DIR"
-
+ 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-webservices.sh b/opentox-webservices.sh
index fa589cd..ef98ded 100755
--- a/opentox-webservices.sh
+++ b/opentox-webservices.sh
@@ -31,6 +31,12 @@ if [ ! -e "$GIT" ]; then
exit 1
fi
+RUBY="`which ruby`"
+if [ ! -e "$RUBY" ]; then
+ echo "'ruby' missing. Install 'ruby' first. Aborting..."
+ exit 1
+fi
+
LOG="/tmp/`basename $0`-log.txt"
echo
@@ -55,35 +61,31 @@ for s in compound dataset algorithm model toxcreate task validation; do
cd - >>$LOG 2>&1
done
-# validation service
-#git clone http://github.com/mguetlein/opentox-validation.git validation
-#cd /var/www/opentox/validation
-#git checkout -t origin/test
-#gem install ruby-plot
-#mkdir -p public
-#ln -s /var/www/opentox/validation/public /var/www/validation
-
# fminer etc
cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present"
cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1
cmd="$GIT submodule init" && run_cmd "$cmd" "Fminer Init"
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 "libfminer/liblast">>$LOG 2>&1
+$GIT checkout $OT_BRANCH>>$LOG 2>&1
+$GIT pull >>$LOG 2>&1
+cd -
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
-$GIT checkout master >>$LOG 2>&1
-$GIT pull >>$LOG 2>&1
cmd="make ruby" && run_cmd "$cmd" "Make BBRC"
-cd ->>$LOG 2>&1
+cd -
cd "libfminer/liblast">>$LOG 2>&1
-$GIT checkout master >>$LOG 2>&1
-$GIT pull >>$LOG 2>&1
cmd="make ruby" && run_cmd "$cmd" "Make LAST"
-cd ->>$LOG 2>&1
+cd -
cd "last-utils">>$LOG 2>&1
-$GIT checkout master >>$LOG 2>&1
+$GIT checkout $OT_BRANCH>>$LOG 2>&1
$GIT pull >>$LOG 2>&1
cd "$DIR"
diff --git a/test-ob-rb.rb b/test-ob-rb.rb
new file mode 100644
index 0000000..62fda1e
--- /dev/null
+++ b/test-ob-rb.rb
@@ -0,0 +1 @@
+require 'openbabel'