Repository: ambari Updated Branches: refs/heads/trunk b82ac7abf -> 327accb13
AMBARI-7350. Add SLIDER service to the stacks (part - II) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/327accb1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/327accb1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/327accb1 Branch: refs/heads/trunk Commit: 327accb1345a7648b5cb740b94ed649721919f2c Parents: b82ac7a Author: Sumit Mohanty <smoha...@hortonworks.com> Authored: Sat Sep 20 00:16:09 2014 -0700 Committer: Sumit Mohanty <smoha...@hortonworks.com> Committed: Sat Sep 20 00:16:09 2014 -0700 ---------------------------------------------------------------------- .../services/SLIDER/package/scripts/params.py | 4 +- .../services/SLIDER/package/scripts/slider.py | 22 +--------- .../SLIDER/package/templates/slider-env.sh.j2 | 38 ++++++++++++++++++ .../SLIDER/package/templates/slider-wrapper.j2 | 42 -------------------- .../stacks/2.2/SLIDER/test_slider_client.py | 29 ++------------ 5 files changed, 46 insertions(+), 89 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/327accb1/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py index 062e5bd..31ad31d 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py @@ -34,12 +34,12 @@ else: slider_conf_dir = "/usr/lib/slider/conf" slider_bin_dir = "/usr/lib/slider/bin" +hadoop_conf_dir = "/etc/hadoop/conf" smokeuser = config['configurations']['cluster-env']['smokeuser'] -user_group = config['configurations']['cluster-env']['user_group'] security_enabled = config['configurations']['cluster-env']['security_enabled'] smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab'] kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"]) java64_home = config['hostLevelParams']['java_home'] log4j_props = config['configurations']['slider-log4j']['content'] -slider_cmd = format("{slider_bin_dir}/slider-wrapper") \ No newline at end of file +slider_cmd = format("{slider_bin_dir}/slider") \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/327accb1/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py index d9d0693..87e93f8 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py @@ -34,27 +34,9 @@ def slider(): configurations=params.config['configurations']['slider-client'] ) - XmlConfig("core-site.xml", - conf_dir=params.slider_conf_dir, - configurations=params.config['configurations']['core-site'], - configuration_attributes=params.config['configuration_attributes']['core-site'] - ) - - XmlConfig("hdfs-site.xml", - conf_dir=params.slider_conf_dir, - configurations=params.config['configurations']['hdfs-site'], - configuration_attributes=params.config['configuration_attributes']['hdfs-site'] - ) - - XmlConfig("yarn-site.xml", - conf_dir=params.slider_conf_dir, - configurations=params.config['configurations']['yarn-site'], - configuration_attributes=params.config['configuration_attributes']['yarn-site'] - ) - - File(format("{slider_bin_dir}/slider-wrapper"), + File(format("{slider_conf_dir}/slider-env.sh"), mode=0755, - content=Template('slider-wrapper.j2') + content=Template('slider-env.sh.j2') ) if (params.log4j_props != None): http://git-wip-us.apache.org/repos/asf/ambari/blob/327accb1/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-env.sh.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-env.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-env.sh.j2 new file mode 100644 index 0000000..4872e29 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-env.sh.j2 @@ -0,0 +1,38 @@ +{# +# 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. +#} +#!/usr/bin/env python +# -*- coding: utf-8 -*- +#/* +# * 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. +# */ +export JAVA_HOME={{java64_home}} +export HADOOP_CONF_DIR={{hadoop_conf_dir}} http://git-wip-us.apache.org/repos/asf/ambari/blob/327accb1/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2 deleted file mode 100644 index ba0b013..0000000 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2 +++ /dev/null @@ -1,42 +0,0 @@ -{# -# 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. -#} -#!/usr/bin/env python -# -*- coding: utf-8 -*- -#/* -# * 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. -# */ -import slider -import os, sys - -if __name__ == '__main__': - os.environ["JAVA_HOME"] = "{{java64_home}}" - slider.main() \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/327accb1/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py index c33c938..0b493f5 100644 --- a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py +++ b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py @@ -38,30 +38,9 @@ class TestSliderClient(RMFTestCase): configurations=self.getConfig()['configurations']['slider-client'] ) - self.assertResourceCalled('XmlConfig', - 'core-site.xml', - conf_dir='/usr/lib/slider/conf', - configurations=self.getConfig()['configurations']['core-site'], - configuration_attributes=self.getConfig()['configuration_attributes']['core-site'] - ) - - self.assertResourceCalled('XmlConfig', - 'hdfs-site.xml', - conf_dir='/usr/lib/slider/conf', - configurations=self.getConfig()['configurations']['hdfs-site'], - configuration_attributes=self.getConfig()['configuration_attributes']['hdfs-site'] - ) - - self.assertResourceCalled('XmlConfig', - 'yarn-site.xml', - conf_dir='/usr/lib/slider/conf', - configurations=self.getConfig()['configurations']['yarn-site'], - configuration_attributes=self.getConfig()['configuration_attributes']['yarn-site'] - ) - self.assertResourceCalled('File', - '/usr/lib/slider/bin/slider-wrapper', - content=Template('slider-wrapper.j2'), + '/usr/lib/slider/conf/slider-env.sh', + content=Template('slider-env.sh.j2'), mode=0755 ) @@ -83,7 +62,7 @@ class TestSliderClient(RMFTestCase): ) self.assertResourceCalled('Execute', - '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/lib/slider/bin/slider-wrapper list', + '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/lib/slider/bin/slider list', logoutput=True, tries=3, user='ambari-qa', @@ -99,7 +78,7 @@ class TestSliderClient(RMFTestCase): config_file="default.json" ) - self.assertResourceCalled('Execute', ' /usr/lib/slider/bin/slider-wrapper list', + self.assertResourceCalled('Execute', ' /usr/lib/slider/bin/slider list', logoutput=True, tries=3, user='ambari-qa',