-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix get all inference endponts not returning multiple endpoints sharing model deployment #121821
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
Fix get all inference endponts not returning multiple endpoints sharing model deployment #121821
Conversation
…ng model deployment
Hi @dan-rubinstein, I've created a changelog YAML for you. |
Pinging @elastic/ml-core (Team:ML) |
Hey Dan 👋 do you want this change to go to 8.18.0? I see it's labeled for 9.0.0. 8.18 and 9.0 are being released together so if we're targeting one we should probably do both. |
for (var model : models) { | ||
assert model instanceof ElasticsearchInternalModel; | ||
|
||
if (model instanceof ElasticsearchInternalModel esModel) { | ||
modelsByDeploymentIds.put(esModel.mlNodeDeploymentId(), esModel); | ||
if (modelsByDeploymentIds.containsKey(esModel.mlNodeDeploymentId()) == 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.
nit: I think the if-else can be distilled to something like this:
modelsByDeploymentIds.merge(
esModel.mlNodeDeploymentId(),
new ArrayList<String>(List.of(esModel)), (a, b) -> {
a.addAll(b);
return a;
});
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.
Nice, I like this method much better! I'll go ahead and make that change.
@elasticmachine merge upstream |
💔 Backport failedThe backport operation could not be completed due to the following error:
You can use sqren/backport to manually backport by running |
…ng model deployment (elastic#121821) * Fix get all inference endponts not returning multiple endpoints sharing model deployment * Update docs/changelog/121821.yaml * Clean up modelsByDeploymentId generation code --------- Co-authored-by: Elastic Machine <[email protected]>
…ng model deployment (elastic#121821) * Fix get all inference endponts not returning multiple endpoints sharing model deployment * Update docs/changelog/121821.yaml * Clean up modelsByDeploymentId generation code --------- Co-authored-by: Elastic Machine <[email protected]>
…ng model deployment (elastic#121821) * Fix get all inference endponts not returning multiple endpoints sharing model deployment * Update docs/changelog/121821.yaml * Clean up modelsByDeploymentId generation code --------- Co-authored-by: Elastic Machine <[email protected]>
…ng model deployment (#121821) (#122206) * Fix get all inference endponts not returning multiple endpoints sharing model deployment * Update docs/changelog/121821.yaml * Clean up modelsByDeploymentId generation code --------- Co-authored-by: Elastic Machine <[email protected]>
…ng model deployment (#121821) (#122210) * Fix get all inference endponts not returning multiple endpoints sharing model deployment * Update docs/changelog/121821.yaml * Clean up modelsByDeploymentId generation code --------- Co-authored-by: Elastic Machine <[email protected]>
…ng model deployment (#121821) (#122208) * Fix get all inference endponts not returning multiple endpoints sharing model deployment * Update docs/changelog/121821.yaml * Clean up modelsByDeploymentId generation code --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Joe Gallo <[email protected]>
Description
Issue - https://github.com/elastic/ml-team/issues/1470?reload=1?reload=1
We currently have a bug when calling the get all inference endpoints API that only returns a single endpoint for each model deployment. This is happening because after we retrieve all the endpoints from the inference index, we call the deployment stats API to accurately return the current
num_allocations
but in doing so, we accidentally filter out all but the last retrieve inference endpoint for each model deployment. This change updates the logic to properly handle multiple endpoints for a single model deployment.Testing
num_allocations
will reflect in all endpoints sharing the same model deployment when calling to get all inference endpoints.