You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2013/02/04 23:38:03 UTC

svn commit: r1442410 - in /uima/sandbox/uima-ducc/trunk/src/main: admin/ducc_util.py admin/start_ducc resources/ducc.properties

Author: challngr
Date: Mon Feb  4 22:38:03 2013
New Revision: 1442410

URL: http://svn.apache.org/viewvc?rev=1442410&view=rev
Log:
UIMA-2584
Remove junk line from ducc.properties.
Cleanup start and stop of ActiveMQ if user doesn't have JAVA_HOME in environment.

Modified:
    uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
    uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc
    uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties

Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1442410&r1=1442409&r2=1442410&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py Mon Feb  4 22:38:03 2013
@@ -186,6 +186,10 @@ class DuccUtil:
         self.duccling       = self.ducc_properties.get('ducc.agent.launcher.ducc_spawn_path')
         self.webserver_node = self.ducc_properties.get('ducc.ws.node')
         self.jvm            = self.ducc_properties.get('ducc.jvm')
+        ndx = self.jvm.rindex('/')
+        ndx = self.jvm.rindex('/', 0, ndx)
+        self.jvm_home = self.jvm[:ndx]
+
         # self.broker_url     = self.ducc_properties.get('ducc.broker.url')
         self.broker_protocol   = self.ducc_properties.get('ducc.broker.protocol')
         self.broker_host       = self.ducc_properties.get('ducc.broker.hostname')
@@ -213,6 +217,9 @@ class DuccUtil:
     def java(self):
         return self.jvm
         
+    def java_home(self):
+        return self.jvm_home
+        
     def is_amq_active(self):
         lines = self.popen('ssh', self.broker_host, 'netstat -an')
         #
@@ -234,6 +241,7 @@ class DuccUtil:
         here = os.getcwd()
         CMD = broker_home + '/bin/activemq'
         CMD = CMD + ' stop'
+        CMD = 'JAVA_HOME=' + self.java_home() + ' ' + CMD
         print CMD
         self.ssh(broker_host, False, CMD)
         pass
@@ -329,9 +337,16 @@ class DuccUtil:
         ducc_home = self.DUCC_HOME
         LIB       = ducc_home + '/lib'
         RESOURCES = ducc_home + '/resources'
+
+        local_jars  = self.ducc_properties.get('ducc.local.jars')   #local mods
     
         CLASSPATH = ''
     
+        if ( local_jars != None ):
+            extra_jars = local_jars.split()
+            for j in extra_jars:
+                CLASSPATH = CLASSPATH + ':' + LIB + '/' + j
+            
         CLASSPATH = CLASSPATH + ":" + LIB + '/apache-activemq/*'
         CLASSPATH = CLASSPATH + ":" + LIB + '/apache-commons/*'
         CLASSPATH = CLASSPATH + ":" + LIB + '/apache-commons-lang/*'
@@ -731,10 +746,13 @@ class DuccUtil:
         self.default_nodefiles = [self.DUCC_HOME + '/resources/ducc.nodes']
         self.propsfile = self.DUCC_HOME + '/resources/ducc.properties'
         self.localhost = os.uname()[1]                
+        self.read_properties()       
+
+        os.environ['JAVA_HOME'] = self.java_home()
         os.environ['NodeName'] = self.localhost    # to match java code's implicit propery so script and java match
+
         self.pid_file  = self.DUCC_HOME + '/state/ducc.pids'
         self.set_classpath()
-        self.read_properties()       
         self.os_pagesize = self.get_os_pagesize()
 
         manage_broker = self.ducc_properties.get('ducc.broker.automanage')

Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc?rev=1442410&r1=1442409&r2=1442410&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc Mon Feb  4 22:38:03 2013
@@ -44,7 +44,7 @@ class StartDucc(DuccUtil):
             line = lines.readline().strip()
             if ( not line ):
                 break
-            print '[] ' + line
+            #print '[] ' + line
             if ( line.startswith('PID') ):
                 toks = line.split(' ')    # get the PID
                 print "Broker on", broker_host, 'PID', toks[1]

Modified: uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties?rev=1442410&r1=1442409&r2=1442410&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties Mon Feb  4 22:38:03 2013
@@ -43,13 +43,6 @@ ducc.broker.server.url.decoration = tran
 # To enable tracing of RM messages arriving in OR and NodeMetrics arriving in WS.
 #ducc.transport.trace = orchestrator:RmStateDuccEvent webserver:NodeMetricsUpdateDuccEvent
 
-#
-# This specifies the path and parameters needed to start activeMQ.  The default starts
-# the activeMQ that is embedded with DUCC. Change this if you wish to run your own
-# activeMQ.  Set to NONE if you do not want DUCC to start the broker when DUCC itself
-# is started.
-ducc.broker.startup = default amq starter
-
 ducc.cluster.name=Apache UIMA-DUCC
 
 ducc.authentication.implementer=com.ibm.ducc.authentication.AuthenticationManager