From 14aa03789fcb71edecf0d909df4b37e3a4013e44 Mon Sep 17 00:00:00 2001 From: davor Date: Thu, 16 Aug 2012 18:30:31 +0200 Subject: Added 4S backbone for each service. --- 4store-install | 2 +- base-install | 2 +- debian.list | 3 +++ install | 1 + ot-tools-user.sh | 42 +++++++++++++++++++++++++++++------------- utils.sh | 7 ++++--- 6 files changed, 39 insertions(+), 18 deletions(-) diff --git a/4store-install b/4store-install index c87c2d9..ee04738 100755 --- a/4store-install +++ b/4store-install @@ -25,7 +25,7 @@ cmd="make install" && run_cmd "$cmd" "Make Install" # Config echo "if echo \"\$LD_LIBRARY_PATH\" | grep -v \"$FST/lib\">/dev/null 2>&1; then export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:$FST/lib\"; fi" >> "$FST_CONF" -if ! cat "$OT_DEFAULT_CONF" | grep "four_store">/dev/null 2>&1; then echo '$four_store = { :uri => "http://localhost:8088", :user => "", :password => "" }' >> $OT_DEFAULT_CONF; fi +if ! cat "$OT_DEFAULT_CONF" | grep "four_store">/dev/null 2>&1; then echo '$four_store = { :uri => "http://localhost:9088", :user => "", :password => "" }' >> $OT_DEFAULT_CONF; fi echo "$SELF configuration has been stored in '$FST_CONF'." if ! grep "$FST_CONF" $OT_UI_CONF >/dev/null 2>&1; then diff --git a/base-install b/base-install index b3a7f6e..593bb0c 100755 --- a/base-install +++ b/base-install @@ -38,7 +38,7 @@ case "$DISTRIB_INFO" in esac sudo $DPKG --set-selections < "$PACK_LIST" -sudo $APT_GET -y -u dselect-upgrade +sudo $APT_GET -y --force-yes -u dselect-upgrade if [ ! -f $JAVA_CONF ]; then diff --git a/debian.list b/debian.list index 6093a9b..041a3b2 100644 --- a/debian.list +++ b/debian.list @@ -1,8 +1,11 @@ aptitude install automake install +avahi-daemon install build-essential install cmake install curl install +libavahi-glib-dev install +libavahi-client-dev install libglib2.0-dev install libgsl0-dev install libopenbabel4 install diff --git a/install b/install index 5105689..10c02a9 100755 --- a/install +++ b/install @@ -59,5 +59,6 @@ fi [ -f $HOME/.opentox/config/ambit_descriptors.yaml ] || (cmd="cp ambit_descriptors.yaml $HOME/.opentox/config/" && run_cmd "$cmd" "Ambit keys file") [ -f $HOME/.opentox/config/jl_keys.yaml ] || (cmd="cp jl_keys.yaml $HOME/.opentox/config/" && run_cmd "$cmd" "Joelib keys file") [ -f $OT_TOOLS_CONF ] || (cmd="cp ot-tools-user.sh $OT_TOOLS_CONF" && run_cmd "$cmd" "Created ot-tools (stored in ~/.opentox)") +if ! cat "$OT_TOOLS_CONF" | grep "OT_PREFIX=">/dev/null 2>&1; then echo "OT_PREFIX=$OT_PREFIX" >> $OT_DEFAULT_CONF; fi notify diff --git a/ot-tools-user.sh b/ot-tools-user.sh index 4564181..39f7b52 100644 --- a/ot-tools-user.sh +++ b/ot-tools-user.sh @@ -20,6 +20,18 @@ start_unicorn() { nice bash -c "nohup unicorn -p $2 >/dev/null 2>&1 &" } +# Start unicorn +# @param1 [backend_name] +# @param2 integer Port +# @example start_unicorn algorithm 8081 +start_4s() { + nice bash -c "nohup $OT_PREFIX/4S/bin/4s-backend $1 >/dev/null 2>&1 &"; + sleep 0.5; + nice bash -c "nohup $OT_PREFIX/4S/bin/4s-httpd -H localhost -p $2 -s -1 $1 >/dev/null 2>&1 &"; #-D for testing + sleep 0.5; + +} + # Start the server otstart() { if [ $# != 1 ] @@ -33,22 +45,26 @@ otstart() { otkill $1 DIR=`pwd` case "$1" in - "algorithm") start_unicorn $1 8081;; - "compound") #start_unicorn $1 8082;; + "algorithm") start_4s $1 9081; + start_unicorn $1 8081;; + "compound") #start_4s $1 9082; + #start_unicorn $1 8082;; echo "$1 not available yet.";; - "dataset") start_unicorn $1 8083;; - "feature") start_unicorn $1 8084;; - "model") #start_unicorn $1 8085;; + "dataset") start_4s $1 9083; + start_unicorn $1 8083;; + "feature") start_4s $1 9084; + start_unicorn $1 8084;; + "model") #start_4s $1 9085; + #start_unicorn $1 8085;; echo "$1 not available yet.";; - "task") start_unicorn $1 8086;; - "validation") #start_unicorn $1 8087;; + "task") start_4s $1 9086; + start_unicorn $1 8086;; + "validation") #start_4s $1 9087; + #start_unicorn $1 8087;; echo "$1 not available yet.";; - "4store") nice bash -c "nohup $HOME/opentox-ruby/4S/bin/4s-backend opentox >/dev/null 2>&1 &"; - sleep 1; - nice bash -c "nohup $HOME/opentox-ruby/4S/bin/4s-httpd -D -H localhost -p 8088 opentox >/dev/null 2>&1 &"; - sleep 1; - if ! pgrep -u $USER 4s-backend>/dev/null 2>&1; then echo "Failed to start 4s-backend."; fi - if ! pgrep -u $USER 4s-httpd>/dev/null 2>&1; then echo "Failed to start 4s-httpd."; fi;; + "4store") start_4s opentox 9088;; + #if ! pgrep -u $USER 4s-backend>/dev/null 2>&1; then echo "Failed to start 4s-backend."; fi + #if ! pgrep -u $USER 4s-httpd>/dev/null 2>&1; then echo "Failed to start 4s-httpd."; fi;; "all") otstart 4store; otstart algorithm; #otstart compound; diff --git a/utils.sh b/utils.sh index 0423786..0837f4c 100755 --- a/utils.sh +++ b/utils.sh @@ -127,10 +127,11 @@ notify() { echo if ps -o stat= -p $PPID | grep "s" >/dev/null 2>&1; then echo "IMPORTANT: How to configure your system:" - echo "IMPORTANT: a) Include '$OT_UI_CONF' in shell startup (e.g. ~/.bashrc)." - echo "IMPORTANT: b) Manually source '$OT_UI_CONF' every time." - echo "IMPORTANT: The command in both cases: '. $OT_UI_CONF'" + echo "IMPORTANT: a) Include '$OT_TOOLS_CONF' in shell startup (e.g. ~/.bashrc)." + echo "IMPORTANT: b) Manually source '$OT_TOOLS_CONF' every time." + echo "IMPORTANT: The command in both cases: '. $OT_TOOLS_CONF'" echo "IMPORTANT: NOW would be the best time to configure!" + echo "Visit 'http://opentox.github.com/General/2012/08/09/install-opentox-development-environment/' for further information about the usage of ot-tools." echo echo "Thank you for your attention." echo -- cgit v1.2.3