diff options
author | gebele <gebele@in-silico.ch> | 2017-11-16 15:35:24 +0100 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2017-11-16 15:35:24 +0100 |
commit | e6c4bf906330775c9d8a883e810b222d07430b82 (patch) | |
tree | a61572d632a779e549cf8f9585beb18bc1d7a6a3 /lib/lazar.rb | |
parent | 382a7ebb0f3c8c0f44d81d0a257a2851bca70009 (diff) |
added central rserve ip
Diffstat (limited to 'lib/lazar.rb')
-rw-r--r-- | lib/lazar.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lazar.rb b/lib/lazar.rb index 5bcfadf..7133d56 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -19,7 +19,7 @@ ENV["MONGOID_ENV"] = ENV["LAZAR_ENV"] ENV["RACK_ENV"] = ENV["LAZAR_ENV"] # should set sinatra environment # search for a central mongo database in use # http://opentox.github.io/installation/2017/03/07/use-central-mongodb-in-docker-environment -CENTRAL_MONGO_IP = ''#`grep -oP '^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(?=.*mongodb)' /etc/hosts`.chomp +CENTRAL_MONGO_IP = `grep -oP "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(?=.*mongodb)" /etc/hosts`.chomp Mongoid.load_configuration({ :clients => { :default => { @@ -48,8 +48,9 @@ end #rlib = File.expand_path(File.join(File.dirname(__FILE__),"..","R")) # should work on POSIX including os x # http://stackoverflow.com/questions/19619582/number-of-processors-cores-in-command-line +CENTRAL_RSERVE_IP = `grep -oP "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(?=.*rserve)" /etc/hosts`.chomp NR_CORES = `getconf _NPROCESSORS_ONLN`.to_i -R = Rserve::Connection.new +R = Rserve::Connection.new( CENTRAL_RSERVE_IP.blank? ? "127.0.0.1" : CENTRAL_RSERVE_IP) =begin R.eval " suppressPackageStartupMessages({ |