ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject [2/2] git commit: AMBARI-5431. storm-env.sh needs to be created at /etc/storm/conf
Date Thu, 10 Apr 2014 22:53:54 GMT
AMBARI-5431. storm-env.sh needs to be created at /etc/storm/conf


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a29fa8cd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a29fa8cd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a29fa8cd

Branch: refs/heads/branch-1.5.1
Commit: a29fa8cda9325e00eade70b7f499e1384ad22387
Parents: 82e3af2
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Thu Apr 10 14:57:51 2014 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Thu Apr 10 15:53:24 2014 -0700

----------------------------------------------------------------------
 .../services/STORM/package/scripts/params.py    |  1 +
 .../2.1/services/STORM/package/scripts/storm.py | 27 +++++++-----
 .../STORM/package/templates/storm-env.sh.j2     | 45 ++++++++++++++++++++
 .../stacks/2.1/STORM/test_storm_drpc_server.py  |  6 +++
 .../stacks/2.1/STORM/test_storm_nimbus.py       |  6 +++
 .../stacks/2.1/STORM/test_storm_nimbus_prod.py  |  8 +++-
 .../2.1/STORM/test_storm_rest_api_service.py    |  6 +++
 .../stacks/2.1/STORM/test_storm_supervisor.py   |  6 +++
 .../2.1/STORM/test_storm_supervisor_prod.py     |  8 +++-
 .../stacks/2.1/STORM/test_storm_ui_server.py    |  6 +++
 10 files changed, 106 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/params.py
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/params.py
index c0f3e18..fcc8fbc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/params.py
@@ -38,6 +38,7 @@ rest_api_port = "8745"
 rest_api_admin_port = "8746"
 rest_api_conf_file = format("{conf_dir}/config.yaml")
 rest_lib_dir = "/usr/lib/storm/contrib/storm-rest"
+java_home = config['hostLevelParams']['java_home']
 
 if 'ganglia_server_host' in config['clusterHostInfo'] and \
     len(config['clusterHostInfo']['ganglia_server_host'])>0:

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
index bce272b..2e7f818 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
@@ -22,6 +22,7 @@ from resource_management import *
 from yaml_config import yaml_config
 import sys
 
+
 def storm():
   import params
 
@@ -32,19 +33,23 @@ def storm():
   )
 
   File(format("{conf_dir}/config.yaml"),
-            content=Template("config.yaml.j2"),
-            owner = params.storm_user,
-            group = params.user_group
+       content=Template("config.yaml.j2"),
+       owner=params.storm_user,
+       group=params.user_group
+  )
+
+  yaml_config("storm.yaml",
+              conf_dir=params.conf_dir,
+              configurations=params.config['configurations']['storm-site'],
+              owner=params.storm_user,
+              group=params.user_group
   )
 
-  yaml_config( "storm.yaml",
-               conf_dir = params.conf_dir,
-               configurations = params.config['configurations']['storm-site'],
-               owner = params.storm_user,
-               group = params.user_group
+  TemplateConfig(format("{conf_dir}/storm-env.sh"),
+                 owner=params.storm_user
   )
-  
+
   if params.security_enabled:
-    TemplateConfig( format("{conf_dir}/storm_jaas.conf"),
-      owner = params.storm_user
+    TemplateConfig(format("{conf_dir}/storm_jaas.conf"),
+                   owner=params.storm_user
     )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/storm-env.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/storm-env.sh.j2
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/storm-env.sh.j2
new file mode 100644
index 0000000..d429c47
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/storm-env.sh.j2
@@ -0,0 +1,45 @@
+{#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#}
+
+
+#!/bin/bash
+#
+# Copyright 2014 The Apache Software Foundation
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Set Storm specific environment variables here.
+
+# The java implementation to use.
+export JAVA_HOME={{java_home}}
+
+# export STORM_CONF_DIR=""

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
index 75ee5e6..e2617b1 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
@@ -156,6 +156,9 @@ class TestStormDrpcServer(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -189,6 +192,9 @@ class TestStormDrpcServer(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
index f5247ac..00b81ce 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
@@ -156,6 +156,9 @@ class TestStormNimbus(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -189,6 +192,9 @@ class TestStormNimbus(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
index b236083..f40cfc7 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
@@ -125,6 +125,9 @@ class TestStormNimbus(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -157,7 +160,10 @@ class TestStormNimbus(RMFTestCase):
       content = 'InlineTemplateMock',
       group = 'hadoop',
       mode = None,
-    )    
+    )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
index 243184f..b78d0b1 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
@@ -156,6 +156,9 @@ class TestStormRestApi(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -189,6 +192,9 @@ class TestStormRestApi(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
index 240b39f..8ebe10e 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
@@ -195,6 +195,9 @@ class TestStormSupervisor(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -228,6 +231,9 @@ class TestStormSupervisor(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
index 6e3639c..b3df2c5 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
@@ -170,6 +170,9 @@ class TestStormSupervisor(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -202,7 +205,10 @@ class TestStormSupervisor(RMFTestCase):
       content = 'InlineTemplateMock',
       group = 'hadoop',
       mode = None,
-    )    
+    )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/a29fa8cd/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
index 5403ebb..a9732fe 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
@@ -156,6 +156,9 @@ class TestStormUiServer(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
 
   def assert_configure_secured(self):
     self.assertResourceCalled('Directory', '/var/log/storm',
@@ -189,6 +192,9 @@ class TestStormUiServer(RMFTestCase):
       group = 'hadoop',
       mode = None,
     )
+    self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm-env.sh',
+                              owner = 'storm',
+                              )
     self.assertResourceCalled('TemplateConfig', '/etc/storm/conf/storm_jaas.conf',
       owner = 'storm',
     )


Mime
View raw message