From e6c4bf906330775c9d8a883e810b222d07430b82 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 16 Nov 2017 15:35:24 +0100 Subject: added central rserve ip --- lib/lazar.rb | 5 +++-- 1 file 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({ -- cgit v1.2.3