-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 force
stop deployment
#118563
Changes from 2 commits
4d2e6b3
0b7eced
c1e4798
67705ed
9ed4433
e15b10d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* 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 } from 'react'; | ||
import { EuiConfirmModal } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import type { OverlayStart } from 'kibana/public'; | ||
import type { ModelItem } from './models_list'; | ||
import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/public'; | ||
|
||
interface ForceStopModelConfirmDialogProps { | ||
model: ModelItem; | ||
onCancel: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
export const ForceStopModelConfirmDialog: FC<ForceStopModelConfirmDialogProps> = ({ | ||
model, | ||
onConfirm, | ||
onCancel, | ||
}) => { | ||
return ( | ||
<EuiConfirmModal | ||
title={ | ||
<FormattedMessage | ||
id="xpack.ml.trainedModels.modelsList.forceStopDialog.title" | ||
defaultMessage="Force stop model {modelId}?" | ||
values={{ modelId: model.model_id }} | ||
/> | ||
} | ||
onCancel={onCancel} | ||
onConfirm={onConfirm} | ||
cancelButtonText={ | ||
<FormattedMessage | ||
id="xpack.ml.trainedModels.modelsList.forceStopDialog.cancelText" | ||
defaultMessage="Cancel" | ||
/> | ||
} | ||
confirmButtonText={ | ||
<FormattedMessage | ||
id="xpack.ml.trainedModels.modelsList.forceStopDialog.confirmText" | ||
defaultMessage="Stop" | ||
/> | ||
} | ||
buttonColor="danger" | ||
> | ||
<FormattedMessage | ||
id="xpack.ml.trainedModels.modelsList.forceStopDialog.pipelinesWarning" | ||
defaultMessage="Selected model has associated pipelines: " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe reword to something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO the impact is unclear. Will the ingest pipelines fail until you start a new deployment or will the inference processor just be skipped? Perhaps something like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed in 9ed4433 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any index request hitting a pipeline that refers to a model that doesn't have a started deployment will fail. The bulk response will contain an item for each one of them explaining the model wasn't deployed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! I've added similar information in the docs and API spec via elastic/elasticsearch#81026 and elastic/elasticsearch-specification#1061 |
||
/> | ||
<ul> | ||
{Object.keys(model.pipelines!) | ||
.sort() | ||
.map((pipelineName) => { | ||
return <li key={pipelineName}>{pipelineName}</li>; | ||
})} | ||
</ul> | ||
</EuiConfirmModal> | ||
); | ||
}; | ||
|
||
export const getUserConfirmationProvider = | ||
(overlays: OverlayStart) => async (forceStopModel: ModelItem) => { | ||
return new Promise(async (resolve, reject) => { | ||
try { | ||
const modalSession = overlays.openModal( | ||
toMountPoint( | ||
<ForceStopModelConfirmDialog | ||
model={forceStopModel} | ||
onCancel={() => { | ||
modalSession.close(); | ||
resolve(false); | ||
}} | ||
onConfirm={() => { | ||
modalSession.close(); | ||
resolve(true); | ||
}} | ||
/> | ||
) | ||
); | ||
} catch (e) { | ||
resolve(false); | ||
} | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest removing the term
Force
from this dialog, as it seems like an API level detail that doesn't need to be shown in the UI.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peteharverson FYI the DFA page contains the "Force stop" action
kibana/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/stop_action_modal.tsx
Line 34 in 8126488
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in 9ed4433