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

[Enterprise Search] Replace model selection dropdown with list #171436

Merged
merged 15 commits into from
Dec 1, 2023

Conversation

demjened
Copy link
Contributor

@demjened demjened commented Nov 16, 2023

Summary

This PR replaces the model selection dropdown in the ML inference pipeline configuration flyout with a cleaner selection list. The model cards also contain fast deploy action buttons for promoted models (ELSER, E5). The list is periodically updated.

Old:
Screenshot 2023-11-16 at 12 31 50

New:
Screenshot 2023-11-30 at 15 13 46

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)
  • Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)
  • This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)

@demjened demjened added release_note:skip Skip the PR/issue when compiling release notes v8.12.0 labels Nov 16, 2023
Comment on lines -83 to -77
{
disabled: true,
inputDisplay:
existingPipeline && pipelineName.length > 0
? MODEL_REDACTED_VALUE
: MODEL_SELECT_PLACEHOLDER,
value: MODEL_SELECT_PLACEHOLDER_VALUE,
},
Copy link
Contributor Author

@demjened demjened Nov 16, 2023

Choose a reason for hiding this comment

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

This logic can be safely removed:

  • The "Select model" placeholder is no longer relevant in the selection list component
  • The new/existing pipeline choice has been split into separate tabs. Therefore if an existing pipeline is selected with a redacted model, the model selection component won't be rendered in that tab, and there's no need for supporting the disabled placeholder.

@demjened demjened marked this pull request as ready for review November 16, 2023 19:21
@demjened demjened requested a review from a team November 16, 2023 19:21
@demjened demjened requested a review from a team November 20, 2023 21:34
@demjened
Copy link
Contributor Author

@elasticmachine merge upstream

3 similar comments
@demjened
Copy link
Contributor Author

@elasticmachine merge upstream

@demjened
Copy link
Contributor Author

@elasticmachine merge upstream

@demjened
Copy link
Contributor Author

@elasticmachine merge upstream

@demjened demjened force-pushed the demjened/model-selection-list branch from a7bdae7 to 1f07826 Compare November 30, 2023 20:10
@demjened demjened requested a review from a team as a code owner November 30, 2023 20:10
@@ -43,7 +43,7 @@ export const startMlModelDeployment = async (
// we're downloaded already, but not deployed yet - let's deploy it
const startRequest: MlStartTrainedModelDeploymentRequest = {
model_id: modelName,
wait_for: 'started',
wait_for: 'starting',
Copy link
Contributor Author

@demjened demjened Nov 30, 2023

Choose a reason for hiding this comment

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

This change has a minor side effect - the ELSER callout's "Start single-threaded" button will turn the status into "started" while the model is starting. This is fine for two reasons:

  • Starting the ELSER model takes about a second, so it is very unlikely the user will run a pipeline with the model in the starting phase;
  • Currently the status label displays "started" both for the "starting" and "started" phase in the ELSER callout.

Comment on lines +115 to +116
case TrainedModelState.NotDeployed:
case MlModelDeploymentState.NotDeployed:
Copy link
Contributor Author

@demjened demjened Nov 30, 2023

Choose a reason for hiding this comment

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

Accommodating for the broader spectrum of status values of MlModelDeploymentState while maintaining backward compatibility with other components that still use TrainedModelState.

</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{/* Status indicator OR action button */}
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than a comment it would make more sense to move this to a component with a descriptive name.

But that maybe a personal preference thing, comments in JSX seem like a code smell to me, but I could be wrong there, @sphilipse ?

/>
)}
</EuiFlexItem>
{/* Actions menu */}
Copy link
Contributor

Choose a reason for hiding this comment

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

same here if you want the comment, make a custom component.

@pgayvallet pgayvallet removed the request for review from a team December 1, 2023 09:26
@demjened
Copy link
Contributor Author

demjened commented Dec 1, 2023

@elasticmachine merge upstream

Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

Partial review, can finish later this afternoon

Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

LGTM! We can address my comments after FF :)

(models ?? []).map((model) => ({
...model,
label: model.modelId,
checked: model.modelId === modelID ? 'on' : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm seeing a lot of warnings in my developer console when the list is rendered (see the attached log). I believe it's due to the prop names introduced here by MlModel.

I was wondering why PipelineSelectOptionProps was structured like it is, I think this is why...

localhost-1701462507607.log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I've seen those too - no idea why React is complaining. I surely don't want to lowercase all props just to fix that 😅
Maybe @TattdCodeMonkey knows why this is happening?
Example warning:

react-dom.development.js:67 Warning: React does not recognize the `deploymentState` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `deploymentstate` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

description: i18n.translate('xpack.enterpriseSearch.modelCard.elserPlaceholder.description', {
defaultMessage:
'ELSER is designed to efficiently use context in natural language queries with better results than BM25 alone.',
"ELSER is Elastic's NLP model for English semantic search, utilizing sparse vectors. It prioritizes intent and contextual meaning over literal term matching, optimized specifically for English documents and queries on the Elastic platform.",
Copy link
Contributor

Choose a reason for hiding this comment

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

(Hopefully) dumb question: Do we need to make any changes to the files in translations/ to propagate this change?

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 2234 2240 +6

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.6MB 2.7MB +6.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@demjened demjened merged commit 2c4d0a3 into main Dec 1, 2023
30 checks passed
@demjened demjened deleted the demjened/model-selection-list branch December 1, 2023 21:50
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 1, 2023
@demjened demjened added release_note:feature Makes this part of the condensed release notes and removed release_note:skip Skip the PR/issue when compiling release notes labels Dec 4, 2023
demjened added a commit that referenced this pull request Dec 4, 2023
## Summary

We are removing the E5 model deployment callout from the Pipelines tab
in favor of the model selector list with action buttons (#171436). The
orphan code cleanup will happen in a separate PR.

<img width="636" alt="Screenshot 2023-12-04 at 14 18 43"
src="https://github.com/elastic/kibana/assets/14224983/1b0fbce1-34aa-44d4-a9b9-f783761ea2bd">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:EnterpriseSearch v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants