Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Model management fixes and usability enhancements #118240

Merged
merged 34 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c65b6f1
[ML] update expanded rows on refresh
darnautov Nov 8, 2021
4e1382d
[ML] truncateText for start and state columns
darnautov Nov 8, 2021
c8ae87f
remove deployment stats endpoints, replace with the trained models stats
darnautov Nov 10, 2021
6cb7e95
update layout for pipelines
darnautov Nov 11, 2021
9af72f0
add edit icon
darnautov Nov 11, 2021
fd8377d
rename deployment actions
darnautov Nov 11, 2021
e349da7
add panels for pipelines tab
darnautov Nov 11, 2021
7e46343
change deployment stats layout
darnautov Nov 11, 2021
dd37992
remove redundant fields from node details
darnautov Nov 11, 2021
3e56b06
render roles with badges
darnautov Nov 11, 2021
e8b2199
format nodes attrs
darnautov Nov 11, 2021
df2578e
hide empty stats tab
darnautov Nov 11, 2021
a220682
Merge remote-tracking branch 'upstream/main' into ml-mm-usability
darnautov Nov 15, 2021
b8c14ef
enable trained models tests
darnautov Nov 15, 2021
5529d0b
add canViewMlNodes capability, hide Nodes tab for the viewer
darnautov Nov 15, 2021
86c265f
remove unused translation
darnautov Nov 15, 2021
1b1a3b2
support force stop
darnautov Nov 15, 2021
526ffe7
import default ml capabilities in the security_solutions plugin
darnautov Nov 15, 2021
3c001d9
update translation string id
darnautov Nov 15, 2021
76caf13
Revert "support force stop"
darnautov Nov 15, 2021
9a8a5e0
fix translation string ids
darnautov Nov 16, 2021
27b1563
remove mock id
darnautov Nov 16, 2021
bb5e1d3
rename test subject
darnautov Nov 16, 2021
efd220e
remove getTrainedModelDeploymentStats leftovers
darnautov Nov 16, 2021
bf328c8
update tags for nodes_overview endpoint
darnautov Nov 16, 2021
a4c68d9
update api integration tests
darnautov Nov 16, 2021
2b35886
fix paddings
darnautov Nov 16, 2021
4a5e4bd
add info icons for ingest stats
darnautov Nov 16, 2021
a4ab250
update api integration tests for capabilities with spaces
darnautov Nov 16, 2021
c3ed3e4
expand first 3 pipelines by default
darnautov Nov 16, 2021
d54dc9d
fix typo in the filename
darnautov Nov 16, 2021
b6c3447
add help_icon component
darnautov Nov 16, 2021
6440a41
fix test assertion
darnautov Nov 16, 2021
08aaf05
Merge branch 'main' into ml-mm-usability
kibanamachine Nov 22, 2021
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
1 change: 1 addition & 0 deletions x-pack/plugins/ml/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ export { composeValidators, patternValidator } from './util/validators';
export { isRuntimeMappings, isRuntimeField } from './util/runtime_field_utils';
export { extractErrorMessage } from './util/errors';
export type { RuntimeMappings } from './types/fields';
export { getDefaultCapabilities as getDefaultMlCapabilities } from './types/capabilities';
2 changes: 2 additions & 0 deletions x-pack/plugins/ml/common/types/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export const adminMlCapabilities = {
// Alerts
canCreateMlAlerts: false,
canUseMlAlerts: false,
// Model management
canViewMlNodes: false,
};

export type UserMlCapabilities = typeof userMlCapabilities;
Expand Down
14 changes: 12 additions & 2 deletions x-pack/plugins/ml/common/types/trained_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ export interface TrainedModelDeploymentStatsResponse {
routing_state: { routing_state: string };
average_inference_time_ms: number;
last_access: number;
number_of_pending_requests: number;
start_time: number;
}>;
}

Expand All @@ -161,25 +163,33 @@ export interface AllocatedModel {
state: string;
allocation_count: number;
};
model_id: string;
/**
* Not required for rendering in the Model stats
*/
model_id?: string;
state: string;
model_threads: number;
model_size_bytes: number;
node: {
/**
* Not required for rendering in the Nodes overview
*/
name?: string;
average_inference_time_ms: number;
inference_count: number;
routing_state: {
routing_state: string;
reason?: string;
};
last_access?: number;
number_of_pending_requests: number;
start_time: number;
};
}

export interface NodeDeploymentStatsResponse {
id: string;
name: string;
transport_address: string;
attributes: Record<string, string>;
roles: string[];
allocated_models: AllocatedModel[];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { FC, ReactNode } from 'react';
import { EuiIcon, EuiToolTip } from '@elastic/eui';

export const HelpIcon: FC<{ content: ReactNode | string }> = ({ content }) => {
return (
<EuiToolTip position="top" content={content}>
<EuiIcon
tabIndex={0}
type="questionInCircle"
color={'subdued'}
className="eui-alignTop"
size="s"
/>
</EuiToolTip>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { HelpIcon } from './help_icon';
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
ModelPipelines,
TrainedModelStat,
NodesOverviewResponse,
TrainedModelDeploymentStatsResponse,
} from '../../../../common/types/trained_models';

export interface InferenceQueryParams {
Expand Down Expand Up @@ -122,21 +121,6 @@ export function trainedModelsApiProvider(httpService: HttpService) {
});
},

getTrainedModelDeploymentStats(modelId?: string | string[]) {
let model = modelId ?? '*';
if (Array.isArray(modelId)) {
model = modelId.join(',');
}

return httpService.http<{
count: number;
deployment_stats: TrainedModelDeploymentStatsResponse[];
}>({
path: `${apiBasePath}/trained_models/${model}/deployment/_stats`,
method: 'GET',
});
},

getTrainedModelsNodesOverview() {
return httpService.http<NodesOverviewResponse>({
path: `${apiBasePath}/trained_models/nodes_overview`,
Expand Down
Loading