Skip to content

Commit 1c16e14

Browse files
radireddyantleblanc
authored andcommitted
feat(pci): implement ui for analytics data platform (#753)
ref: MANAGER-2328
1 parent 3f026b2 commit 1c16e14

File tree

128 files changed

+4593
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+4593
-2
lines changed

packages/manager/apps/public-cloud/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
"ovh-manager-webfont": "^1.2.0",
6161
"ovh-ui-angular": "^3.3.2",
6262
"ovh-ui-kit": "^2.33.3",
63-
"ovh-ui-kit-bs": "^2.1.1"
63+
"ovh-ui-kit-bs": "^2.1.1",
64+
"fast-sha256": "^1.1.0",
65+
"tweetnacl-util": "^0.15.0"
6466
},
6567
"devDependencies": {
6668
"@ovh-ux/manager-webpack-config": "^3.0.8",

packages/manager/modules/pci/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"moment": "^2.19",
3333
"urijs": "^1.19.1",
3434
"validator": "^10.11.0",
35-
"xterm": "^3.12.2"
35+
"xterm": "^3.12.2",
36+
"fast-sha256": "^1.1.0",
37+
"tweetnacl-util": "^0.15.0"
3638
},
3739
"devDependencies": {
3840
"@ovh-ux/component-rollup-config": "5.0.2"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import template from './analytics-data-platform.html';
2+
import controller from './analytics-data-platform.controller';
3+
4+
export default {
5+
template,
6+
controller,
7+
bindings: {
8+
projectId: '<',
9+
manageCluster: '<',
10+
deployCluster: '<',
11+
clusters: '<',
12+
},
13+
};
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
export const ANALYTICS_DATA_PLATFORM_PUBLIC_CLOUD_STATUS = Object.freeze({
2+
CREATING: 'creating',
3+
DELETED: 'deleted',
4+
DELETING: 'deleting',
5+
OK: 'ok',
6+
SUSPENDED: 'suspended',
7+
});
8+
9+
export const ANALYTICS_DATA_PLATFORM_NODE_TYPES = Object.freeze({
10+
MASTER: 'MASTER',
11+
WORKER: 'SLAVE',
12+
EDGE: 'EDGE',
13+
UTILITY: 'UTILITY',
14+
BASTION: 'BASTION',
15+
});
16+
17+
export const ANALYTICS_DATA_PLATFORM_COMPUTE = Object.freeze({
18+
RAM: 'RAM',
19+
CORS: 'vCores',
20+
});
21+
22+
export const ANALYTICS_DATA_PLATFORM_GUIDE_LINKS = Object.freeze({
23+
general_link: 'https://docs.ovh.com/gb/en/analytics/',
24+
});
25+
26+
export const ANALYTICS_DATA_PLATFORM_CLUSTER_MANAGE = Object.freeze({
27+
AMBARI: 'https://knox.serviceName.datalake.ovh/gateway/default/ambari',
28+
FREEIPA: 'https://ipa.serviceName.datalake.ovh',
29+
RANGER: 'https://knox.serviceName.datalake.ovh/gateway/default/ranger/login.jsp',
30+
});
31+
32+
export const ANALYTICS_DATA_PLATFORM_NODE_NAMES = ['worker', 'edge', 'master', 'utility', 'bastion'];
33+
34+
export const ANALYTICS_DATA_PLATFORM_CLOUD_CATALOG_NAME = 'cloud';
35+
36+
export const ANALYTICS_DATA_PLATFORM_FLAVOR_TYPES = Object.freeze([
37+
{
38+
id: 'balanced',
39+
types: ['ovh.ceph.eg', 'ovh.ssd.eg'],
40+
},
41+
{
42+
id: 'cpu',
43+
types: ['ovh.cpu', 'ovh.ssd.cpu', 'ovh.ceph.hg'],
44+
},
45+
{
46+
id: 'ram',
47+
types: ['ovh.ram', 'ovh.ssd.ram'],
48+
},
49+
{
50+
id: 'accelerated',
51+
types: ['ovh.ssd.gpu', 'ovh.ssd.gpu2', 'ovh.ssd.gpu3', 'ovh.ssd.fpga2', 'ovh.raid-nvme.t1'],
52+
},
53+
{
54+
id: 'vps',
55+
types: ['ovh.vps-ssd'],
56+
},
57+
]);
58+
59+
export const ANALYTICS_DATA_PLATFORM_CREDENTIALS_INFO = Object.freeze({
60+
credentials: [{
61+
key: 'admin_password',
62+
login: 'admin',
63+
service: 'Ambari',
64+
password: 'Not generated',
65+
},
66+
{
67+
key: 'admin_password',
68+
login: 'admin',
69+
service: 'FreeIPA',
70+
password: 'Not generated',
71+
},
72+
{
73+
key: 'kerberos',
74+
login: 'admin',
75+
service: 'Kerberos KDC',
76+
password: 'Not generated',
77+
},
78+
{
79+
key: 'kms_passwd',
80+
login: 'admin',
81+
service: 'Ranger KMS',
82+
password: 'Not generated',
83+
},
84+
{
85+
key: 'admin_password_guacamole',
86+
login: 'guacadmin',
87+
service: 'Guacamole',
88+
password: 'Not generated',
89+
},
90+
{
91+
key: 'mysql_root_password',
92+
login: 'root',
93+
service: 'MariaDB SQL server',
94+
password: 'Not generated',
95+
},
96+
{
97+
key: 'hive',
98+
login: 'hive',
99+
service: 'Hive BDD',
100+
password: 'Not generated',
101+
},
102+
{
103+
key: 'oozie',
104+
login: 'oozie',
105+
service: 'Oozie BDD',
106+
password: 'Not generated',
107+
},
108+
{
109+
key: 'ambari',
110+
login: 'ambari',
111+
service: 'Ambari BDD',
112+
password: 'Not generated',
113+
},
114+
{
115+
key: 'guacamole',
116+
login: 'guacamole',
117+
service: 'Guacamole BDD',
118+
password: 'Not generated',
119+
}],
120+
rounds: 100000,
121+
dkLen: 32,
122+
passwordLength: 18,
123+
minMasterPasswordLength: 12,
124+
maxMasterPasswordLength: 64,
125+
});
126+
127+
export const ANALYTICS_DATA_PLATFORM_NODE_FILTERS = [
128+
'Node type',
129+
'Region',
130+
];
131+
132+
export const ANALYTICS_DATA_PLATFORM_STATUS_MAP = Object.freeze({
133+
PENDING: 'info',
134+
IN_PROGRESS: 'warning',
135+
SUCCEEDED: 'success',
136+
FAILED: 'error',
137+
DONE: 'success',
138+
ERROR: 'error',
139+
UNKNOWN: 'warning',
140+
OK: 'success',
141+
TO_DEPLOY: 'info',
142+
DEPLOYING: 'warning',
143+
DEPLOYED: 'success',
144+
TO_DESTROY: 'info',
145+
DESTROYED: 'error',
146+
INITIALIZED: 'info',
147+
});
148+
149+
export const ANALYTICS_DATA_PLATFORM_STATUS = Object.freeze({
150+
PENDING: 'PENDING',
151+
IN_PROGRESS: 'IN_PROGRESS',
152+
SUCCEEDED: 'SUCCEEDED',
153+
FAILED: 'FAILED',
154+
DONE: 'DONE',
155+
ERROR: 'ERROR',
156+
UNKNOWN: 'UNKNOWN',
157+
OK: 'OK',
158+
TO_DEPLOY: 'TO_DEPLOY',
159+
DEPLOYING: 'DEPLOYING',
160+
DEPLOYED: 'DEPLOYED',
161+
TO_DESTROY: 'TO_DESTROY',
162+
DESTROYED: 'DESTROYED',
163+
INITIALIZED: 'INITIALIZED',
164+
});
165+
166+
export const ANALYTICS_DATA_PLATFORM_SERVICES = Object.freeze({
167+
AMBARI: 'AMBARI',
168+
FREEIPA: 'FREEIPA',
169+
RANGER: 'RANGER',
170+
});
171+
172+
export const ANALYTICS_DATA_PLATFORM_CLUSTER_NAME_PATTERN = /^[a-z][a-z0-9-]{1,18}[a-z0-9]$/;
173+
export const ANALYTICS_DATA_PLATFORM_INPUT_NUMBER_PATTERN = /^\d+$/;
174+
175+
export default {
176+
ANALYTICS_DATA_PLATFORM_PUBLIC_CLOUD_STATUS,
177+
ANALYTICS_DATA_PLATFORM_CLOUD_CATALOG_NAME,
178+
ANALYTICS_DATA_PLATFORM_CLUSTER_MANAGE,
179+
ANALYTICS_DATA_PLATFORM_CREDENTIALS_INFO,
180+
ANALYTICS_DATA_PLATFORM_FLAVOR_TYPES,
181+
ANALYTICS_DATA_PLATFORM_STATUS_MAP,
182+
ANALYTICS_DATA_PLATFORM_GUIDE_LINKS,
183+
ANALYTICS_DATA_PLATFORM_NODE_NAMES,
184+
ANALYTICS_DATA_PLATFORM_NODE_TYPES,
185+
ANALYTICS_DATA_PLATFORM_SERVICES,
186+
ANALYTICS_DATA_PLATFORM_STATUS,
187+
ANALYTICS_DATA_PLATFORM_COMPUTE,
188+
ANALYTICS_DATA_PLATFORM_NODE_FILTERS,
189+
ANALYTICS_DATA_PLATFORM_CLUSTER_NAME_PATTERN,
190+
ANALYTICS_DATA_PLATFORM_INPUT_NUMBER_PATTERN,
191+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import {
2+
ANALYTICS_DATA_PLATFORM_STATUS_MAP,
3+
ANALYTICS_DATA_PLATFORM_STATUS,
4+
} from './analytics-data-platform.constants';
5+
6+
export default class {
7+
constructor($state, CucCloudMessage, analyticsDataPlatformService, CucRegionService) {
8+
this.$state = $state;
9+
this.cucCloudMessage = CucCloudMessage;
10+
this.analyticsDataPlatformService = analyticsDataPlatformService;
11+
this.cucRegionService = CucRegionService;
12+
}
13+
14+
$onInit() {
15+
this.STATUS_CLASS = ANALYTICS_DATA_PLATFORM_STATUS_MAP;
16+
this.ADP_STATUS = ANALYTICS_DATA_PLATFORM_STATUS;
17+
this.subscribeToMessages();
18+
}
19+
20+
refreshMessage() {
21+
this.messages = this.messageHandler.getMessages();
22+
}
23+
24+
subscribeToMessages() {
25+
this.cucCloudMessage.unSubscribe('pci.projects.project.analytics-data-platform');
26+
this.messageHandler = this.cucCloudMessage.subscribe(
27+
'pci.projects.project.analytics-data-platform',
28+
{ onMessage: () => this.refreshMessage() },
29+
);
30+
}
31+
32+
refresh() {
33+
this.analyticsDataPlatformService.clearPlatformAllCache();
34+
this.$state.reload();
35+
}
36+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<div data-ui-view>
2+
<oui-page-header
3+
class="mb-2"
4+
data-heading="{{ ::'analytics_data_platform_title' | translate }}">
5+
</oui-page-header>
6+
<div>
7+
<!-- error messages -->
8+
<cui-message-container data-messages="$ctrl.messages"></cui-message-container>
9+
<oui-datagrid class="mt-3" data-rows="$ctrl.clusters">
10+
<oui-column data-title="::'analytics_data_platform_common_cluster_name' | translate"
11+
data-property="clusterName"
12+
data-sortable="asc"
13+
data-type="string"
14+
data-searchable data-filterable>
15+
<oui-button
16+
data-variant="link"
17+
data-on-click="$ctrl.manageCluster($row.serviceName)">
18+
<span data-ng-bind="::$row.clusterName"></span>
19+
</oui-button>
20+
</oui-column>
21+
<oui-column data-title="::'analytics_data_platform_common_status' | translate"
22+
data-property="status"
23+
data-type="string"
24+
data-sortable data-searchable data-filterable>
25+
<span class="oui-status"
26+
data-ng-class="'oui-status_' + $ctrl.STATUS_CLASS[$row.status]"
27+
data-ng-bind=":: ('analytics_data_platform_common_status_' + $row.status) | translate">
28+
</span>
29+
</oui-column>
30+
<oui-column data-title="::'analytics_data_platform_common_region' | translate"
31+
data-property="osRegion" data-sortable>
32+
<span data-ng-bind="::$ctrl.cucRegionService.getTranslatedMicroRegion($row.osRegion)"></span>
33+
</oui-column>
34+
<oui-column data-title="::'analytics_data_platform_common_version' | translate"
35+
data-property="clusterType"
36+
data-sortable></oui-column>
37+
<oui-action-menu data-align="end" data-compact>
38+
<oui-action-menu-item
39+
data-disabled="$row.status === $ctrl.ADP_STATUS.IN_PROGRESS"
40+
data-on-click="$ctrl.manageCluster($row.serviceName)">
41+
<span data-translate="analytics_data_platform_list_table_button_manage_cluster"></span>
42+
</oui-action-menu-item>
43+
</oui-action-menu>
44+
<extra-top>
45+
<div class="row">
46+
<div class="col-auto mr-auto">
47+
<oui-button data-on-click="$ctrl.deployCluster()">
48+
<span data-translate="analytics_data_platform_list_create_button_label"></span>
49+
</oui-button>
50+
</div>
51+
<div class="col-auto">
52+
<button class="oui-button oui-button_secondary oui-button_icon-only oui-button_small-width"
53+
aria-label="{{:: 'analytics_data_platform_list_table_refresh' | translate }}"
54+
data-ng-click="$ctrl.refresh()">
55+
<span class="fa fa-refresh" aria-hidden="true"></span>
56+
</button>
57+
</div>
58+
</div>
59+
</extra-top>
60+
</oui-datagrid>
61+
</div>
62+
</div>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import angular from 'angular';
2+
import 'font-awesome/css/font-awesome.css';
3+
import '@ovh-ux/ng-ovh-swimming-poll';
4+
5+
import analyticsDataPlatformComponent from './analytics-data-platform.component';
6+
import analyticsDataPlatformService from './analytics-data-platform.service';
7+
import routing from './analytics-data-platform.routing';
8+
import deploy from './deploy';
9+
import details from './details';
10+
import onboarding from './onboarding';
11+
12+
const moduleName = 'ovhManagerAnalyticsDataPlatformComponent';
13+
14+
angular
15+
.module(moduleName, [
16+
deploy,
17+
details,
18+
'ngOvhSwimmingPoll',
19+
onboarding,
20+
])
21+
.config(routing)
22+
.component('analyticsDataPlatformComponent', analyticsDataPlatformComponent)
23+
.service('analyticsDataPlatformService', analyticsDataPlatformService)
24+
.run(/* @ngTranslationsInject:json ./translations */);
25+
26+
export default moduleName;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export default /* @ngInject */($stateProvider) => {
2+
$stateProvider.state('pci.projects.project.analytics-data-platform', {
3+
cache: false,
4+
url: '/analytics-data-platform',
5+
component: 'analyticsDataPlatformComponent',
6+
redirectTo: transition => transition
7+
.injector()
8+
.getAsync('clusters')
9+
.then(clusters => (clusters.length === 0 ? { state: 'pci.projects.project.analytics-data-platform.onboarding' } : false)),
10+
11+
resolve: {
12+
clusters: /* @ngInject */ (
13+
analyticsDataPlatformService,
14+
projectId,
15+
) => {
16+
analyticsDataPlatformService.clearPlatformAllCache();
17+
return analyticsDataPlatformService.getAnalyticsDataPlatforms(projectId);
18+
},
19+
20+
breadcrumb: /* @ngInject */ $translate => $translate.instant('analytics_data_platform_title'),
21+
22+
deployCluster: /* @ngInject */ ($state, projectId) => () => $state.go('pci.projects.project.analytics-data-platform.deploy', { projectId }),
23+
manageCluster: /* @ngInject */ ($state, projectId) => serviceName => $state.go('pci.projects.project.analytics-data-platform.details', { projectId, serviceName }),
24+
servicePage: /* @ngInject */ ($state, projectId) => serviceName => $state.go('pci.projects.project.analytics-data-platform.details.service', { projectId, serviceName }, { reload: true }),
25+
},
26+
});
27+
};

0 commit comments

Comments
 (0)