ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-11003. YARN theme and 'yarn.nodemanager.resource.cpu-vcores' calculation updates (srimanth)
Date Thu, 07 May 2015 21:41:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 1d618371a -> 0f6ca9210


AMBARI-11003. YARN theme and 'yarn.nodemanager.resource.cpu-vcores' calculation updates (srimanth)


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

Branch: refs/heads/trunk
Commit: 0f6ca9210da598d7cdd729c9fdcbc5381f7ef374
Parents: 1d61837
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Thu May 7 13:29:34 2015 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Thu May 7 13:29:47 2015 -0700

----------------------------------------------------------------------
 .../configuration-mapred/mapred-site.xml        |  8 +--
 .../YARN/2.1.0.2.0/configuration/yarn-site.xml  |  6 +-
 .../services/HBASE/configuration/hbase-site.xml |  2 +-
 .../YARN/configuration/capacity-scheduler.xml   |  2 +-
 .../services/YARN/configuration/yarn-env.xml    |  2 +-
 .../services/YARN/configuration/yarn-site.xml   | 18 ++++--
 .../2.2/services/YARN/themes-mapred/theme.json  | 34 +++++++---
 .../HDP/2.2/services/YARN/themes/theme.json     | 14 ++--
 .../stacks/HDP/2.2/services/stack_advisor.py    | 10 ++-
 .../stacks/2.2/common/test_stack_advisor.py     | 67 +++++++++++++++-----
 10 files changed, 115 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
index fac891d..ca0a4fe 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
@@ -31,7 +31,7 @@
       The total amount of buffer memory to use while sorting files, in megabytes.
       By default, gives each merge stream 1MB, which should minimize seeks.
     </description>
-    <display-name>MapReduce Sort Allocation</display-name>
+    <display-name>Sort Allocation Memory</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
@@ -184,7 +184,7 @@
     <name>mapreduce.map.memory.mb</name>
     <value>512</value>
     <description>Virtual memory for single Map task</description>
-    <display-name>MR Map RAM Allocation</display-name>
+    <display-name>Map Memory</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>512</minimum>
@@ -208,7 +208,7 @@
     <name>mapreduce.reduce.memory.mb</name>
     <value>1024</value>
     <description>Virtual memory for single Reduce task</description>
-    <display-name>MR Reduce RAM Allocation</display-name>
+    <display-name>Reduce Memory</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>512</minimum>
@@ -287,7 +287,7 @@
     <name>yarn.app.mapreduce.am.resource.mb</name>
     <value>512</value>
     <description>The amount of memory the MR AppMaster needs.</description>
-    <display-name>MR AppMaster RAM Allocation </display-name>
+    <display-name>AppMaster Memory</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>512</minimum>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
index 2efddb8..14ab94d 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
@@ -70,7 +70,7 @@
       in MBs. Memory requests lower than this won't take effect,
       and the specified value will get allocated at minimum.
     </description>
-    <display-name>YARN Container Minimum RAM</display-name>
+    <display-name>Minimum Container Size (Memory)</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
@@ -94,7 +94,7 @@
       in MBs. Memory requests higher than this won't take effect,
       and will get capped to this value.
     </description>
-    <display-name>YARN Container Maximum RAM</display-name>
+    <display-name>Maximum Container Size (Memory)</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
@@ -135,7 +135,7 @@
     <value>5120</value>
     <description>Amount of physical memory, in MB, that can be allocated
       for containers.</description>
-    <display-name>Total RAM per NM</display-name>
+    <display-name>Memory allocated for all YARN containers on a node</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/hbase-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/hbase-site.xml
index 4a9b84b..a8efde8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/hbase-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/hbase-site.xml
@@ -139,7 +139,7 @@
   </property>
   <property>
     <name>hbase.coprocessor.regionserver.classes</name>
-    <value> </value>
+    <value></value>
     <depends-on>
       <property>
         <type>hbase-site</type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/capacity-scheduler.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/capacity-scheduler.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/capacity-scheduler.xml
index 870983b..f1d4b48 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/capacity-scheduler.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/capacity-scheduler.xml
@@ -19,7 +19,7 @@
   <property>
     <name>yarn.scheduler.capacity.resource-calculator</name>
     <value>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value>
-    <display-name>Enable CPU Scheduling</display-name>
+    <display-name>CPU Scheduling</display-name>
     <value-attributes>
       <type>value-list</type>
       <entries>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-env.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-env.xml
index cb83f34..bfe15ca 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-env.xml
@@ -25,7 +25,7 @@
     <name>yarn_cgroups_enabled</name>
     <value>false</value>
     <description>You can use CGroups to isolate CPU-heavy processes in a Hadoop cluster.</description>
-    <display-name>Enable CPU Isolation</display-name>
+    <display-name>CPU Isolation</display-name>
     <value-attributes>
       <type>value-list</type>
       <entries>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
index 1b8fe5e..8898d20 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
@@ -187,18 +187,24 @@
     <name>yarn.nodemanager.resource.cpu-vcores</name>
     <value>8</value>
     <description></description>
-    <display-name>Total NM CPU vCores</display-name>
+    <display-name>Number of virtual cores</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
       <maximum>32</maximum>
     </value-attributes>
+    <depends-on>
+      <property>
+        <type>yarn-site</type>
+        <name>yarn.nodemanager.resource.percentage-physical-cpu-limit</name>
+      </property>
+    </depends-on>
   </property>
   <property>
     <name>yarn.nodemanager.resource.percentage-physical-cpu-limit</name>
     <value>80</value>
     <description>The amount of CPU allocated for YARN containers - only effective when
used with CGroups</description>
-    <display-name>%ge of Total NM CPU</display-name>
+    <display-name>Percentage of physical CPU allocated for all containers on a node</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
@@ -344,7 +350,7 @@
     <name>yarn.scheduler.minimum-allocation-vcores</name>
     <value>1</value>
     <description></description>
-    <display-name>YARN Container Minimum vCores</display-name>
+    <display-name>Minimum Container Size (VCores)</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
@@ -362,7 +368,7 @@
     <name>yarn.scheduler.maximum-allocation-vcores</name>
     <value>8</value>
     <description></description>
-    <display-name>YARN Container Maximum vCores</display-name>
+    <display-name>Maximum Container Size (VCores)</display-name>
     <value-attributes>
       <type>int</type>
       <minimum>0</minimum>
@@ -382,7 +388,7 @@
     <description>
       Enable node labels to restrict YARN applications so that they run only on cluster nodes
that have a specified node label.
     </description>
-    <display-name>Enable Node Labels</display-name>
+    <display-name>Node Labels</display-name>
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
@@ -432,7 +438,7 @@
   <property>
     <name>yarn.resourcemanager.scheduler.monitor.enable</name>
     <value>false</value>
-    <display-name>Enable Pre-emption</display-name>
+    <display-name>Pre-emption</display-name>
     <value-attributes>
       <type>value-list</type>
       <entries>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes-mapred/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes-mapred/theme.json
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes-mapred/theme.json
index c96d656..5019447 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes-mapred/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes-mapred/theme.json
@@ -15,27 +15,43 @@
               "sections": [
                 {
                   "name": "section-mr-scheduler",
-                  "display-name": "MR Scheduler Defaults",
+                  "display-name": "MapReduce",
                   "row-index": "0",
                   "column-index": "0",
                   "row-span": "1",
-                  "column-span": "2",
-                  "section-columns": "2",
+                  "column-span": "1",
+                  "section-columns": "3",
                   "section-rows": "1",
                   "subsections": [
                     {
-                      "name": "subsection-mr-scheduler-col1",
+                      "name": "subsection-mr-scheduler-row1-col1",
+                      "display-name": "MapReduce Framework",
                       "row-index": "0",
                       "column-index": "0",
                       "row-span": "1",
                       "column-span": "1"
                     },
                     {
-                      "name": "subsection-mr-scheduler-col2",
+                      "name": "subsection-mr-scheduler-row1-col2",
                       "row-index": "0",
                       "column-index": "1",
                       "row-span": "1",
                       "column-span": "1"
+                    },
+                    {
+                      "name": "subsection-mr-scheduler-row1-col3",
+                      "row-index": "0",
+                      "column-index": "2",
+                      "row-span": "1",
+                      "column-span": "1"
+                    },
+                    {
+                      "name": "subsection-mr-scheduler-row2-col1",
+                      "display-name": "MapReduce AppMaster",
+                      "row-index": "1",
+                      "column-index": "0",
+                      "row-span": "1",
+                      "column-span": "3"
                     }
                   ]
                 }
@@ -50,19 +66,19 @@
       "configs": [
         {
           "config": "mapred-site/mapreduce.map.memory.mb",
-          "subsection-name": "subsection-mr-scheduler-col1"
+          "subsection-name": "subsection-mr-scheduler-row1-col1"
         },
         {
           "config": "mapred-site/mapreduce.reduce.memory.mb",
-          "subsection-name": "subsection-mr-scheduler-col1"
+          "subsection-name": "subsection-mr-scheduler-row1-col2"
         },
         {
           "config": "mapred-site/yarn.app.mapreduce.am.resource.mb",
-          "subsection-name": "subsection-mr-scheduler-col2"
+          "subsection-name": "subsection-mr-scheduler-row2-col1"
         },
         {
           "config": "mapred-site/mapreduce.task.io.sort.mb",
-          "subsection-name": "subsection-mr-scheduler-col2"
+          "subsection-name": "subsection-mr-scheduler-row1-col3"
         }
       ]
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes/theme.json
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes/theme.json
index 25ea7cc..758cf0c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/themes/theme.json
@@ -15,7 +15,7 @@
               "sections": [
                 {
                   "name": "section-nm-sizing",
-                  "display-name": "Memory Sizing",
+                  "display-name": "Memory",
                   "row-index": "0",
                   "column-index": "0",
                   "row-span": "1",
@@ -25,6 +25,7 @@
                   "subsections": [
                     {
                       "name": "subsection-nm-sizing-col1",
+                      "display-name": "Node",
                       "row-index": "0",
                       "column-index": "0",
                       "row-span": "1",
@@ -32,6 +33,7 @@
                     },
                     {
                       "name": "subsection-nm-sizing-col2",
+                      "display-name": "Container",
                       "row-index": "0",
                       "column-index": "1",
                       "row-span": "1",
@@ -41,7 +43,7 @@
                 },
                 {
                   "name": "section-yarn-platform-features",
-                  "display-name": "YARN Platform Features",
+                  "display-name": "YARN Features",
                   "row-index": "0",
                   "column-index": "2",
                   "row-span": "1",
@@ -60,7 +62,7 @@
                 },
                 {
                   "name": "section-container-sizing",
-                  "display-name": "CPU Sizing",
+                  "display-name": "CPU",
                   "row-index": "1",
                   "column-index": "0",
                   "row-span": "1",
@@ -70,6 +72,7 @@
                   "subsections": [
                     {
                       "name": "subsection-container-sizing-col1",
+                      "display-name": "Node",
                       "row-index": "0",
                       "column-index": "0",
                       "row-span": "1",
@@ -77,6 +80,7 @@
                     },
                     {
                       "name": "subsection-container-sizing-col2",
+                      "display-name": "Container",
                       "row-index": "0",
                       "column-index": "1",
                       "row-span": "1",
@@ -122,11 +126,11 @@
           "subsection-name": "subsection-container-sizing-col1"
         },
         {
-          "config": "yarn-site/yarn.nodemanager.resource.cpu-vcores",
+          "config": "yarn-site/yarn.nodemanager.resource.percentage-physical-cpu-limit",
           "subsection-name": "subsection-container-sizing-col1"
         },
         {
-          "config": "yarn-site/yarn.nodemanager.resource.percentage-physical-cpu-limit",
+          "config": "yarn-site/yarn.nodemanager.resource.cpu-vcores",
           "subsection-name": "subsection-container-sizing-col1"
         },
         {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 0e08fdb..a7c6ebb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -18,6 +18,7 @@ limitations under the License.
 """
 
 import math
+from math import floor
 
 class HDP22StackAdvisor(HDP21StackAdvisor):
 
@@ -45,9 +46,14 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     putYarnPropertyAttribute = self.putPropertyAttribute(configurations, "yarn-site")
     nodeManagerHost = self.getHostWithComponent("YARN", "NODEMANAGER", services, hosts)
     if (nodeManagerHost is not None):
-      putYarnProperty('yarn.nodemanager.resource.cpu-vcores', nodeManagerHost["Hosts"]["cpu_count"]
* 2)
+      cpuPercentageLimit = 0.8
+      if "yarn.nodemanager.resource.percentage-physical-cpu-limit" in configurations["yarn-site"]["properties"]:
+        cpuPercentageLimit = float(configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"])
+      cpuLimit = max(1, int(floor(nodeManagerHost["Hosts"]["cpu_count"] * cpuPercentageLimit)))
+      putYarnProperty('yarn.nodemanager.resource.cpu-vcores', str(cpuLimit))
+      putYarnProperty('yarn.scheduler.maximum-allocation-vcores', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"])
       putYarnPropertyAttribute('yarn.nodemanager.resource.memory-mb', 'maximum', int(nodeManagerHost["Hosts"]["total_mem"]
/ 1024)) # total_mem in kb
-      putYarnPropertyAttribute('yarn.nodemanager.resource.cpu-vcores', 'maximum', nodeManagerHost["Hosts"]["cpu_count"]
* 4)
+      putYarnPropertyAttribute('yarn.nodemanager.resource.cpu-vcores', 'maximum', nodeManagerHost["Hosts"]["cpu_count"]
* 2)
       putYarnPropertyAttribute('yarn.scheduler.minimum-allocation-vcores', 'maximum', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"])
       putYarnPropertyAttribute('yarn.scheduler.maximum-allocation-vcores', 'maximum', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"])
       putYarnPropertyAttribute('yarn.scheduler.minimum-allocation-mb', 'maximum', configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.memory-mb"])

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f6ca921/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index 9d5435d..c98d974 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -683,7 +683,7 @@ class TestHDP22StackAdvisor(TestCase):
         },
         "property_attributes": {
           'yarn.nodemanager.resource.memory-mb': {'maximum': '1877'},
-          'yarn.nodemanager.resource.cpu-vcores': {'maximum': '4'},
+          'yarn.nodemanager.resource.cpu-vcores': {'maximum': '2'},
           'yarn.scheduler.minimum-allocation-vcores': {'maximum': '2'},
           'yarn.scheduler.maximum-allocation-vcores': {'maximum': '2'},
           'yarn.scheduler.minimum-allocation-mb': {'maximum': '1280'},
@@ -831,6 +831,41 @@ class TestHDP22StackAdvisor(TestCase):
     self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services,
hosts)
     self.assertEquals(configurations, expected)
 
+    # Test host NodeManager CPU cores
+    hosts["items"][2]["Hosts"]["cpu_count"] = 6
+    services["changed-configurations"].remove({
+          "type": "yarn-site",
+          "name": "yarn.nodemanager.resource.cpu-vcores"
+        })
+    configurations["yarn-site"]["properties"].pop("yarn.nodemanager.resource.cpu-vcores",
None)
+    expected["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"] = '4'
+    expected["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-vcores"] = '1'
+    expected["yarn-site"]["properties"]["yarn.scheduler.maximum-allocation-vcores"] = '4'
+    expected["yarn-site"]["property_attributes"]["yarn.nodemanager.resource.cpu-vcores"]["maximum"]
= '12'
+    expected["yarn-site"]["property_attributes"]["yarn.scheduler.minimum-allocation-vcores"]["maximum"]
= '4'
+    expected["yarn-site"]["property_attributes"]["yarn.scheduler.maximum-allocation-vcores"]["maximum"]
= '4'
+    self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services,
hosts)
+    self.assertEquals(configurations, expected)
+
+    # Test host NodeManager CPU cores and 'yarn.nodemanager.resource.percentage-physical-cpu-limit'
+    hosts["items"][2]["Hosts"]["cpu_count"] = 10
+    configurations["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"]
= '0.5'
+    services["changed-configurations"].append({
+          "type": "yarn-site",
+          "name": "yarn.nodemanager.resource.percentage-physical-cpu-limit"
+        })
+    expected["yarn-site"]["properties"]["yarn.nodemanager.resource.cpu-vcores"] = '5'
+    expected["yarn-site"]["properties"]["yarn.scheduler.minimum-allocation-vcores"] = '1'
+    expected["yarn-site"]["properties"]["yarn.scheduler.maximum-allocation-vcores"] = '5'
+    expected["yarn-site"]["properties"]["yarn.nodemanager.resource.percentage-physical-cpu-limit"]
= '0.5'
+    expected["yarn-site"]["property_attributes"]["yarn.nodemanager.resource.cpu-vcores"]["maximum"]
= '20'
+    expected["yarn-site"]["property_attributes"]["yarn.scheduler.minimum-allocation-vcores"]["maximum"]
= '5'
+    expected["yarn-site"]["property_attributes"]["yarn.scheduler.maximum-allocation-vcores"]["maximum"]
= '5'
+    self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services,
hosts)
+    self.assertEquals(configurations, expected)
+    
+
+
   def test_recommendHiveConfigurationAttributes(self):
     self.maxDiff = None
     configurations = {
@@ -1125,16 +1160,16 @@ class TestHDP22StackAdvisor(TestCase):
         "properties": {
           "yarn.nodemanager.resource.memory-mb": "1280",
           "yarn.scheduler.minimum-allocation-mb": "100",
-          "yarn.scheduler.maximum-allocation-vcores": "4",
+          "yarn.scheduler.maximum-allocation-vcores": "1",
           "yarn.scheduler.minimum-allocation-vcores": "1",
           "yarn.scheduler.maximum-allocation-mb": "1280",
-          "yarn.nodemanager.resource.cpu-vcores": "2"
+          "yarn.nodemanager.resource.cpu-vcores": "1"
         },
         "property_attributes": {
           'yarn.nodemanager.resource.memory-mb': {'maximum': '1877'},
-          'yarn.nodemanager.resource.cpu-vcores': {'maximum': '4'},
-          'yarn.scheduler.minimum-allocation-vcores': {'maximum': '2'},
-          'yarn.scheduler.maximum-allocation-vcores': {'maximum': '2'},
+          'yarn.nodemanager.resource.cpu-vcores': {'maximum': '2'},
+          'yarn.scheduler.minimum-allocation-vcores': {'maximum': '1'},
+          'yarn.scheduler.maximum-allocation-vcores': {'maximum': '1'},
           'yarn.scheduler.minimum-allocation-mb': {'maximum': '1280'},
           'yarn.scheduler.maximum-allocation-mb': {'maximum': '1280'}
         }
@@ -2028,19 +2063,19 @@ class TestHDP22StackAdvisor(TestCase):
           "yarn.nodemanager.container-executor.cgroups.mount": "true",
           "yarn.nodemanager.resource.memory-mb": "39424",
           "yarn.scheduler.minimum-allocation-mb": "3584",
-          "yarn.scheduler.maximum-allocation-vcores": "6",
+          "yarn.scheduler.maximum-allocation-vcores": "4",
           "yarn.scheduler.minimum-allocation-vcores": "1",
-          "yarn.nodemanager.resource.cpu-vcores": "12",
+          "yarn.nodemanager.resource.cpu-vcores": "4",
           "yarn.nodemanager.container-executor.cgroups.hierarchy": " /yarn",
           "yarn.scheduler.maximum-allocation-mb": "39424",
           "yarn.nodemanager.container-executor.resources-handler.class": "org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler"
         },
         "property_attributes": {
           "yarn.scheduler.minimum-allocation-vcores": {
-            "maximum": "12"
+            "maximum": "4"
           },
           "yarn.scheduler.maximum-allocation-vcores": {
-            "maximum": "12"
+            "maximum": "4"
           },
           "yarn.nodemanager.resource.memory-mb": {
             "maximum": "49152"
@@ -2049,7 +2084,7 @@ class TestHDP22StackAdvisor(TestCase):
             "maximum": "39424"
           },
           "yarn.nodemanager.resource.cpu-vcores": {
-            "maximum": "24"
+            "maximum": "12"
           },
           "yarn.scheduler.maximum-allocation-mb": {
             "maximum": "39424"
@@ -2081,9 +2116,9 @@ class TestHDP22StackAdvisor(TestCase):
           "yarn.nodemanager.container-executor.cgroups.mount": "true",
           "yarn.nodemanager.resource.memory-mb": "39424",
           "yarn.scheduler.minimum-allocation-mb": "3584",
-          "yarn.scheduler.maximum-allocation-vcores": "6",
+          "yarn.scheduler.maximum-allocation-vcores": "4",
           "yarn.scheduler.minimum-allocation-vcores": "1",
-          "yarn.nodemanager.resource.cpu-vcores": "12",
+          "yarn.nodemanager.resource.cpu-vcores": "4",
           "yarn.nodemanager.container-executor.cgroups.hierarchy": " /yarn",
           "yarn.scheduler.maximum-allocation-mb": "39424",
           "yarn.nodemanager.container-executor.resources-handler.class": "org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler"
@@ -2099,10 +2134,10 @@ class TestHDP22StackAdvisor(TestCase):
             "delete": "true"
           },
           "yarn.scheduler.minimum-allocation-vcores": {
-            "maximum": "12"
+            "maximum": "4"
           },
           "yarn.scheduler.maximum-allocation-vcores": {
-            "maximum": "12"
+            "maximum": "4"
           },
           "yarn.nodemanager.resource.memory-mb": {
             "maximum": "49152"
@@ -2111,7 +2146,7 @@ class TestHDP22StackAdvisor(TestCase):
             "maximum": "39424"
           },
           "yarn.nodemanager.resource.cpu-vcores": {
-            "maximum": "24"
+            "maximum": "12"
           },
           "yarn.scheduler.maximum-allocation-mb": {
             "maximum": "39424"


Mime
View raw message