Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ambari-web/app/controllers/wizard/step7_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ App.WizardStep7Controller = App.WizardStepController.extend(App.ServerValidatorM
if (isRangerServiceAbsent) {
var isExternalRangerSetup;
if (isInstallerWizard) {
isExternalRangerSetup = configs.filterProperty('fileName','cluster-env.xml').findProperty('name','enable_external_ranger');
isExternalRangerSetup = configs.filterProperty('fileName','cluster-settings.xml').findProperty('name','enable_external_ranger');
if (Em.isNone(isExternalRangerSetup) || isExternalRangerSetup.value !== "true") {
App.config.removeRangerConfigs(this.get('stepConfigs'));
}
Expand Down
46 changes: 29 additions & 17 deletions ambari-web/app/controllers/wizard/step8_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,8 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
this.applyConfigurationsToCluster(this.generateDesiredConfigsJSON(this.get('configs'), fileNamesToUpdate));
}
}
this.createConfigurations();
this.configureCluster();
this.createServiceConfigurations();
this.applyConfigurationsToCluster(this.get('serviceConfigTags'));
}
this.createComponents();
Expand Down Expand Up @@ -1495,15 +1496,34 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
},

/**
* Create config objects for cluster and services
* @method createConfigurations
* Configure cluster settings
*/
createConfigurations: function () {
if (this.get('isInstaller')) {
/** add cluster-env **/
this.get('serviceConfigTags').pushObject(this.createDesiredConfig('cluster-env', this.get('configs').filterProperty('filename', 'cluster-env.xml')));
}
configureCluster: function () {
const clusterSettings = this.get('configs').filterProperty('filename', 'cluster-settings.xml');
const data = [];
clusterSettings.forEach(setting => {
data.push({
"ClusterSettingInfo": {
"cluster_setting_name": setting.name,
"cluster_setting_value": setting.value
}
})
});

this.addRequestToAjaxQueue({
name: 'common.cluster.settings',
data: {
clusterName: this.get('clusterName'),
data: data
}
});
},

/**
* Create config objects for services
* @method createServiceConfigurations
*/
createServiceConfigurations: function () {
this.get('selectedServices').forEach(function (service) {
Object.keys(service.get('configTypes')).forEach(function (type) {
if (!this.get('serviceConfigTags').someProperty('type', type)) {
Expand Down Expand Up @@ -1563,14 +1583,6 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
}));
}
}, this);
var clusterConfig = serviceConfigTags.findProperty('type', 'cluster-env');
if (clusterConfig) {
allConfigData.pushObject(JSON.stringify({
Clusters: {
desired_config: [clusterConfig]
}
}));
}

this.addRequestToAjaxQueue({
name: 'common.across.services.configurations',
Expand Down Expand Up @@ -1906,7 +1918,7 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
//service configurations
var totalConf = [];
//Add cluster-env
var clusterEnv = this.get('configs').filterProperty('filename', 'cluster-env.xml');
var clusterEnv = this.get('configs').filterProperty('filename', 'cluster-settings.xml');
var configurations = {};
configurations["cluster-env"] = self.getConfigurationDetailsForConfigType(clusterEnv);
totalConf.push(configurations);
Expand Down
16 changes: 13 additions & 3 deletions ambari-web/app/controllers/wizard/step9_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ App.WizardStep9Controller = App.WizardStepController.extend(App.ReloadPopupMixin
* @type {bool}
*/
isSubmitDisabled: function () {
var validStates = ['STARTED', 'START FAILED', 'START_SKIPPED'];
var validStates = ['INSTALLED', 'STARTED', 'START FAILED', 'START_SKIPPED'];
var controllerName = this.get('content.controllerName');
if (controllerName == 'addHostController' || controllerName == 'addServiceController') {
validStates.push('INSTALL FAILED');
Expand All @@ -119,7 +119,7 @@ App.WizardStep9Controller = App.WizardStepController.extend(App.ReloadPopupMixin
|| !validStates.contains(this.get('content.cluster.status'));
}.property('content.cluster.status'),

isNextButtonDisabled: Em.computed.or('App.router.nextBtnClickInProgress', 'isSubmitDisabled', 'wizardController.errors'),
isNextButtonDisabled: Em.computed.or('App.router.nextBtnClickInProgress', 'isSubmitDisabled', 'wizardController.errors.length'),

/**
* Observer function: Enables previous steps link if install task failed in installer wizard.
Expand All @@ -141,7 +141,17 @@ App.WizardStep9Controller = App.WizardStepController.extend(App.ReloadPopupMixin
* Computed property to determine if the Retry button should be made visible on the page.
* @type {bool}
*/
showRetry: Em.computed.equal('content.cluster.status', 'INSTALL FAILED'),
showRetry: function () {
const status = this.get('content.cluster.status');
switch (status) {
case 'INSTALL FAILED':
case 'INSTALLED':
case 'START FAILED':
return true;
}

return false;
}.property('content.cluster.status'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently BE is not correctly handling the state transition from "INSTALLED" to "STARTED", "START_FAILED" or "START_SKIPPED" so this is a temporary workaround. Once that is fixed this will need to be reverted. @mradha25 will open a jira for that.


/**
* Observer function: Calls {hostStatusUpdates} function once with change in a host status from any registered hosts.
Expand Down
6 changes: 3 additions & 3 deletions ambari-web/app/data/configs/wizards/kerberos_identities.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ module.exports = {
"name": "smokeuser_principal_name",
"displayName": "Smoke user principal",
"category": "Ambari Principals",
"filename": "cluster-env.xml",
"filename": "cluster-settings.xml",
"index": 1
},
{
"name": "smokeuser_keytab",
"displayName": "Smoke user keytab",
"category": "Ambari Principals",
"filename": "cluster-env.xml",
"filename": "cluster-settings.xml",
"index": 2
},
{
"name": "ambari-server_keytab",
"displayName": "Ambari Keytab",
"category": "Ambari Principals",
"filename": "cluster-env.xml",
"filename": "cluster-settings.xml",
"index": 3
},
{
Expand Down
36 changes: 25 additions & 11 deletions ambari-web/app/mappers/configs/stack_config_properties_mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,43 @@ App.stackConfigPropertiesMapper = App.QuickDataMapper.create({

map: function (json) {
console.time('App.stackConfigPropertiesMapper execution time');
if (json && json.Versions) {
//hack for cluster versions
json = {items: [json]};
var clusterConfigs = true;
}
if (json && json.items) {
//check if we are working with cluster settings
let clusterConfigs = false;
if (json.items[0].ClusterSettingsInfo) {
//change layout to match service configs so we can use same code to process
json = {
items: [
{ configurations: json.items }
]
}

clusterConfigs = true;
}

var configs = [];
json.items.forEach(function(stackItem) {
var configTypeInfo = clusterConfigs ? Em.get(stackItem, 'Versions.config_types') : Em.get(stackItem, 'StackServices.config_types');
json.items.forEach(function (stackItem) {
if (!clusterConfigs) {
var configTypeInfo = Em.get(stackItem, 'StackServices.config_types');
}

stackItem.configurations.forEach(function(config) {
stackItem.configurations.forEach(function (config) {
if (clusterConfigs) {
config.StackConfigurations = config.StackLevelConfigurations;
config.StackConfigurations = config.ClusterSettingsInfo;
}
var configType = App.config.getConfigTagFromFileName(config.StackConfigurations.type);
config.id = App.config.configId(config.StackConfigurations.property_name, configType);
config.recommended_is_final = config.StackConfigurations.final === "true";
config.supports_final = !!configTypeInfo[configType] && configTypeInfo[configType].supports.final === "true";
if (!clusterConfigs) {
config.supports_final = !!configTypeInfo[configType] && configTypeInfo[configType].supports.final === "true";
} else {
config.supports_final = false;
}

var attributes = config.StackConfigurations.property_value_attributes;
if (attributes) {
config.is_required = this._isRequired(attributes.empty_value_valid, config.StackConfigurations.property_value);
config.is_reconfigurable = !(attributes.editable_only_at_install || config.StackConfigurations.type === 'cluster-env.xml');
config.is_reconfigurable = !(attributes.editable_only_at_install || config.StackConfigurations.type === 'cluster-settings.xml');
config.is_editable = !attributes.read_only;
config.is_required_by_agent = !attributes.ui_only_property;
}
Expand Down
7 changes: 5 additions & 2 deletions ambari-web/app/styles/application.less
Original file line number Diff line number Diff line change
Expand Up @@ -2637,8 +2637,11 @@ td .no-data {
display: table;
}
.row.same-col-heights [class*="col-"]{
display: table-cell;
float: none;
&.wizard-nav,
&.wizard-content {
display: table-cell;
float: none;
}
&.wizard-content {
width: 9999999999px;
}
Expand Down
14 changes: 11 additions & 3 deletions ambari-web/app/styles/wizard.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
border: 1px solid #ddd;
}
.panel.panel-default.panel-internal.install-retry-panel {
border-top: none;
border-left: none;
border-right: none;
border: none;
}
padding: 30px;
background-color: #fff;
Expand Down Expand Up @@ -374,6 +372,16 @@
}
}
#deploy {
#overall-progress {
.progress {
margin-bottom: 0;
}

.progress-message {
vertical-align: middle;
}
}

.page-bar {
border: none;
}
Expand Down
13 changes: 8 additions & 5 deletions ambari-web/app/templates/wizard/step9.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
<div class="panel panel-default">
<div class="panel-body">
<p class="step-description">{{t installer.step9.body}}</p>
<div class="row" {{QAAttr "overall-progress"}}>
<div class="row" id="overall-progress" {{QAAttr "overall-progress"}}>
<div class="col-md-10">
<div class="progress" {{QAAttr "progress-{status}"}}>
<div {{bindAttr class="view.isStepCompleted::progress-bar-striped view.isStepCompleted::active view.barColor :progress-bar"}} {{bindAttr style="view.barWidth"}} {{QAAttr "progress-bar-{progress}"}}>
</div>
</div>
</div>
<div class="col-md-2" {{QAAttr "progress-message"}}>{{view.progressMessage}}</div>
<div class="col-md-2 progress-message" {{QAAttr "progress-message"}}>{{view.progressMessage}}</div>
</div>

<div class="panel panel-default panel-internal install-retry-panel">
<div class="panel-heading">
<div class="row">
<div class="col-xs-12">
<div class="pull-right">
{{#if controller.showRetry}}
<button class="btn btn-default" href="#" {{action retry}} {{QAAttr "retry-button"}}>
Expand All @@ -60,7 +60,9 @@
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body pre-scrollable">
</div>
<div class="row">
<div class="col-xs-12">
<table id="deploy-status-by-host" class="table table-hover" {{QAAttr "hosts-table"}}>
<thead>
<tr>
Expand Down Expand Up @@ -111,6 +113,7 @@
</table>
</div>
</div>

{{#if view.resultMsg}}
<p {{bindAttr class="view.resultMsgColor :alert :alert-warning"}} {{QAAttr "deploy-result-{status}"}}>{{view.resultMsg}}
{{#if view.isHostHeartbeatLost}}
Expand Down
12 changes: 11 additions & 1 deletion ambari-web/app/utils/ajax/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ var urls = {
}
},

'common.cluster.settings' : {
'type': 'POST',
'real': '/clusters/{clusterName}/settings',
'format': function (data) {
return {
data: JSON.stringify(data.data)
};
}
},

'common.services.update' : {
'real': '/clusters/{clusterName}/servicegroups/{defaultServiceGroupName}/services?{urlParams}',
'mock': '/data/wizard/deploy/poll_1.json',
Expand Down Expand Up @@ -738,7 +748,7 @@ var urls = {
/*************************STACK CONFIGS**************************************/

'configs.stack_configs.load.cluster_configs': {
'real': '{stackVersionUrl}?fields=configurations/*,Versions/config_types/*',
'real': '/cluster_settings?fields=*',
'mock': '/data/stacks/HDP-2.2/configurations.json'
},

Expand Down
3 changes: 0 additions & 3 deletions ambari-web/app/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,6 @@ App.config = Em.Object.create({
return App.ajax.send({
name: 'configs.stack_configs.load.cluster_configs',
sender: this,
data: {
stackVersionUrl: App.get('stackVersionURL')
},
success: 'saveConfigsToModel'
});
},
Expand Down
4 changes: 2 additions & 2 deletions ambari-web/test/controllers/wizard/step8_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ describe('App.WizardStep8Controller', function () {

describe('#startDeploy', function () {

var stubbedNames = ['createCluster', 'createServiceGroups', 'createSelectedServices', 'createConfigurations',
var stubbedNames = ['createCluster', 'createServiceGroups', 'createSelectedServices', 'configureCluster', 'createServiceConfigurations',
'applyConfigurationsToCluster', 'createComponents', 'registerHostsToCluster', 'createConfigurationGroups',
'createMasterHostComponents', 'createSlaveAndClientsHostComponents', 'createAdditionalClientComponents',
'createAdditionalHostComponents'],
Expand All @@ -2007,7 +2007,7 @@ describe('App.WizardStep8Controller', function () {
},
{
controllerName: 'addHostController',
notExecuted: ['createConfigurations', 'applyConfigurationsToCluster', 'createAdditionalClientComponents'],
notExecuted: ['configureCluster', 'createServiceConfigurations', 'applyConfigurationsToCluster', 'createAdditionalClientComponents'],
title: 'Add Host Wizard'
},
{
Expand Down
6 changes: 3 additions & 3 deletions ambari-web/test/controllers/wizard/step9_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ describe('App.InstallerStep9Controller', function () {
{controllerName: 'addHostController', state: 'START FAILED', e: false},
{controllerName: 'addHostController', state: 'INSTALL FAILED', e: false},
{controllerName: 'addHostController', state: 'PENDING', e: true},
{controllerName: 'addHostController', state: 'INSTALLED', e: true},
{controllerName: 'addHostController', state: 'INSTALLED', e: false},
{controllerName: 'addServiceController', state: 'STARTED', e: false},
{controllerName: 'addServiceController', state: 'START_SKIPPED', e: false},
{controllerName: 'addServiceController', state: 'START FAILED', e: false},
{controllerName: 'addServiceController', state: 'INSTALL FAILED', e: false},
{controllerName: 'addServiceController', state: 'PENDING', e: true},
{controllerName: 'addServiceController', state: 'INSTALLED', e: true},
{controllerName: 'addServiceController', state: 'INSTALLED', e: false},
{controllerName: 'installerController', state: 'STARTED', e: false},
{controllerName: 'installerController', state: 'START_SKIPPED', e: false},
{controllerName: 'installerController', state: 'START FAILED', e: false},
{controllerName: 'installerController', state: 'INSTALL FAILED', e: true},
{controllerName: 'installerController', state: 'INSTALLED', e: true},
{controllerName: 'installerController', state: 'INSTALLED', e: false},
{controllerName: 'installerController', state: 'PENDING', e: true}
]);
tests.forEach(function (test) {
Expand Down
3 changes: 0 additions & 3 deletions ambari-web/test/utils/config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1601,9 +1601,6 @@ describe('App.config', function() {
var args = testHelpers.findAjaxRequest('name', 'configs.stack_configs.load.cluster_configs');
expect(args[0]).exists;
expect(args[0].sender).to.be.eql(App.config);
expect(args[0].data).to.be.eql({
stackVersionUrl: App.get('stackVersionURL')
});
});
});

Expand Down