From 7565192a928d3d28a1e5f380bec7cab56a444ef3 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Thu, 24 Oct 2024 16:33:36 +0100 Subject: [PATCH] [ML] File upload: enabling check for model allocations (#197395) Enables the previously commented out check for `num_allocations` when listing the inference endpoints. The adaptive allocation count can drop to 0, but it is still valid for use. Uploading a file will cause it to be re-deployed. Related to es PRs https://github.com/elastic/elasticsearch/pull/115233 and https://github.com/elastic/elasticsearch/pull/115095 Follow on from https://github.com/elastic/kibana/pull/196577 (cherry picked from commit 66b2447fe7879dec1ede5c5cd3aea9b34ae1fad9) --- x-pack/plugins/data_visualizer/server/routes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/data_visualizer/server/routes.ts b/x-pack/plugins/data_visualizer/server/routes.ts index e04ba7521bfa4..2b2a347034b87 100644 --- a/x-pack/plugins/data_visualizer/server/routes.ts +++ b/x-pack/plugins/data_visualizer/server/routes.ts @@ -96,9 +96,9 @@ export function routes(coreSetup: CoreSetup, logger: Logger) const filteredInferenceEndpoints = endpoints.filter((endpoint) => { return ( - endpoint.task_type === 'sparse_embedding' || endpoint.task_type === 'text_embedding' - // TODO: add this back in when the fix has made it into es in 8.16 - // && endpoint.service_settings.num_allocations > 0 + (endpoint.task_type === 'sparse_embedding' || + endpoint.task_type === 'text_embedding') && + endpoint.service_settings.num_allocations >= 0 ); });