You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2016/07/01 22:42:38 UTC

svn commit: r1751010 - in /uima/uima-ducc/trunk/src/main: admin/ducc_install admin/ducc_post_install admin/ducc_update admin/ducc_util.py resources/default.ducc.properties scripts/properties.py

Author: burn
Date: Fri Jul  1 22:42:38 2016
New Revision: 1751010

URL: http://svn.apache.org/viewvc?rev=1751010&view=rev
Log:
UIMA-4994 Rename ducc_install as ducc_update to match existing one; improve migration

Added:
    uima/uima-ducc/trunk/src/main/admin/ducc_update
      - copied, changed from r1750855, uima/uima-ducc/trunk/src/main/admin/ducc_install
Removed:
    uima/uima-ducc/trunk/src/main/admin/ducc_install
Modified:
    uima/uima-ducc/trunk/src/main/admin/ducc_post_install
    uima/uima-ducc/trunk/src/main/admin/ducc_util.py
    uima/uima-ducc/trunk/src/main/resources/default.ducc.properties
    uima/uima-ducc/trunk/src/main/scripts/properties.py

Modified: uima/uima-ducc/trunk/src/main/admin/ducc_post_install
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/ducc_post_install?rev=1751010&r1=1751009&r2=1751010&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/ducc_post_install (original)
+++ uima/uima-ducc/trunk/src/main/admin/ducc_post_install Fri Jul  1 22:42:38 2016
@@ -296,15 +296,6 @@ class PostInstall():
         nf.close()
         print "Initial", nodes, "created."
             
-        jdnodes = self.DUCC_HOME +  "/resources/jobdriver.nodes"
-        self.mkbackup(jdnodes)
-
-        rn = open(jdnodes, "w")
-        rn.write(self.localhost)
-        rn.close()
-        print "Initial nodepool", jdnodes, "created.\n"
-        
-
     def merge_properties(self):
         # first task, always, merge the properties so subsequent code can depend on their validity.
         base_props = self.DUCC_HOME + '/resources/default.ducc.properties'

Copied: uima/uima-ducc/trunk/src/main/admin/ducc_update (from r1750855, uima/uima-ducc/trunk/src/main/admin/ducc_install)
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/ducc_update?p2=uima/uima-ducc/trunk/src/main/admin/ducc_update&p1=uima/uima-ducc/trunk/src/main/admin/ducc_install&r1=1750855&r2=1751010&rev=1751010&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/ducc_install (original)
+++ uima/uima-ducc/trunk/src/main/admin/ducc_update Fri Jul  1 22:42:38 2016
@@ -52,7 +52,7 @@ global modifiableDirectories
 global lenRuntime
 
 def usage():
-    print "Usage: ducc_install   ducc-binary-tarfile  ducc-runtime"
+    print "Usage: ducc_update   ducc_runtime  ducc-binary-tarfile"
     print ""
     print "  Installs or updates DUCC at 'ducc_runtime' from the build in 'ducc-binary-tarfile'"
     print "   If there is no existing runtime a fresh installation will be placed in 'ducc_runtime'"
@@ -225,7 +225,7 @@ def update_directory(olddir, newdir, arc
 #-----------------------------------------------------------------------------------------
 
 # List of customizable files that must not be replaced
-preserveFiles = [ 'ducc.classes', 'ducc.administrators', 'ducc.nodes', 'jobdriver.nodes',
+preserveFiles = [ 'ducc.classes', 'ducc.administrators', 'ducc.nodes',
                   'local_hooks.py', 'keystore', 'site.jsp', 'ducc.local.js' ]
 
 # List of directories all of whose files nust not be replaced
@@ -242,8 +242,8 @@ if len(sys.argv) != 3:
     usage()
     exit(1)
 
-tarfile = sys.argv[1]
-rtime   = sys.argv[2]
+rtime   = sys.argv[1]
+tarfile = sys.argv[2]
 runtime = os.path.realpath(rtime)
 
 if not os.path.exists(tarfile):
@@ -304,6 +304,7 @@ if not os.path.exists(weblogdir):
 
 #-----------------------------------------------------------------------------------------
 # Create a site.ducc.properties file if missing ... only for DUCC 1.1.0
+# Archive original ducc.properties for safety
 #-----------------------------------------------------------------------------------------
 siteProps = os.path.join(runtime, 'resources/site.ducc.properties')
 if not os.path.exists(siteProps):
@@ -311,6 +312,11 @@ if not os.path.exists(siteProps):
         print "Missing site.ducc.properties - can only be created for 1.1.0"
         exit(9)
     currentProps = os.path.join(runtime, 'resources/ducc.properties')
+    archdir = os.path.join(archive,'resources')
+    if not os.path.exists(archdir):
+        os.mkdir(archdir)
+    shutil.copy(currentProps, archdir)
+
     originalProps = os.path.join(runtime, 'resources/ducc-1.1.0.properties')
     create_110_properties(os.path.realpath(sys.argv[0]), originalProps)
 
@@ -360,6 +366,20 @@ if (rc != 0):
 print "\n", " --- Installation completed!"
 print "     NOTE - if your ducc_ling is privileged you should update it" 
 
+#-----------------------------------------------------------------------------------------
+# Warn if DB disabled
+#-----------------------------------------------------------------------------------------
+siteprops = runtime + '/resources/site.ducc.properties'
+dbcreated = False
+with open(siteprops) as f:
+    for line in f:
+        if line.startswith("ducc.database.host"):
+            dbcreated = True
+            break
+if not dbcreated:
+    print "   WARNING - The database has not yet been created - DUCC will have reduced functionality."
+    print "             Run db_create then db_loader to convert existing state and history"
+
 #->->->->->->->   DO NOT CHANGE ANYTHING BELOW THIS MARKER <-<-<-<-<-<-<-
 #=====MARKER===== The following are the original ducc.properties shipped with DUCC 1.1.0 
 #head=<head-node>

Modified: uima/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1751010&r1=1751009&r2=1751010&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/uima-ducc/trunk/src/main/admin/ducc_util.py Fri Jul  1 22:42:38 2016
@@ -355,10 +355,6 @@ class DuccUtil(DuccBase):
     def ssh(self, host, do_wait, *CMD):
 
         cmd = ' '.join(CMD)
-        if ( host == self.localhost ):
-            if (cmd[0] == "" and cmd[-1] == ""):
-                cmd = cmd[1:len(cmd)-2]
-                return self.popen(cmd)
         if ( do_wait ):
             return self.popen('ssh -q -o BatchMode=yes -o ConnectTimeout=10', host, cmd)
         else:

Modified: uima/uima-ducc/trunk/src/main/resources/default.ducc.properties
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/resources/default.ducc.properties?rev=1751010&r1=1751009&r2=1751010&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/resources/default.ducc.properties (original)
+++ uima/uima-ducc/trunk/src/main/resources/default.ducc.properties Fri Jul  1 22:42:38 2016
@@ -567,8 +567,8 @@ ducc.flow-controller.specifier=org.apach
 
 # DATABASE PROPERTIES
 
-# Name of the database host - default is to not use a database
-# May be overridden in site.ducc.properties by ducc_post_install
+# Name of the database host - initially disabled until database is created.
+# Overridden in site.ducc.properties by ducc_post_install or db_create.
 ducc.database.host            = --disabled--
 
 # Database JMX host. Default is to allow only local JMX access.  Specify the real name for remote access.

Modified: uima/uima-ducc/trunk/src/main/scripts/properties.py
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/scripts/properties.py?rev=1751010&r1=1751009&r2=1751010&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/scripts/properties.py (original)
+++ uima/uima-ducc/trunk/src/main/scripts/properties.py Fri Jul  1 22:42:38 2016
@@ -76,10 +76,10 @@ class Properties:
 
 
     #
-    # Expand all ${} values from env or from this properties file itself
-    # The search order is:
+    # Expand all ${} values. The search order is:
     #    1 look in this properties file
     #    2 look in the environment
+    #    3 look in a subset of the Java system properties (os.name & os.arch)
     #
     def do_subst(self, st):
         key = None