Fix get all inference endponts not returning multiple endpoints sharing model deployment#121821
Merged
dan-rubinstein merged 5 commits intoelastic:mainfrom Feb 10, 2025
Conversation
…ng model deployment
Collaborator
|
Hi @dan-rubinstein, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/ml-core (Team:ML) |
Contributor
|
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. |
jonathan-buttner
approved these changes
Feb 6, 2025
|
|
||
| if (model instanceof ElasticsearchInternalModel esModel) { | ||
| modelsByDeploymentIds.put(esModel.mlNodeDeploymentId(), esModel); | ||
| if (modelsByDeploymentIds.containsKey(esModel.mlNodeDeploymentId()) == false) { |
Contributor
There was a problem hiding this comment.
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;
});
Member
Author
There was a problem hiding this comment.
Nice, I like this method much better! I'll go ahead and make that change.
jonathan-buttner
approved these changes
Feb 7, 2025
Member
Author
|
@elasticmachine merge upstream |
Collaborator
💔 Backport failedThe backport operation could not be completed due to the following error: You can use sqren/backport to manually backport by running |
dan-rubinstein
added a commit
to dan-rubinstein/elasticsearch
that referenced
this pull request
Feb 10, 2025
…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 <elasticmachine@users.noreply.github.com>
dan-rubinstein
added a commit
to dan-rubinstein/elasticsearch
that referenced
this pull request
Feb 10, 2025
…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 <elasticmachine@users.noreply.github.com>
dan-rubinstein
added a commit
to dan-rubinstein/elasticsearch
that referenced
this pull request
Feb 10, 2025
…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 <elasticmachine@users.noreply.github.com>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 11, 2025
…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 <elasticmachine@users.noreply.github.com> Co-authored-by: Joe Gallo <joe.gallo@elastic.co>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_allocationsbut 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_allocationswill reflect in all endpoints sharing the same model deployment when calling to get all inference endpoints.