ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject [1/4] ambari git commit: AMBARI-15487. Add support for ECS stack (Vijay Srinivasaraghavan via smohanty)
Date Mon, 21 Mar 2016 12:29:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 c5cfee955 -> 4dc612602


http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-server/src/test/resources/stacks/HDP/2.2.0.ECS/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.2.0.ECS/services/HDFS/metainfo.xml
b/ambari-server/src/test/resources/stacks/HDP/2.2.0.ECS/services/HDFS/metainfo.xml
new file mode 100644
index 0000000..ed20968
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.2.0.ECS/services/HDFS/metainfo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>HDFS</name>
+      <comment>Apache Hadoop Distributed File System</comment>
+      <version>2.1.0.2.0.6.0</version>
+      <deleted>true</deleted>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js
index 2fef3d3..3c549cd 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -278,7 +278,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({
     var dfsServices = ['HDFS', 'GLUSTERFS'];
     var availableServices = this.filterProperty('isInstalled',false);
     availableServices.forEach(function(service){
-      if (dfsServices.contains(service.get('serviceName'))) {
+      if (dfsServices.contains(service.get('serviceName')) || service.get('serviceType')
== 'HCFS' ) {
         console.log("found DFS " + service.get('serviceName'));
         bDFSStack=true;
       }
@@ -294,24 +294,25 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   fileSystemServiceValidation: function(callback) {
     if(this.isDFSStack()){
       var primaryDFS = this.findProperty('isPrimaryDFS',true);
-      var primaryDfsDisplayName = primaryDFS.get('displayNameOnSelectServicePage');
-      var primaryDfsServiceName = primaryDFS.get('serviceName');
-      if (this.multipleDFSs()) {
-        var dfsServices = this.filterProperty('isDFS',true).filterProperty('isSelected',true).mapProperty('serviceName');
-        var services = dfsServices.map(function (item){
+      if (primaryDFS) {
+        var primaryDfsDisplayName = primaryDFS.get('displayNameOnSelectServicePage');
+        var primaryDfsServiceName = primaryDFS.get('serviceName');
+        if (this.multipleDFSs()) {
+          var dfsServices = this.filterProperty('isDFS',true).filterProperty('isSelected',true).mapProperty('serviceName');
+          var services = dfsServices.map(function (item){
           return  {
-            serviceName: item,
-            selected: item === primaryDfsServiceName
-          };
-        });
-        this.addValidationError({
-          id: 'multipleDFS',
-          callback: this.needToAddServicePopup,
-          callbackParams: [services, 'multipleDFS', primaryDfsDisplayName, callback]
-        });
-      }
+                     serviceName: item,
+                     selected: item === primaryDfsServiceName
+                  };
+          });
+          this.addValidationError({
+                     id: 'multipleDFS',
+                     callback: this.needToAddServicePopup,
+                     callbackParams: [services, 'multipleDFS', primaryDfsDisplayName]
+          });
+        }
     }
-  },
+  }},
 
   /**
    * Checks if a dependent service is selected without selecting the main service.

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 54dfde0..d49fcc1 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -1912,6 +1912,21 @@ var hdp2properties = [
     "category": "Ambari Principals",
     "filename": "storm-env.xml",
     "index": 12
+  },
+//***************************************** ECS stack********************************************
+  {
+    "id": "puppet var",
+    "name": "hdfs_log_dir_prefix",
+    "displayName": "Hadoop Log Dir Prefix",
+    "description": "The parent directory for Hadoop log files.  The HDFS log directory will
be ${hadoop_log_dir_prefix} / ${hdfs_user} and the MapReduce log directory will be ${hadoop_log_dir_prefix}
/ ${mapred_user}.",
+    "recommendedValue": "/var/log/hadoop",
+    "isReconfigurable": false,
+    "displayType": "directory",
+    "isOverridable": false,
+    "isVisible": false,
+    "serviceName": "ECS",
+    "filename": "hadoop-env.xml",
+    "category": "General Hadoop"
   }
 ].concat(require('data/HDP2/alert_notification')).concat(require('data/HDP2/gluster_fs_properties'));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-web/app/mappers/stack_service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_service_mapper.js b/ambari-web/app/mappers/stack_service_mapper.js
index 1af4bdf..8a65055 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -25,6 +25,7 @@ App.stackServiceMapper = App.QuickDataMapper.create({
     id: 'service_name',
     stack_id: 'stack_id',
     service_name: 'service_name',
+    service_type: 'service_type',
     display_name: 'display_name',
     config_types: 'config_types',
     comments: 'comments',

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-web/app/mixins/common/configs/configs_saver.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_saver.js b/ambari-web/app/mixins/common/configs/configs_saver.js
index ee00146..f8b258f 100644
--- a/ambari-web/app/mixins/common/configs/configs_saver.js
+++ b/ambari-web/app/mixins/common/configs/configs_saver.js
@@ -389,7 +389,9 @@ App.ConfigsSaverMixin = Em.Mixin.create({
       case 'mapred-queue-acls.xml':
         return false;
       case 'core-site.xml':
-        return ['HDFS', 'GLUSTERFS', 'RANGER_KMS'].contains(this.get('content.serviceName'));
+        var serviceName = this.get('content.serviceName');
+        var serviceType = App.StackService.find().findProperty('serviceName',serviceName).get('serviceType');
+        return ['HDFS', 'GLUSTERFS', 'RANGER_KMS'].contains(this.get('content.serviceName'))
|| serviceType === 'HCFS';
       default :
         return true;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index c13bdfc..ad2c03c 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -27,6 +27,7 @@ require('models/configs/objects/service_config_category');
  */
 App.StackService = DS.Model.extend({
   serviceName: DS.attr('string'),
+  serviceType: DS.attr('string'),
   displayName: DS.attr('string'),
   comments: DS.attr('string'),
   configTypes: DS.attr('object'),
@@ -53,7 +54,10 @@ App.StackService = DS.Model.extend({
   // Is the service a distributed filesystem
   isDFS: function () {
     var dfsServices = ['HDFS', 'GLUSTERFS'];
-    return dfsServices.contains(this.get('serviceName'));
+    if( this.get('serviceType') == 'HCFS' || dfsServices.contains(this.get('serviceName'))
)
+    	return true;
+    else
+    	return false;
   }.property('serviceName'),
 
   // Primary DFS. used if there is more than one DFS in a stack.

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/ambari-web/test/mixins/common/configs/configs_saver_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/configs_saver_test.js b/ambari-web/test/mixins/common/configs/configs_saver_test.js
index d8b3cb3..5bf6f26 100644
--- a/ambari-web/test/mixins/common/configs/configs_saver_test.js
+++ b/ambari-web/test/mixins/common/configs/configs_saver_test.js
@@ -23,27 +23,60 @@ describe('App.ConfigsSaverMixin', function() {
   var instanceObject = mixinObject.create({});
 
   describe('#allowSaveSite()', function() {
-
+    var stackServices = [
+      Em.Object.create({
+        serviceName: 'HDFS',
+        serviceType: 'NONHCFS'
+      }),
+      Em.Object.create({
+        serviceName: 'S1',
+        serviceType: 'HCFS'
+      }),
+      Em.Object.create({
+        serviceName: 'S2',
+        serviceType: 'NONHCFS'
+      }),
+      Em.Object.create({
+        serviceName: 'S3'
+      })
+    ];
     beforeEach(function() {
       instanceObject.set('content', {});
+      sinon.stub(App.StackService, 'find', function () {
+        return stackServices;
+      });
+    });
+
+    afterEach(function() {
+      App.StackService.find.restore();
     });
 
     it('returns true by default', function() {
       expect(instanceObject.allowSaveSite('some-site')).to.be.true
     });
 
-    it('returns false for mapred-queue-acls.xml', function() {
-      expect(instanceObject.allowSaveSite('mapred-queue-acls.xml')).to.be.false
+    it('returns true for core-site and proper service', function() {
+      instanceObject.set('content.serviceName', 'HDFS');
+      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.true
     });
 
-    it('returns false for core-site but not proper service', function() {
-      instanceObject.set('content.serviceName', 'ANY');
+    it('returns true for core-site and serviceType HCFS', function() {
+      instanceObject.set('content.serviceName', 'S1');
+      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.true
+    });
+
+    it('returns false for core-site and serviceType not HCFS', function() {
+      instanceObject.set('content.serviceName', 'S2');
       expect(instanceObject.allowSaveSite('core-site.xml')).to.be.false
     });
 
-    it('returns true for core-site and proper service', function() {
-      instanceObject.set('content.serviceName', 'HDFS');
-      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.true
+    it('returns false for core-site but serviceType undefined', function() {
+      instanceObject.set('content.serviceName', 'S3');
+      expect(instanceObject.allowSaveSite('core-site.xml')).to.be.false
+    });
+
+    it('returns false for mapred-queue-acls.xml', function() {
+      expect(instanceObject.allowSaveSite('mapred-queue-acls.xml')).to.be.false
     });
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Runner.java
----------------------------------------------------------------------
diff --git a/contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Runner.java
b/contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Runner.java
index 70870de..e4656c7 100644
--- a/contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Runner.java
+++ b/contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Runner.java
@@ -88,8 +88,12 @@ public class Runner {
           dfs.delete(pathHadoop, true);
         }
       }
-
-    } finally {
+    } 
+    catch(Exception e) {
+       System.out.println("Exception occurred, Reason: " + e.getMessage());
+       e.printStackTrace();
+    }
+    finally {
       dfs.close();
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dc61260/dev-support/docker/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/dev-support/docker/docker/Dockerfile b/dev-support/docker/docker/Dockerfile
index 701ed6e..bf47021 100644
--- a/dev-support/docker/docker/Dockerfile
+++ b/dev-support/docker/docker/Dockerfile
@@ -16,7 +16,7 @@ RUN echo root:changeme | chpasswd
 
 ## Install some basic utilities that aren't in the default image
 RUN yum clean all -y && yum update -y
-RUN yum -y install vim wget rpm-build sudo which telnet tar openssh-server openssh-clients
ntp git python-setuptools httpd
+RUN yum -y install vim wget rpm-build sudo which telnet tar openssh-server openssh-clients
ntp git python-setuptools python-devel httpd
 # phantomjs dependency
 RUN yum -y install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
 RUN rpm -e --nodeps --justdb glibc-common
@@ -25,11 +25,8 @@ RUN yum -y install glibc-common
 ENV HOME /root
 
 #Install JAVA
-# RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie"
http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm -O jdk-7u55-linux-x64.rpm
-# RUN yum -y install jdk-7u55-linux-x64.rpm
-RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie"
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin -O jdk-6u45-linux-x64-rpm.bin
-RUN chmod +x jdk-6u45-linux-x64-rpm.bin
-RUN ./jdk-6u45-linux-x64-rpm.bin
+RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie"
http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm -O jdk-7u55-linux-x64.rpm
+RUN rpm -ivh jdk-7u55-linux-x64.rpm
 ENV JAVA_HOME /usr/java/default/
 
 #Install Maven
@@ -50,6 +47,9 @@ RUN cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys
 RUN chmod 600 /root/.ssh/authorized_keys
 RUN sed -ri 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
 
+#To allow bower install behind proxy. See https://github.com/bower/bower/issues/731
+RUN git config --global url."https://".insteadOf git://
+
 # Install python, nodejs and npm
 RUN yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
 RUN yum -y install nodejs npm --enablerepo=epel
@@ -59,8 +59,8 @@ RUN npm install -g brunch@1.7.13
 WORKDIR /tmp
 RUN git clone https://github.com/apache/ambari.git
 WORKDIR /tmp/ambari
-RUN mvn versions:set -DnewVersion=1.6.1.0
-RUN mvn -B clean install package rpm:rpm -DskipTests -DnewVersion=1.6.1.0 -Dpython.ver="python
>= 2.6" -Preplaceurl
+
+RUN mvn -B -X clean install package rpm:rpm -DskipTests -Dpython.ver="python >= 2.6" -Preplaceurl
 
 # clean git code because I want to use the one on local filesystem.
 WORKDIR /tmp


Mime
View raw message