forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search] Consolidate ML model fetch calls (elastic#176257)
## Summary With the introduction of [fetch_ml_models.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts), the fetching and enriching of ML models for Search purposes has been consolidated in that API. This allows us to remove the dependency on the older method that works with ML plugin-specific `TrainedModel` entities. This PR makes the following changes: - Switch over code that depend on ML models to use the new function from `fetch_ml_models.ts` (that already does sorting/filtering). - Move the fetch process to `ml_inference_logic.ts`, and begin periodically polling after mounting the logic. This enables passing down values to lower components, e.g. `model_select_logic.ts`, instead of repeating the fetch there. - Use `MlModel` instead of `TrainedModel/MlTrainedModelConfig`. This requires adding some missing properties to `MlModel`: `types`, `inputFieldNames`, `version`. - Remove the old fetch methods (`x-pack/plugins/enterprise_search/server/lib/ml/ml_*_logic.ts`). - Remove the "no models available" component and condition, since as of 8.12 at least the ELSER/E5 placeholders are always present. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
Showing
29 changed files
with
345 additions
and
1,023 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
.../public/applications/enterprise_search_content/api/ml_models/ml_model_stats_logic.test.ts
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
...earch/public/applications/enterprise_search_content/api/ml_models/ml_model_stats_logic.ts
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
...earch/public/applications/enterprise_search_content/api/ml_models/ml_models_logic.test.ts
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...ise_search/public/applications/enterprise_search_content/api/ml_models/ml_models_logic.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.