summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTelles Nobrega <tenobreg@redhat.com>2018-06-25 08:57:07 -0300
committerTelles Nobrega <tenobreg@redhat.com>2018-07-12 15:18:55 -0300
commitb6504eee922b2ed00d611a8e1bb24bfc7c060884 (patch)
treee957c8686cff7af33cd75c7aba682b7a121d9a48
parentb23abe2f96b591db5f6d8fe1c1f08bbd22c7666d (diff)
Adding Storm 1.2.0 and 1.2.1
Adding new versions of Storm to sahara. Change-Id: I7f4a96f2dc8cb66468866f77e3d4091d2a8d19d1
Notes
Notes (review): Code-Review+2: Jeremy Freudberg <jeremyfreudberg@gmail.com> Code-Review+2: Luigi Toscano <ltoscano@redhat.com> Workflow+1: Luigi Toscano <ltoscano@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 13 Jul 2018 14:39:27 +0000 Reviewed-on: https://review.openstack.org/577815 Project: openstack/sahara Branch: refs/heads/master
-rw-r--r--releasenotes/notes/storm-1.2-af75fedb413de56a.yaml4
-rw-r--r--sahara/plugins/storm/config_helper.py7
-rw-r--r--sahara/plugins/storm/edp_engine.py4
-rw-r--r--sahara/plugins/storm/plugin.py3
-rw-r--r--sahara/tests/unit/plugins/storm/test_config_helper.py9
-rw-r--r--sahara/tests/unit/plugins/storm/test_plugin.py24
6 files changed, 40 insertions, 11 deletions
diff --git a/releasenotes/notes/storm-1.2-af75fedb413de56a.yaml b/releasenotes/notes/storm-1.2-af75fedb413de56a.yaml
new file mode 100644
index 0000000..307270b
--- /dev/null
+++ b/releasenotes/notes/storm-1.2-af75fedb413de56a.yaml
@@ -0,0 +1,4 @@
1---
2upgrade:
3 - Adding new versions of Storm, 1.2.0 and 1.2.1. Both will exist under the
4 same tag 1.2.
diff --git a/sahara/plugins/storm/config_helper.py b/sahara/plugins/storm/config_helper.py
index f69fc7b..e602077 100644
--- a/sahara/plugins/storm/config_helper.py
+++ b/sahara/plugins/storm/config_helper.py
@@ -56,12 +56,11 @@ def generate_storm_config(master_hostname, zk_hostnames, version):
56 "storm.local.dir": "/app/storm" 56 "storm.local.dir": "/app/storm"
57 } 57 }
58 58
59 # Since pyleus is built using previous versions os Storm we need this 59 # Since pyleus is built using previous versions of Storm we need this
60 # option to allow the cluster to be compatible with pyleus topologies as 60 # option to allow the cluster to be compatible with pyleus topologies as
61 # well as with topologies built using older versions of Storm 61 # well as with topologies built using older versions of Storm
62 if version in ['1.0.1', '1.1.0']: 62 cfg['client.jartransformer.class'] = (
63 cfg['client.jartransformer.class'] = ( 63 "org.apache.storm.hack.StormShadeTransformer")
64 "org.apache.storm.hack.StormShadeTransformer")
65 64
66 return cfg 65 return cfg
67 66
diff --git a/sahara/plugins/storm/edp_engine.py b/sahara/plugins/storm/edp_engine.py
index 047cf1a..e5d57b1 100644
--- a/sahara/plugins/storm/edp_engine.py
+++ b/sahara/plugins/storm/edp_engine.py
@@ -20,7 +20,7 @@ from sahara.service.edp.storm import engine as edp_engine
20 20
21class EdpStormEngine(edp_engine.StormJobEngine): 21class EdpStormEngine(edp_engine.StormJobEngine):
22 22
23 edp_base_version = "0.9.2" 23 edp_base_version = "1.0.1"
24 24
25 @staticmethod 25 @staticmethod
26 def edp_supported(version): 26 def edp_supported(version):
@@ -37,7 +37,7 @@ class EdpStormEngine(edp_engine.StormJobEngine):
37 37
38class EdpPyleusEngine(edp_engine.StormPyleusJobEngine): 38class EdpPyleusEngine(edp_engine.StormPyleusJobEngine):
39 39
40 edp_base_version = "0.9.2" 40 edp_base_version = "1.0.1"
41 41
42 @staticmethod 42 @staticmethod
43 def edp_supported(version): 43 def edp_supported(version):
diff --git a/sahara/plugins/storm/plugin.py b/sahara/plugins/storm/plugin.py
index 738aa58..2382f0c 100644
--- a/sahara/plugins/storm/plugin.py
+++ b/sahara/plugins/storm/plugin.py
@@ -57,13 +57,14 @@ class StormProvider(p.ProvisioningPluginBase):
57 'deprecated': {'status': True}} 57 'deprecated': {'status': True}}
58 result = {'plugin_labels': copy.deepcopy(default)} 58 result = {'plugin_labels': copy.deepcopy(default)}
59 result['version_labels'] = { 59 result['version_labels'] = {
60 '1.2': copy.deepcopy(default),
60 '1.1.0': copy.deepcopy(default), 61 '1.1.0': copy.deepcopy(default),
61 '1.0.1': copy.deepcopy(deprecated), 62 '1.0.1': copy.deepcopy(deprecated),
62 } 63 }
63 return result 64 return result
64 65
65 def get_versions(self): 66 def get_versions(self):
66 return ['1.0.1', '1.1.0'] 67 return ['1.0.1', '1.1.0', '1.2']
67 68
68 def get_configs(self, storm_version): 69 def get_configs(self, storm_version):
69 return c_helper.get_plugin_configs() 70 return c_helper.get_plugin_configs()
diff --git a/sahara/tests/unit/plugins/storm/test_config_helper.py b/sahara/tests/unit/plugins/storm/test_config_helper.py
index d68fbcf..0dd3f11 100644
--- a/sahara/tests/unit/plugins/storm/test_config_helper.py
+++ b/sahara/tests/unit/plugins/storm/test_config_helper.py
@@ -23,6 +23,7 @@ class TestStormConfigHelper(testcase.TestCase):
23 def test_generate_storm_config(self): 23 def test_generate_storm_config(self):
24 STORM_101 = '1.0.1' 24 STORM_101 = '1.0.1'
25 STORM_110 = '1.1.0' 25 STORM_110 = '1.1.0'
26 STORM_120 = '1.2'
26 tested_versions = [] 27 tested_versions = []
27 master_hostname = "s-master" 28 master_hostname = "s-master"
28 zk_hostnames = ["s-zoo"] 29 zk_hostnames = ["s-zoo"]
@@ -42,5 +43,13 @@ class TestStormConfigHelper(testcase.TestCase):
42 self.assertEqual(configs_110['client.jartransformer.class'], 43 self.assertEqual(configs_110['client.jartransformer.class'],
43 'org.apache.storm.hack.StormShadeTransformer') 44 'org.apache.storm.hack.StormShadeTransformer')
44 tested_versions.append(STORM_110) 45 tested_versions.append(STORM_110)
46 configs_120 = s_config.generate_storm_config(
47 master_hostname, zk_hostnames, STORM_120)
48 self.assertNotIn('nimbus.host', configs_120.keys())
49 self.assertIn('nimbus.seeds', configs_120.keys())
50 self.assertIn('client.jartransformer.class', configs_120.keys())
51 self.assertEqual(configs_120['client.jartransformer.class'],
52 'org.apache.storm.hack.StormShadeTransformer')
53 tested_versions.append(STORM_120)
45 storm = s_plugin.StormProvider() 54 storm = s_plugin.StormProvider()
46 self.assertEqual(storm.get_versions(), tested_versions) 55 self.assertEqual(storm.get_versions(), tested_versions)
diff --git a/sahara/tests/unit/plugins/storm/test_plugin.py b/sahara/tests/unit/plugins/storm/test_plugin.py
index 3f50023..e06e73b 100644
--- a/sahara/tests/unit/plugins/storm/test_plugin.py
+++ b/sahara/tests/unit/plugins/storm/test_plugin.py
@@ -71,10 +71,12 @@ class StormPluginTest(base.SaharaWithDbTestCase):
71 71
72 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1') 72 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1')
73 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0') 73 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0')
74 cluster_data_120 = self._get_cluster('cluster_1.2.0', '1.2')
74 cluster_data_101['node_groups'] = data 75 cluster_data_101['node_groups'] = data
75 cluster_data_110['node_groups'] = data 76 cluster_data_110['node_groups'] = data
77 cluster_data_120['node_groups'] = data
76 78
77 clusters = [cluster_data_101, cluster_data_110] 79 clusters = [cluster_data_101, cluster_data_110, cluster_data_120]
78 80
79 for cluster_data in clusters: 81 for cluster_data in clusters:
80 cluster = conductor.cluster_create(context.ctx(), cluster_data) 82 cluster = conductor.cluster_create(context.ctx(), cluster_data)
@@ -162,10 +164,12 @@ class StormPluginTest(base.SaharaWithDbTestCase):
162 164
163 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1') 165 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1')
164 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0') 166 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0')
167 cluster_data_120 = self._get_cluster('cluster_1.2.0', '1.2')
165 cluster_data_101['node_groups'] = data 168 cluster_data_101['node_groups'] = data
166 cluster_data_110['node_groups'] = data 169 cluster_data_110['node_groups'] = data
170 cluster_data_120['node_groups'] = data
167 171
168 clusters = [cluster_data_101, cluster_data_110] 172 clusters = [cluster_data_101, cluster_data_110, cluster_data_120]
169 173
170 for cluster_data in clusters: 174 for cluster_data in clusters:
171 cluster = conductor.cluster_create(context.ctx(), cluster_data) 175 cluster = conductor.cluster_create(context.ctx(), cluster_data)
@@ -194,10 +198,12 @@ class StormPluginTest(base.SaharaWithDbTestCase):
194 198
195 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1') 199 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1')
196 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0') 200 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0')
201 cluster_data_120 = self._get_cluster('cluster_1.2.0', '1.2')
197 cluster_data_101['node_groups'] = data 202 cluster_data_101['node_groups'] = data
198 cluster_data_110['node_groups'] = data 203 cluster_data_110['node_groups'] = data
204 cluster_data_120['node_groups'] = data
199 205
200 clusters = [cluster_data_101, cluster_data_110] 206 clusters = [cluster_data_101, cluster_data_110, cluster_data_120]
201 207
202 for cluster_data in clusters: 208 for cluster_data in clusters:
203 cluster = conductor.cluster_create(context.ctx(), cluster_data) 209 cluster = conductor.cluster_create(context.ctx(), cluster_data)
@@ -230,10 +236,12 @@ class StormPluginTest(base.SaharaWithDbTestCase):
230 236
231 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1') 237 cluster_data_101 = self._get_cluster('cluster_1.0.1', '1.0.1')
232 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0') 238 cluster_data_110 = self._get_cluster('cluster_1.1.0', '1.1.0')
239 cluster_data_120 = self._get_cluster('cluster_1.2.0', '1.2')
233 cluster_data_101['node_groups'] = data 240 cluster_data_101['node_groups'] = data
234 cluster_data_110['node_groups'] = data 241 cluster_data_110['node_groups'] = data
242 cluster_data_120['node_groups'] = data
235 243
236 clusters = [cluster_data_101, cluster_data_110] 244 clusters = [cluster_data_101, cluster_data_110, cluster_data_120]
237 245
238 for cluster_data in clusters: 246 for cluster_data in clusters:
239 cluster = conductor.cluster_create(context.ctx(), cluster_data) 247 cluster = conductor.cluster_create(context.ctx(), cluster_data)
@@ -276,3 +284,11 @@ class StormPluginTest(base.SaharaWithDbTestCase):
276 def test_plugin110_edp_storm_pyleus_engine(self): 284 def test_plugin110_edp_storm_pyleus_engine(self):
277 self._test_engine('1.1.0', edp.JOB_TYPE_PYLEUS, 285 self._test_engine('1.1.0', edp.JOB_TYPE_PYLEUS,
278 engine.StormJobEngine) 286 engine.StormJobEngine)
287
288 def test_plugin120_edp_storm_engine(self):
289 self._test_engine('1.2', edp.JOB_TYPE_STORM,
290 engine.StormJobEngine)
291
292 def test_plugin120_edp_storm_pyleus_engine(self):
293 self._test_engine('1.2', edp.JOB_TYPE_PYLEUS,
294 engine.StormJobEngine)