You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2014/10/10 01:15:28 UTC
git commit: AMBARI-7713. Slider service should specify what client
configs can be downloaded
Repository: ambari
Updated Branches:
refs/heads/branch-17.0 [created] 24875b317
AMBARI-7713. Slider service should specify what client configs can be downloaded
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/24875b31
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/24875b31
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/24875b31
Branch: refs/heads/branch-17.0
Commit: 24875b317e0cab308a6d93e52e639f234b4061ec
Parents: f60fc61
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Oct 9 16:14:51 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Oct 9 16:14:51 2014 -0700
----------------------------------------------------------------------
.../SLIDER/configuration/slider-client.xml | 5 ---
.../SLIDER/configuration/slider-env.xml | 43 ++++++++++++++++++++
.../stacks/HDP/2.2/services/SLIDER/metainfo.xml | 33 +++++++++++++++
.../services/SLIDER/package/scripts/params.py | 1 +
.../services/SLIDER/package/scripts/slider.py | 2 +-
.../SLIDER/package/templates/slider-env.sh.j2 | 38 -----------------
.../stacks/2.2/SLIDER/test_slider_client.py | 9 ++--
.../test/python/stacks/2.2/configs/default.json | 6 +++
.../test/python/stacks/2.2/configs/secured.json | 6 +++
9 files changed, 94 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
index 7d55760..02b55ac 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
@@ -21,11 +21,6 @@
-->
<configuration supports_final="true">
<property>
- <name>slider.yarn.queue</name>
- <value>default</value>
- <description>YARN queue for the Application Master</description>
- </property>
- <property>
<name>slider.zookeeper.quorum</name>
<value>localhost:2181</value>
<description>ZK quorum</description>
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml
new file mode 100644
index 0000000..80c3af1
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-env.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<configuration>
+ <!-- slider-env.sh -->
+ <property>
+ <name>content</name>
+ <description>This is the jinja template for slider-env.sh file</description>
+ <value>
+# Set Slider-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME. All others are
+# optional. When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use. Required.
+export JAVA_HOME={{java64_home}}
+# The hadoop conf directory. Optional as slider-client.xml can be edited to add properties.
+export HADOOP_CONF_DIR={{hadoop_conf_dir}}
+ </value>
+ </property>
+
+</configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
index 946fad8..ede945c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
@@ -50,6 +50,38 @@
<scriptType>PYTHON</scriptType>
<timeout>600</timeout>
</commandScript>
+ <configFiles>
+ <configFile>
+ <type>xml</type>
+ <fileName>slider-client.xml</fileName>
+ <dictionaryName>slider-client</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>xml</type>
+ <fileName>core-site.xml</fileName>
+ <dictionaryName>core-site</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>xml</type>
+ <fileName>hdfs-site.xml</fileName>
+ <dictionaryName>hdfs-site</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>xml</type>
+ <fileName>yarn-site.xml</fileName>
+ <dictionaryName>yarn-site</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>env</type>
+ <fileName>slider-env.sh</fileName>
+ <dictionaryName>slider-env</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>env</type>
+ <fileName>log4j.properties</fileName>
+ <dictionaryName>slider-log4j</dictionaryName>
+ </configFile>
+ </configFiles>
</component>
</components>
<osSpecifics>
@@ -78,6 +110,7 @@
<configuration-dependencies>
<config-type>slider-log4j</config-type>
<config-type>slider-client</config-type>
+ <config-type>slider-env</config-type>
</configuration-dependencies>
</service>
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/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 3b12f9b..33371a8 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
@@ -38,6 +38,7 @@ smokeuser = config['configurations']['cluster-env']['smokeuser']
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"])
+slider_env_sh_template = config['configurations']['slider-env']['content']
java64_home = config['hostLevelParams']['java_home']
log4j_props = config['configurations']['slider-log4j']['content']
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/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 a3b6238..311f4bf 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
@@ -37,7 +37,7 @@ def slider():
File(format("{slider_conf_dir}/slider-env.sh"),
mode=0755,
- content=Template('slider-env.sh.j2')
+ content=InlineTemplate(params.slider_env_sh_template)
)
if (params.log4j_props != None):
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/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
deleted file mode 100644
index 4872e29..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-env.sh.j2
+++ /dev/null
@@ -1,38 +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.
-# */
-export JAVA_HOME={{java64_home}}
-export HADOOP_CONF_DIR={{hadoop_conf_dir}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/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 c89e73c..746f346 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
@@ -40,11 +40,10 @@ class TestSliderClient(RMFTestCase):
configurations=self.getConfig()['configurations']['slider-client']
)
- self.assertResourceCalled('File',
- '/etc/slider/conf/slider-env.sh',
- content=Template('slider-env.sh.j2'),
- mode=0755
- )
+ self.assertResourceCalled('File', '/etc/slider/conf/slider-env.sh',
+ content = InlineTemplate(self.getConfig()['configurations']['slider-env']['content']),
+ mode = 0755,
+ )
self.assertResourceCalled('File',
'/etc/slider/conf/log4j.properties',
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/ambari-server/src/test/python/stacks/2.2/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/default.json b/ambari-server/src/test/python/stacks/2.2/configs/default.json
index 2fbed67..ce7a379 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/default.json
@@ -53,6 +53,9 @@
},
"slider-log4j": {
"content": "log4jproperties\nline2"
+ },
+ "slider-env": {
+ "content": "envproperties\nline2"
}
},
"configuration_attributes": {
@@ -85,6 +88,9 @@
"slider-log4j": {
"tag": "version1"
},
+ "slider-env": {
+ "tag": "version1"
+ },
"core-site": {
"tag": "version1"
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/24875b31/ambari-server/src/test/python/stacks/2.2/configs/secured.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/secured.json b/ambari-server/src/test/python/stacks/2.2/configs/secured.json
index 3080043..20678fa 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/secured.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/secured.json
@@ -48,6 +48,9 @@
},
"slider-log4j": {
"content": "log4jproperties\nline2"
+ },
+ "slider-env": {
+ "content": "envproperties\nline2"
}
},
"configuration_attributes": {},
@@ -57,6 +60,9 @@
},
"slider-log4j": {
"tag": "version1"
+ },
+ "slider-env": {
+ "tag": "version1"
}
},
"commandId": "7-1",