You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by is...@apache.org on 2018/06/19 14:35:23 UTC

[ambari] branch trunk updated: [AMBARI-24130] Ranger/Atlas Default Install Changes. (#1565)

This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 24244f6  [AMBARI-24130] Ranger/Atlas Default Install Changes. (#1565)
24244f6 is described below

commit 24244f68b138638c58ad9d180eea449a5ff99178
Author: Ishan Bhatt <is...@gmail.com>
AuthorDate: Tue Jun 19 07:35:21 2018 -0700

    [AMBARI-24130] Ranger/Atlas Default Install Changes. (#1565)
    
    * [AMBARI-24130] Ranger/Atlas Default Install Changes.
    
    * minor fixes
---
 .../app/controllers/wizard/step4_controller.js     | 67 ----------------------
 ambari-web/app/messages.js                         |  4 +-
 .../configs/widgets/combo_config_widget_view.js    | 26 ++++++++-
 ambari-web/test/controllers/wizard/step4_test.js   | 60 +------------------
 4 files changed, 27 insertions(+), 130 deletions(-)

diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js
index d0bf657..767147d 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -88,33 +88,6 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   },
 
   /**
-   * Check whether Ranger is selected and show installation requirements if yes
-   * @param {function} callback
-   * @method rangerValidation
-   */
-  rangerValidation: function (callback) {
-    var rangerService = this.findProperty('serviceName', 'RANGER');
-    if (rangerService && !rangerService.get('isInstalled')) {
-      if(rangerService.get('isSelected')) {
-        this.addValidationError({
-          id: 'rangerRequirements',
-          type: 'WARNING',
-          callback: this.rangerRequirementsPopup,
-          callbackParams: [callback]
-        });
-      }
-      else {
-        //Ranger is selected, remove the Ranger error from errorObject array
-        var rangerError = this.get('errorStack').filterProperty('id',"rangerRequirements");
-        if(rangerError)
-        {
-           this.get('errorStack').removeObject(rangerError[0]);
-        }
-      }
-    }
-  },
-
-  /**
    * Warn user if he tries to install Spark with HDP 2.2
    * @param {function} callback
    * @method sparkValidation
@@ -199,7 +172,6 @@ App.WizardStep4Controller = Em.ArrayController.extend({
     this.dependentServiceValidation('ATLAS', 'AMBARI_INFRA_SOLR', 'ambariAtlasInfraCheck', callback);
     this.dependentServiceValidation('ATLAS', 'HBASE', 'ambariAtlasHbaseCheck', callback);
     this.dependentServiceValidation('LOGSEARCH', 'AMBARI_INFRA_SOLR', 'ambariLogsearchCheck', callback);
-    this.rangerValidation(callback);
     this.sparkValidation(callback);
     if (!!this.get('errorStack').filterProperty('isShown', false).length) {
       var firstError = this.get('errorStack').findProperty('isShown', false);
@@ -574,45 +546,6 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   },
 
   /**
-   * Show popup with installation requirements for Ranger service
-   * @param {function} callback
-   * @param {string} id
-   * @return {App.ModalPopup}
-   * @method rangerRequirementsPopup
-   */
-  rangerRequirementsPopup: function (callback, id) {
-    var self = this;
-    return App.ModalPopup.show({
-      'data-qa': 'ranger-requirements-modal',
-      header: Em.I18n.t('installer.step4.rangerRequirements.popup.header'),
-      bodyClass: Em.View.extend({
-        templateName: require('templates/wizard/step4/step4_ranger_requirements_popup')
-      }),
-      primary: Em.I18n.t('common.proceed'),
-      isChecked: false,
-      disablePrimary: function () {
-        return !this.get('isChecked');
-      }.property('isChecked'),
-      onPrimary: function () {
-        self.onPrimaryPopupCallback(callback);
-        this.hide();
-      },
-      onSecondary: function () {
-        if (callback) {
-          callback(id);
-        }
-        this._super();
-      },
-      onClose: function () {
-        if (callback) {
-          callback(id);
-        }
-        this._super();
-      }
-    });
-  },
-
-  /**
    * Show popup with Spark installation warning
    * @param {function} callback
    * @param {string} id
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 4686e66..d908f15 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -916,7 +916,7 @@ Em.I18n.translations = {
   'will need to collect configuration and logs manually for troubleshooting support cases. ' +
   'Are you sure you want to proceed without SmartSense?',
   'installer.step4.rangerCheck.popup.header': 'Apache Ranger',
-  'installer.step4.rangerCheck.popup.body':'Apache Ranger provides fine grained authorization and audit of access attempts for many Hadoop ecosystem services. If you do not install the Apache Ranger Service, the security of your cluster will be diminished. Are you sure you want to proceed without it? ',
+  'installer.step4.rangerCheck.popup.body':'Apache Ranger provides fine grained authorization and audit of access attempts for many Hadoop ecosystem services. If you do not install the Apache Ranger Service and enable Kerberos, the security of your cluster will be diminished. Are you sure you want to proceed without it? ',
   'installer.step4.atlasCheck.popup.header': 'Apache Atlas',
   'installer.step4.atlasCheck.popup.body':'Apache Atlas provides strong data governance, lineage and metadata management for many hadoop ecosystem services. If you do not install Apache Atlas service, the data governance capabilities of you cluster will be diminished. Are you sure you want to proceed without it? ',
 
@@ -2342,7 +2342,7 @@ Em.I18n.translations = {
   'services.service.config.configHistory.makeCurrent.message': 'Created from service config version {0}',
   'services.service.config.configHistory.comparing': 'Comparing Changes in',
   'services.service.config.setRecommendedValue': 'Set Recommended',
-  'services.service.config.database.msg.jdbcSetup.detailed': 'To use {0} with Hive, you must <a href="{3}" target="_blank">' +
+  'services.service.config.database.msg.jdbcSetup.detailed': 'To use {0} with {6}, you must <a href="{3}" target="_blank">' +
     'download the {4} from {0}</a>. Once downloaded to the Ambari Server host, run: <br/>' +
     '<b>ambari-server setup --jdbc-db={1} --jdbc-driver=/path/to/{1}/{2}</b>',
 
diff --git a/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
index fe38bf5..b9dfc51 100644
--- a/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
@@ -52,9 +52,21 @@ App.ComboConfigWidgetView = App.ConfigWidgetView.extend({
     this.addCustomMessage();
   },
 
+  customMessageServiceMapping: [
+    {
+      serviceName: 'HIVE', dbConfigName: 'hive_database'
+    },
+    {
+      serviceName: 'RANGER', dbConfigName: 'DB_FLAVOR'
+    },
+    {
+      serviceName: 'RANGER_KMS', dbConfigName: 'DB_FLAVOR'
+    }
+  ],
+
   addCustomMessage: function () {
-    // show warning alert about downloading db connector for hive database
-    if (this.get('config.name') === 'hive_database') {
+    // show warning alert about downloading db connector for services with databases
+    if (this.isCustomMessageRequired()) {
       this.set('config.additionalView', Em.View.extend({
         template: Em.Handlebars.compile('<div class="alert alert-warning enhanced-configs">{{{view.message}}}</div>'),
         message: function () {
@@ -66,7 +78,8 @@ App.ComboConfigWidgetView = App.ConfigWidgetView.extend({
             dbData.driver,
             dbData.driver_download_url,
             dbData.driver_download_url,
-            dbData.driver_name
+            dbData.driver_name,
+            this.get('config.serviceName').toCapital()
           );
         }.property('config.value'),
         config: this.get('config')
@@ -74,6 +87,13 @@ App.ComboConfigWidgetView = App.ConfigWidgetView.extend({
     }
   },
 
+  isCustomMessageRequired: function () {
+    var self = this;
+    return this.get('customMessageServiceMapping').find(function (configMap) {
+      return configMap['serviceName'].toLowerCase() === self.get('config.serviceName').toLowerCase() && configMap['dbConfigName'].toLowerCase() === self.get('config.name').toLowerCase()
+    });
+  },
+
   disableSwitchToTextBox: function () {
     var valueAttributes = this.get('config.valueAttributes');
     if (valueAttributes && valueAttributes.hasOwnProperty('entriesEditable') && !valueAttributes.entriesEditable) {
diff --git a/ambari-web/test/controllers/wizard/step4_test.js b/ambari-web/test/controllers/wizard/step4_test.js
index 247e316..91b7354 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -338,7 +338,7 @@ describe('App.WizardStep4Controller', function () {
         },
         {
           services: ['RANGER'],
-          errorsExpected: ['ambariMetricsCheck', 'smartSenseCheck', 'atlasCheck', 'ambariRangerInfraCheck', 'rangerRequirements']
+          errorsExpected: ['ambariMetricsCheck', 'smartSenseCheck', 'atlasCheck', 'ambariRangerInfraCheck']
         },
         {
           services: ['SMARTSENSE'],
@@ -354,7 +354,7 @@ describe('App.WizardStep4Controller', function () {
         },
         {
           services: ['ATLAS', 'AMBARI_METRICS', 'SMARTSENSE', 'RANGER'],
-          errorsExpected: ['ambariRangerInfraCheck', 'ambariAtlasInfraCheck', 'ambariAtlasHbaseCheck', 'rangerRequirements']
+          errorsExpected: ['ambariRangerInfraCheck', 'ambariAtlasInfraCheck', 'ambariAtlasHbaseCheck']
         },
       ],
       controllerNames = ['installerController', 'addServiceController'],
@@ -736,61 +736,6 @@ describe('App.WizardStep4Controller', function () {
 
   });
 
-  describe('#rangerValidation', function () {
-
-    var cases = [
-      {
-        services: ['HDFS'],
-        isRangerWarning: false,
-        title: 'Ranger not available'
-      },
-      {
-        services: ['RANGER'],
-        isRangerSelected: false,
-        isRangerInstalled: false,
-        isRangerWarning: false,
-        title: 'Ranger not selected'
-      },
-      {
-        services: ['RANGER'],
-        isRangerSelected: true,
-        isRangerInstalled: false,
-        isRangerWarning: true,
-        title: 'Ranger selected'
-      },
-      {
-        services: ['RANGER'],
-        isRangerSelected: true,
-        isRangerInstalled: true,
-        isRangerWarning: false,
-        title: 'Ranger installed'
-      }
-    ];
-
-    beforeEach(function() {
-      controller.clear();
-      controller.set('errorStack', []);
-    });
-
-    cases.forEach(function (item) {
-      it(item.title, function () {
-        controller.set('content', generateSelectedServicesContent(item.services));
-        var ranger = controller.findProperty('serviceName', 'RANGER');
-        if (item.services.contains('RANGER')) {
-          ranger.setProperties({
-            isSelected: item.isRangerSelected,
-            isInstalled: item.isRangerInstalled
-          });
-        } else {
-          controller.removeObject(ranger);
-        }
-        controller.rangerValidation();
-        expect(controller.get('errorStack').mapProperty('id').contains('rangerRequirements')).to.equal(item.isRangerWarning);
-      });
-    });
-
-  });
-
   describe('#sparkValidation', function () {
 
     var cases = [
@@ -988,7 +933,6 @@ describe('App.WizardStep4Controller', function () {
 
     Em.A([
       'serviceCheckPopup',
-      'rangerRequirementsPopup',
       'sparkWarningPopup'
     ]).forEach(function (methodName) {