summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavor <vorgrimmlerdavid@gmx.de>2012-08-21 13:09:02 +0200
committerdavor <vorgrimmlerdavid@gmx.de>2012-08-21 13:09:02 +0200
commitf87da673e2437e2728b31c84b2ae1cfdf05915c5 (patch)
tree66584c614c9e41198c710ad5edff520640dac2a5
parent7abdddfff98586b8205eb55d9b0865dd17af0975 (diff)
parent19687a8ad8d01a6e525d03e52ef75ebd9f932303 (diff)
Merge branch 'builddep' into development
Conflicts: 4store-install base-install config.sh utils.sh
-rwxr-xr-x4store-install2
-rwxr-xr-xbase-install12
-rwxr-xr-xconfig.sh12
-rw-r--r--debian.list34
-rwxr-xr-xinstall7
-rw-r--r--ot-tools-user.sh65
-rwxr-xr-xraptor2-install3
-rwxr-xr-xrasqal-install2
-rw-r--r--ubuntu.list34
-rwxr-xr-xutils.sh11
10 files changed, 103 insertions, 79 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 c7d717e..6e549d8 100755
--- a/base-install
+++ b/base-install
@@ -13,12 +13,20 @@ DIR=`pwd`
# Not logged
# Not logged
[ "`id -u`" = "0" ] && echo "This script must not be run as root" 1>&2 && exit 1
-check_utils "aptitude apt-get apt-cache dpkg"
+check_utils "aptitude apt-get apt-key apt-cache dpkg tee wget"
echo
echo "Base Packages:"
echo
echo "Updating index..."
+
+cmd="$WGET -O redland_key.asc $REDLAND_APT_KEY >/dev/null 2>&1" && run_cmd "$cmd" "Download redland apt-key"
+cmd="$APT_KEY add redland_key.asc >/dev/null 2>&1; rm redland_key.asc" && run_cmd "$cmd" "Adding redland apt-key"
+if ! cat "/etc/apt/sources.list" | grep "$REDLAND_DEB">/dev/null 2>&1; then
+ echo "deb $REDLAND_DEB ./" | sudo $TEE -a /etc/apt/sources.list >/dev/null
+ echo "deb-src $REDLAND_DEB ./" | sudo $TEE -a /etc/apt/sources.list >/dev/null
+fi
+
sudo $APTITUDE update -y >/dev/null 2>&1
DISTRIB_INFO=$(cat /proc/version)
@@ -30,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/config.sh b/config.sh
index dbc42e6..8ca0d2e 100755
--- a/config.sh
+++ b/config.sh
@@ -5,7 +5,7 @@
# 1) Base setup
-OT_DIST="debian" # Linux distribution (debian)
+OT_DIST="debian" # Linux distribution (debian, ubuntu)
OT_INSTALL="local" # Type (gem, local, server)
OT_BRANCH="development" # Maturity (development -need SSH key at Github-, master)
@@ -19,10 +19,11 @@ OB_NUM_VER="2.3.1"
RAPTOR2_NUM_VER="2.0.8"
RASQAL_NUM_VER="0.9.29"
RUBY_NUM_VER="1.9.3-p194"
+REDLAND_DWL="http://download.librdf.org"
+REDLAND_APT_KEY="http://purl.org/net/dajobe/gnupg.asc"
# Done.
-
### Nothing to gain from changes below this line.
JAVA_CONF="$HOME/.opentox/java.sh"
FST_CONF="$HOME/.opentox/4S.sh"
@@ -39,9 +40,8 @@ RAPTOR2_VER="raptor2-$RAPTOR2_NUM_VER"
RASQAL_VER="rasqal-$RASQAL_NUM_VER"
OB_DEST="$OT_PREFIX/$OB_VER"
OB_DEST_BINDINGS="$OT_PREFIX/openbabel-ruby-install"
-
-RAPTOR2_DWL="http://download.librdf.org/source/$RAPTOR2_VER.tar.gz"
-RASQAL_DWL="http://download.librdf.org/source/$RASQAL_VER.tar.gz"
RUBY_DWL="http://ftp.ruby-lang.org/pub/ruby/1.9"
RUBY_DIR="$HOME/.rbenv/versions/$RUBY_NUM_VER"
-
+RAPTOR2_DWL="$REDLAND_DWL/source/$RAPTOR2_VER.tar.gz"
+RASQAL_DWL="$REDLAND_DWL/source/$RASQAL_VER.tar.gz"
+REDLAND_DEB="$REDLAND_DWL/binaries/$OT_DIST/unstable"
diff --git a/debian.list b/debian.list
index d16ee3f..73be6d9 100644
--- a/debian.list
+++ b/debian.list
@@ -1,25 +1,25 @@
+aptitude install
+automake install
+avahi-daemon install
build-essential install
cmake install
-libgsl0-dev install
-libtool install
-openjdk-6-jdk install
-r-base install
-r-base-dev install
-libpcre3-dev install
-librasqal3-dev install
-libtool install
+curl install
+libavahi-glib-dev install
+libavahi-client-dev install
libglib2.0-dev install
-ncurses-dev install
-libreadline-dev install
-uuid-dev install
-libraptor1-dev install
+libgsl0-dev install
libopenbabel4 install
libopenbabel-dev install
-automake install
-libyaml-dev install
libopenssl-ruby install
+libpcre3-dev install
+libraptor1-dev install
+libreadline-dev install
libssl-dev install
+libtool install
libxml2-dev install
-libssl-dev install
-curl install
-aptitude install
+libyaml-dev install
+ncurses-dev install
+openjdk-6-jdk install
+r-base-dev install
+r-base install
+uuid-dev install
diff --git a/install b/install
index 9046987..fce99dc 100755
--- a/install
+++ b/install
@@ -37,9 +37,8 @@ sudo echo -n ""
echo
[ -f $OT_PREFIX/install/utils.sh ] || (cmd="mkdir -p $OT_PREFIX/install && cp utils.sh $OT_PREFIX/install" && run_cmd "$cmd" "Install utils.sh to OT_PREFIX")
-[ -f $HOME/.opentox/config/install/config.sh ] || (cmd="mkdir -p $HOME/.opentox/config/install && cp config.sh $HOME/.opentox/config/install" && run_cmd "$cmd" "Install config.sh to CONFIG (~/.opentox/config)")
-[ -f $OT_DEFAULT_CONF ] || (cmd="echo '\$aa = { :uri => nil }' > $OT_DEFAULT_CONF" && run_cmd "$cmd" "Install default.rb to CONFIG (~/.opentox/config)")
-
+[ -f $HOME/.opentox/config/install/config.sh ] || (cmd="mkdir -p $HOME/.opentox/config/install && cp config.sh $HOME/.opentox/config/install" && run_cmd "$cmd" "Install config.sh to CONFIG (~/.opentox/config/install)")
+[ -f $OT_DEFAULT_CONF ] || (cmd="echo '\$aa = { :uri => nil }' > $OT_DEFAULT_CONF" && run_cmd "$cmd" "Created default.rb service settings (stored in ~/.opentox/config)")
. ./base-install # Debian specific; disable this for others.
./raptor2-install # Download, compile and build raptor2. Install to OT_PREFIX.
@@ -59,7 +58,7 @@ 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" "Install ot-tools.sh to CONFIG (~/.opentox/config)")
+[ -f $OT_TOOLS_CONF ] || (cmd="cp ot-tools-user.sh $OT_TOOLS_CONF" && run_cmd "$cmd" "Created ot-tools (stored in ~/.opentox)")
# Install global ruby version
diff --git a/ot-tools-user.sh b/ot-tools-user.sh
index ca3bdbd..d60a26e 100644
--- a/ot-tools-user.sh
+++ b/ot-tools-user.sh
@@ -3,6 +3,7 @@
# Load server config
otconfig() {
source $HOME/.opentox/opentox-ui.sh
+ source $HOME/.opentox/config/install/config.sh
}
# Display log
@@ -20,6 +21,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,25 +46,28 @@ 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;;
+ "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.";;
- "dataset") start_unicorn $1 8083;;
- "feature") start_unicorn $1 8084;;
- "model") #start_unicorn $1 8085;;
+ "task") start_4s $1 9086;
+ start_unicorn $1 8086;;
+ "validation") #start_4s $1 9087;
+ #start_unicorn $1 8087;;
echo "$1 not available yet.";;
- "task") start_unicorn $1 8086;;
- "validation") #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;
+ otstart compound;
otstart dataset;
otstart feature;
#otstart model;
@@ -61,6 +77,7 @@ otstart() {
echo "usage: otstart [all|algorithm|compound|dataset|feature|model|task|validation|4store]";
return 1;;
esac
+ sleep 1
cd $DIR
}
@@ -94,8 +111,7 @@ otreload() {
otconfig
case "$1" in
"algorithm") reload_unicorn 8081;;
- "compound") #reload_unicorn 8082;;
- echo "$1 not available yet.";;
+ "compound") reload_unicorn 8082;;
"dataset") reload_unicorn 8083;;
"feature") reload_unicorn 8084;;
"model") #reload_unicorn 8085;;
@@ -107,7 +123,7 @@ otreload() {
#killall 4s-backend >/dev/null 2>&1;;
echo "$1 reload not available yet.";;
"all") otreload algorithm;
- #otreload compound;
+ otreload compound;
otreload dataset;
otreload feature;
#otreload model;
@@ -118,6 +134,7 @@ otreload() {
echo "usage: otreload [all|algorithm|compound|dataset|feature|model|task|validation|4store]";
return 1;;
esac
+ sleep 1
}
# kill unicorn
@@ -139,8 +156,7 @@ otkill() {
otconfig
case "$1" in
"algorithm") kill_unicorn 8081;;
- "compound") #kill_unicorn 8082;;
- echo "$1 not available yet.";;
+ "compound") kill_unicorn 8082;;
"dataset") kill_unicorn 8083;;
"feature") kill_unicorn 8084;;
"model") #kill_unicorn 8085;;
@@ -151,7 +167,7 @@ otkill() {
"4store") killall 4s-httpd >/dev/null 2>&1;
killall 4s-backend >/dev/null 2>&1;;
"all") otkill algorithm;
- #otkill compound;
+ otkill compound;
otkill dataset;
otkill feature;
#otkill model;
@@ -162,6 +178,7 @@ otkill() {
echo "usage: otkill [all|algorithm|compound|dataset|feature|model|task|validation|4store]";
return 1;;
esac
+ sleep 1
}
# get service uri
@@ -232,8 +249,7 @@ otcheck() {
otconfig
case "$1" in
"algorithm") check_service "algorithm";;
- "compound") #check_service "compound";;
- echo "$1 not available yet.";;
+ "compound") check_service "compound";;
"dataset") check_service "dataset";;
"feature") check_service "feature";;
"model") #check_service "model";;
@@ -242,9 +258,8 @@ otcheck() {
"validation") #check_service "validation";;
echo "$1 not available yet.";;
"4store") check_service "four_store";;
- #killall 4s-backend >/dev/null 2>&1;;
"all") otcheck "algorithm";
- #otcheck "compound";
+ otcheck "compound";
otcheck "dataset";
otcheck "feature";
#otcheck "model";
diff --git a/raptor2-install b/raptor2-install
index ad44ed4..4d3be2e 100755
--- a/raptor2-install
+++ b/raptor2-install
@@ -5,7 +5,7 @@ DIR=`pwd`
. ./utils.sh || (echo "Utils could not be loaded, check opentox-ui.sh." 1>&2 && exit 1)
SELF=$(basename $0 -install)
check_log $SELF
-check_utils "wget tar make grep"
+check_utils "apt-get wget tar make grep"
# Build
mkdir -p $OT_PREFIX/tmp
@@ -15,6 +15,7 @@ export RAPTOR2_DIR=$OT_PREFIX/$SELF
cmd="$TAR xvzf $RAPTOR2_VER.tar.gz" && run_cmd "$cmd" "Unpack"
rm $RAPTOR2_VER.tar.gz
cd $RAPTOR2_VER
+cmd="sudo $APT_GET -y build-dep $SELF" && run_cmd "$cmd" "Build dependencies"
cmd="./configure --prefix=$RAPTOR2_DIR" && run_cmd "$cmd" "Configure"
cmd="$MAKE" && run_cmd "$cmd" "Make"
cmd="$MAKE install" && run_cmd "$cmd" "Make Install"
diff --git a/rasqal-install b/rasqal-install
index bc06450..8bd9fbd 100755
--- a/rasqal-install
+++ b/rasqal-install
@@ -5,7 +5,7 @@ DIR=`pwd`
. ./utils.sh || (echo "Utils could not be loaded, check opentox-ui.sh." 1>&2 && exit 1)
SELF=$(basename $0 -install)
check_log $SELF
-check_utils "wget tar make grep"
+check_utils "apt-get wget tar make grep"
# Build
mkdir -p $OT_PREFIX/tmp
diff --git a/ubuntu.list b/ubuntu.list
index d16ee3f..73be6d9 100644
--- a/ubuntu.list
+++ b/ubuntu.list
@@ -1,25 +1,25 @@
+aptitude install
+automake install
+avahi-daemon install
build-essential install
cmake install
-libgsl0-dev install
-libtool install
-openjdk-6-jdk install
-r-base install
-r-base-dev install
-libpcre3-dev install
-librasqal3-dev install
-libtool install
+curl install
+libavahi-glib-dev install
+libavahi-client-dev install
libglib2.0-dev install
-ncurses-dev install
-libreadline-dev install
-uuid-dev install
-libraptor1-dev install
+libgsl0-dev install
libopenbabel4 install
libopenbabel-dev install
-automake install
-libyaml-dev install
libopenssl-ruby install
+libpcre3-dev install
+libraptor1-dev install
+libreadline-dev install
libssl-dev install
+libtool install
libxml2-dev install
-libssl-dev install
-curl install
-aptitude install
+libyaml-dev install
+ncurses-dev install
+openjdk-6-jdk install
+r-base-dev install
+r-base install
+uuid-dev install
diff --git a/utils.sh b/utils.sh
index e06be5d..3b39b1e 100755
--- a/utils.sh
+++ b/utils.sh
@@ -77,8 +77,8 @@ install_ruby() {
local DIR=`pwd`
check_utils "rbenv curl make tar"
if ! $RBENV versions $RUBY_NUM_VER | grep $RUBY_NUM_VER>/dev/null 2>&1; then
- [ -d $DIR/tmp ] || mkdir -p $DIR/tmp && cd $DIR/tmp
- ([ -d $DIR/tmp/ruby-$RUBY_NUM_VER ] || $CURL $RUBY_DWL/ruby-$RUBY_NUM_VER.tar.gz 2>/dev/null | $TAR xz) && cd ruby-$RUBY_NUM_VER
+ [ -d $OT_PREFIX/tmp ] || mkdir -p $OT_PREFIX/tmp && cd $OT_PREFIX/tmp
+ ([ -d $OT_PREFIX/tmp/ruby-$RUBY_NUM_VER ] || $CURL $RUBY_DWL/ruby-$RUBY_NUM_VER.tar.gz 2>/dev/null | $TAR xz) && cd ruby-$RUBY_NUM_VER
cmd="./configure --prefix=$RUBY_DIR" && run_cmd "$cmd" "Configure"
cmd="$MAKE -j2" && run_cmd "$cmd" "Make"
cmd="$MAKE install" && run_cmd "$cmd" "Install"
@@ -137,10 +137,11 @@ notify() {
echo
if ps -o stat= -p $PPID | grep "s" >/dev/null 2>&1; then
echo "IMPORTANT: How to configure your system if everything went fine:"
- 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