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

[ML] Get stats by deployment or model id #95440

Merged
merged 4 commits into from
Apr 21, 2023

Conversation

davidkyle
Copy link
Member

@davidkyle davidkyle commented Apr 21, 2023

With #95168 models may be deployed multiple times with a deployment Id. The _stats API should also respect retrieving stats.

There is one small change the the deployment_stats object which has a new deployment_id field, otherwise the change is in the number of stats objects returned in the response.

  1. If the request is by a single deployment Id (assuming it is deployed), the result is 1 object containing the model stats and deployment stats.
  2. If the request is by a single model Id which is either undeployed or has 1 deployment then a single result object is returned.
  3. If the request is by a single model Id and that model has multiple deployments a result object is returned for each deployment.

Case 3. is the new feature, for 1. and 2. there is effectively no change to existing usages of the API.

Wildcards are expanded to match both deployment and model Ids then handled according to the rules above.

@davidkyle davidkyle changed the title Get stats by deployment or model id [ML} Get stats by deployment or model id Apr 21, 2023
@davidkyle davidkyle marked this pull request as ready for review April 21, 2023 11:29
@davidkyle davidkyle added the :ml Machine learning label Apr 21, 2023
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Apr 21, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine
Copy link
Collaborator

Hi @davidkyle, I've created a changelog YAML for you.

@droberts195 droberts195 changed the title [ML} Get stats by deployment or model id [ML] Get stats by deployment or model id Apr 21, 2023
Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

LGTM if you could just make the release note clearer.

The docs can be done in a followup.

docs/changelog/95440.yaml Outdated Show resolved Hide resolved
Co-authored-by: David Roberts <dave.roberts@elastic.co>
@davidkyle davidkyle merged commit ed955d5 into elastic:main Apr 21, 2023
@davidkyle davidkyle deleted the deployment-stats-withid branch April 21, 2023 13:45
darnautov added a commit to elastic/kibana that referenced this pull request Apr 25, 2023
## Summary

With elastic/elasticsearch#95168 it's possible
to provide an optional deployment ID for start, stop and infer.
elastic/elasticsearch#95440 also updated the
`_stats` API to provide state per deployment.

This PR update the Trained Models UI to support multiple model
deployments.

- Adds support for specifying deployment ID during the start model
deployment
<img width="1009" alt="image"
src="https://user-images.githubusercontent.com/5236598/234074150-bccf079f-7c46-4222-ab83-48369c4ce4c2.png">

-  Stopping specific deployments 
<img width="730" alt="image"
src="https://user-images.githubusercontent.com/5236598/234291886-9ee14a82-a324-4ce7-9db5-57ab912d0385.png">

- Specify the deployment ID for the Test model action 
<img width="600" alt="image"
src="https://user-images.githubusercontent.com/5236598/234074977-645d2e91-e291-4a27-b3ed-44be9ccbc005.png">

- Show deployment stats for every deployment 
<img width="1668" alt="image"
src="https://user-images.githubusercontent.com/5236598/234075620-da9190e1-c796-4df1-abf1-a130f04d90e0.png">

- Show pipelines with associated deployments 
<img width="1585" alt="image"
src="https://user-images.githubusercontent.com/5236598/234268631-79b4724c-e537-44da-9a30-5bdb1ea3ecb0.png">


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml Machine learning Team:ML Meta label for the ML team v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants