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] Support multiple model deployments #155375

Merged
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
88f16b4
add deployment id to the start deployment modal
darnautov Apr 20, 2023
e52358c
add deployment_ids
darnautov Apr 20, 2023
9893f1d
stop multiple deployments
darnautov Apr 20, 2023
2a3343e
render deployment stats
darnautov Apr 24, 2023
f94246a
stop action enabled condition, update deployment ids param
darnautov Apr 24, 2023
ed57c04
remove model id check for stop deployment
darnautov Apr 24, 2023
c5ab587
deployment id validation
darnautov Apr 24, 2023
50b23c2
default deployment id check
darnautov Apr 24, 2023
797f66f
test model action
darnautov Apr 24, 2023
e10db18
update deployment
darnautov Apr 24, 2023
ec7d12d
fix TS
darnautov Apr 24, 2023
c076dfe
update test tests
darnautov Apr 25, 2023
f3b46b3
state column
darnautov Apr 25, 2023
9a38d07
fix i18n
darnautov Apr 25, 2023
580b3f0
Update x-pack/plugins/ml/public/application/model_management/deployme…
darnautov Apr 25, 2023
d87fa7a
Update x-pack/plugins/ml/public/application/model_management/deployme…
darnautov Apr 25, 2023
27fb400
pipelines for deployments
darnautov Apr 25, 2023
289212c
Merge remote-tracking branch 'origin/ml-154886-support-multiple-deplo…
darnautov Apr 25, 2023
26c18f3
show placeholder
darnautov Apr 25, 2023
99a84e8
validate deployment id against all existing
darnautov Apr 25, 2023
47c791c
warning for stopping selected deployments with pipelines
darnautov Apr 25, 2023
43df748
update message
darnautov Apr 25, 2023
e292b7d
fix force stopping single deployment
darnautov Apr 25, 2023
014c226
fix pipelines counter
darnautov Apr 25, 2023
4212247
minor refactoring with hooks
darnautov Apr 25, 2023
c8ccef8
fallback to model id for test model pipeline generation
darnautov Apr 25, 2023
9326a23
pass deployment id to constructor
darnautov Apr 25, 2023
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
5 changes: 4 additions & 1 deletion x-pack/plugins/ml/common/types/trained_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface TrainedModelStat {
}
>;
};
deployment_stats?: Omit<TrainedModelDeploymentStatsResponse, 'model_id'>;
deployment_stats?: TrainedModelDeploymentStatsResponse;
model_size_stats?: TrainedModelModelSizeStats;
}

Expand Down Expand Up @@ -128,6 +128,7 @@ export interface InferenceConfigResponse {

export interface TrainedModelDeploymentStatsResponse {
model_id: string;
deployment_id: string;
inference_threads: number;
model_threads: number;
state: DeploymentState;
Expand Down Expand Up @@ -163,6 +164,8 @@ export interface TrainedModelDeploymentStatsResponse {
}

export interface AllocatedModel {
key: string;
deployment_id: string;
inference_threads: number;
allocation_status: {
target_allocation_count: number;
Expand Down
10 changes: 10 additions & 0 deletions x-pack/plugins/ml/common/util/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,13 @@ export function timeIntervalInputValidator() {
return null;
};
}

export function dictionaryValidator(dict: string[], shouldInclude: boolean = false) {
const dictSet = new Set(dict);
return (value: string) => {
if (dictSet.has(value) !== shouldInclude) {
return { matchDict: value };
}
return null;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,33 @@ export const AllocatedModels: FC<AllocatedModelsProps> = ({
const euiTheme = useEuiTheme();

const columns: Array<EuiBasicTableColumn<AllocatedModel>> = [
{
id: 'deployment_id',
field: 'deployment_id',
name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.deploymentIdHeader', {
defaultMessage: 'ID',
}),
width: '150px',
sortable: true,
truncateText: false,
'data-test-subj': 'mlAllocatedModelsTableDeploymentId',
},
{
name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.modelRoutingStateHeader', {
defaultMessage: 'Routing state',
}),
width: '100px',
'data-test-subj': 'mlAllocatedModelsTableRoutingState',
render: (v: AllocatedModel) => {
const { routing_state: routingState, reason } = v.node.routing_state;

return (
<EuiToolTip content={reason ? reason : ''}>
<EuiBadge color={reason ? 'danger' : 'hollow'}>{routingState}</EuiBadge>
</EuiToolTip>
);
},
},
{
id: 'node_name',
field: 'node.name',
Expand Down Expand Up @@ -193,22 +220,6 @@ export const AllocatedModels: FC<AllocatedModelsProps> = ({
return v.node.number_of_pending_requests;
},
},
{
name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.modelRoutingStateHeader', {
defaultMessage: 'Routing state',
}),
width: '100px',
'data-test-subj': 'mlAllocatedModelsTableRoutingState',
render: (v: AllocatedModel) => {
const { routing_state: routingState, reason } = v.node.routing_state;

return (
<EuiToolTip content={reason ? reason : ''}>
<EuiBadge color={reason ? 'danger' : 'hollow'}>{routingState}</EuiBadge>
</EuiToolTip>
);
},
},
].filter((v) => !hideColumns.includes(v.id!));

return (
Expand All @@ -219,7 +230,7 @@ export const AllocatedModels: FC<AllocatedModelsProps> = ({
isExpandable={false}
isSelectable={false}
items={models}
itemId={'model_id'}
itemId={'key'}
rowProps={(item) => ({
'data-test-subj': `mlAllocatedModelTableRow row-${item.model_id}`,
})}
Expand Down
Loading