[Fix for Bug 2189] 10/12210/2
authormark.mozolewski <mark.mozolewski@hp.com>
Thu, 23 Oct 2014 23:55:36 +0000 (16:55 -0700)
committermark.mozolewski <mark.mozolewski@hp.com>
Mon, 27 Oct 2014 21:08:48 +0000 (14:08 -0700)
- OpenFlow Karaf features config file now references 0.2.0-Helium release instead of 0.2.0-SNAPSHOT
- Changed Jolokia hot-deploy feature template format to:
- Install bundle automatically on deploy.
- Use proper namespaces to avoid warning during Karaf startup and loading.
- Don't deploy Jolokia as featuresBoot since Karaf hot deployment is being used.
- Extract ODL release version automatically from deploy.py script's distibution parameter.

Change-Id: Id8fa19e11a0c04459ded6f7e5eac3868e74e8969
Signed-off-by: mark.mozolewski <mark.mozolewski@hp.com>
test/tools/cluster-deployer/deploy.py
test/tools/cluster-deployer/templates/openflow/jolokia.xml.template
test/tools/cluster-deployer/templates/openflow/org.apache.karaf.features.cfg.template

index a0f9a1407ba3c97533f4222853901adda6df94d4..40ccf06ec3723287d894a6baf23222bc8e22df95 100755 (executable)
@@ -36,9 +36,10 @@ import pystache
 import os
 import sys
 import random
+import re
 
 parser = argparse.ArgumentParser(description='Cluster Deployer')
-parser.add_argument("--distribution", default="", help="the absolute path of the distribution on the local host that needs to be deployed", required=True)
+parser.add_argument("--distribution", default="", help="the absolute path of the distribution on the local host that needs to be deployed. (Must contain version in the form: \"<#>.<#>.<#>-<name>\", e.g. 0.2.0-SNAPSHOT)", required=True)
 parser.add_argument("--rootdir", default="/root", help="the root directory on the remote host where the distribution is to be deployed", required=True)
 parser.add_argument("--hosts", default="", help="a comma separated list of host names or ip addresses", required=True)
 parser.add_argument("--clean", action="store_true", default=False, help="clean the deployment on the remote host")
@@ -139,6 +140,14 @@ class Deployer:
         self.replicas = replicas
 
     def deploy(self):
+        # Determine distribution version
+        distribution_name = os.path.splitext(os.path.basename(self.distribution))[0]
+        distribution_ver = re.search('(\d)\.(\d)\.(\d)-(\w)+', distribution_name)
+        if distribution_ver is None:
+            print distribution_name + " is not a valid distribution version. (Must contain version in the form: \"<#>.<#>.<#>-<name>\", e.g. 0.2.0-SNAPSHOT)"
+            sys.exit(1)
+        distribution_ver = distribution_ver.group()
+
         # Render all the templates
         renderer = TemplateRenderer(self.template)
         akka_conf = renderer.render("akka.conf.template", "akka.conf", 
@@ -151,7 +160,7 @@ class Deployer:
         )
         module_shards_conf = renderer.render("module-shards.conf.template", "module-shards.conf", self.replicas)
         modules_conf = renderer.render("modules.conf.template", "modules.conf")
-        features_cfg = renderer.render("org.apache.karaf.features.cfg.template", "org.apache.karaf.features.cfg")
+        features_cfg = renderer.render("org.apache.karaf.features.cfg.template", "org.apache.karaf.features.cfg", {"ODL_DISTRIBUTION" : distribution_ver})
         jolokia_xml = renderer.render("jolokia.xml.template", "jolokia.xml")
         management_cfg = renderer.render("org.apache.karaf.management.cfg.template", "org.apache.karaf.management.cfg", {"HOST" : self.host})
 
@@ -175,7 +184,6 @@ class Deployer:
         remote.exec_cmd("unzip " + odl_file_path + " -d " + self.dir_name + "/")
 
         # Rename the distribution directory to odl
-        distribution_name = os.path.splitext(os.path.basename(self.distribution))[0]
         remote.exec_cmd("mv " + self.dir_name + "/" + distribution_name + " " + self.dir_name + "/odl")
 
         # Copy all the generated files to the server
index 5a3756048f65f18dff19abf3fc5206ec38ba277f..be150b01305ee7001f5a5b7616339a384ef6fa60 100644 (file)
@@ -1,5 +1,9 @@
-<features>
-  <feature name="feature-jolokia">
-    <bundle>mvn:org.jolokia/jolokia-osgi/1.1.5</bundle>
-  </feature>
-</features>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="jolokia-1.1.5" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
+
+    <feature name='feature-jolokia' version='1.1.5' install="auto">
+       <bundle>mvn:org.jolokia/jolokia-osgi/1.1.5</bundle>
+    </feature>
+
+</features>
index 8b542ace5ac19597f3aea84788ddd247ccc44fd2..f0a191269fa778ce5c71192a40d230893b6cad39 100644 (file)
@@ -26,7 +26,6 @@
 #
 #respectStartLvlDuringFeatureStartup=true
 
-
 #
 # Defines if the startlvl should be respected during feature uninstall. The default value is true.
 # If true, means stop bundles respecting the descend order of start level in a certain feature.
 #
 # Comma separated list of features repositories to register by default
 #
-featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.1/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.1/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.0/xml/features,mvn:org.apache.karaf.features/spring/3.0.1/xml/features,mvn:org.opendaylight.integration/features-integration/0.2.0-SNAPSHOT/xml/features
+featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.1/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.1/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.0/xml/features,mvn:org.apache.karaf.features/spring/3.0.1/xml/features,mvn:org.opendaylight.integration/features-integration/{{ODL_DISTRIBUTION}}/xml/features
 
 #
 # Comma separated list of features to install at startup
 #
-featuresBoot=config,standard,region,package,kar,ssh,management,odl-openflowplugin-flow-services,odl-restconf,odl-mdsal-clustering,feature-jolokia
+featuresBoot=config,standard,region,package,kar,ssh,management,odl-openflowplugin-flow-services,odl-restconf,odl-mdsal-clustering
 
 #
 # Defines if the boot features are started in asynchronous mode (in a dedicated thread)