[ML] Trained models: Improves UX for deploy action#205699
[ML] Trained models: Improves UX for deploy action#205699rbrtj merged 74 commits intoelastic:mainfrom
Conversation
…rations && active operations navigation blocker in models list
| try { | ||
| await this.ensureModelIsDownloaded(modelId); | ||
|
|
||
| this.addActiveOperation({ modelId, type: 'deploying' }); |
There was a problem hiding this comment.
how do you queue several deployments of the same model?
in the cloud environment, the depoyment process can take minutes.
There was a problem hiding this comment.
It was a mistake. Previously user could start only one deployment at a time, made changes to follow the same pattern in:
b9d6c5f
|
At the moment you allow 2 start deployment actions, but not more. Any particular reason for that? Also, it is possible to queue deployments with the same ID. same_deployment_id_issue.mov |
|
When the user deletes a model after starting a download, we should cancel all queued deployment requests: start_after_delte.mov |
x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx
Show resolved
Hide resolved
x-pack/platform/plugins/shared/ml/public/application/model_management/trained_models_service.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/ml/public/application/model_management/trained_models_service.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/ml/public/application/model_management/trained_models_service.ts
Outdated
Show resolved
Hide resolved
| return this.downloadStatus$.getValue()[modelId]; | ||
| } | ||
|
|
||
| private async ensureModelIsDownloaded(modelId: string) { |
There was a problem hiding this comment.
Mixing concepts makes it difficult to follow the logic. I would suggest sticking to one, either observables or promises. If you prefer the reactive approach, you should create a queue of model deployments. And this queue should wait for model download completion.
There was a problem hiding this comment.
Refactor to follow the more reactive pattern done in: 173321f
| if (!refresh) return; | ||
|
|
||
| // Register callback for expanded rows updates | ||
| const removeCallback = trainedModelsService.onFetch((modelItems) => { |
There was a problem hiding this comment.
What is the motivation for registring a callback? Did you consider using an effect that tracks model items?
x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx
Outdated
Show resolved
Hide resolved
…ace-download-button-by-extending-deploy-action
…current operations state
Previously only one deployment could be started at a time, fixed in: |
…ore reactive pattern
…nsavedChangesPrompt non blocking spa functionality
| blockSpaNavigation: false; | ||
| } | ||
|
|
||
| export const useUnsavedChangesPrompt = ({ |
There was a problem hiding this comment.
Note: This is just a proposal, so it is possible to use useUnsavedChangesPrompt without blocking SPA navigation. If you don't like the implementation, we can separate the relevant part of the hook into our package
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
cc @rbrtj |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Starting backport for target branches: 8.x |
|
Starting backport for target branches: 8.x |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
1 similar comment
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…on (elastic#205699) ## Summary * Removes the download model button by extending the deploy action. * The model download begins automatically after clicking Start Deployment. * It is possible to queue one deployment while the model is still downloading. * Navigating away from the Trained Models page will not interrupt the downloading or deployment process. * `State` column renamed to `Model State` * Responsiveness fix: icons overlap https://github.com/user-attachments/assets/045d6f1f-5c2b-4cb5-ad34-ff779add80e3 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit f9c4f59) # Conflicts: # x-pack/platform/plugins/shared/ml/tsconfig.json
…y action (#205699) (#211029) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Trained models: Replace download button by extending deploy action (#205699)](#205699) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Robert Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-11T13:33:40Z","message":"[ML] Trained models: Replace download button by extending deploy action (#205699)\n\n## Summary\n\n* Removes the download model button by extending the deploy action.\n* The model download begins automatically after clicking Start\nDeployment.\n* It is possible to queue one deployment while the model is still\ndownloading.\n* Navigating away from the Trained Models page will not interrupt the\ndownloading or deployment process.\n* `State` column renamed to `Model State`\n* Responsiveness fix: icons overlap\n\n\n\nhttps://github.com/user-attachments/assets/045d6f1f-5c2b-4cb5-ad34-ff779add80e3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"f9c4f59f8ea4b9fe02bb8f17c140e98d9a472aca","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement",":ml","backport missing","Feature:3rd Party Models","Team:ML","ci:cloud-deploy","backport:version","v9.1.0","v8.19.0"],"title":"[ML] Trained models: Replace download button by extending deploy action","number":205699,"url":"https://github.com/elastic/kibana/pull/205699","mergeCommit":{"message":"[ML] Trained models: Replace download button by extending deploy action (#205699)\n\n## Summary\n\n* Removes the download model button by extending the deploy action.\n* The model download begins automatically after clicking Start\nDeployment.\n* It is possible to queue one deployment while the model is still\ndownloading.\n* Navigating away from the Trained Models page will not interrupt the\ndownloading or deployment process.\n* `State` column renamed to `Model State`\n* Responsiveness fix: icons overlap\n\n\n\nhttps://github.com/user-attachments/assets/045d6f1f-5c2b-4cb5-ad34-ff779add80e3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"f9c4f59f8ea4b9fe02bb8f17c140e98d9a472aca"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205699","number":205699,"mergeCommit":{"message":"[ML] Trained models: Replace download button by extending deploy action (#205699)\n\n## Summary\n\n* Removes the download model button by extending the deploy action.\n* The model download begins automatically after clicking Start\nDeployment.\n* It is possible to queue one deployment while the model is still\ndownloading.\n* Navigating away from the Trained Models page will not interrupt the\ndownloading or deployment process.\n* `State` column renamed to `Model State`\n* Responsiveness fix: icons overlap\n\n\n\nhttps://github.com/user-attachments/assets/045d6f1f-5c2b-4cb5-ad34-ff779add80e3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"f9c4f59f8ea4b9fe02bb8f17c140e98d9a472aca"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…lastic#211459) After the recent changes in elastic#205699 If a deployment fails, the error will be handled correctly at a single deployment level, however, the pipeline would break, thus further deployments wouldn't be proceeded. (cherry picked from commit 58cea84)
…yment (#211459) (#212353) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Trained Models: Cannot deploy a model after a failed deployment (#211459)](#211459) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Robert Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-19T09:45:54Z","message":"[ML] Trained Models: Cannot deploy a model after a failed deployment (#211459)\n\nAfter the recent changes in\nhttps://github.com//pull/205699\nIf a deployment fails, the error will be handled correctly at a single\ndeployment level, however, the pipeline would break, thus further\ndeployments wouldn't be proceeded.","sha":"58cea843e915ba4dd7184f7718cb50feca77d05a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","backport missing","Team:ML","backport:version","v9.1.0","v8.19.0"],"title":"[ML] Trained Models: Cannot deploy a model after a failed deployment","number":211459,"url":"https://github.com/elastic/kibana/pull/211459","mergeCommit":{"message":"[ML] Trained Models: Cannot deploy a model after a failed deployment (#211459)\n\nAfter the recent changes in\nhttps://github.com//pull/205699\nIf a deployment fails, the error will be handled correctly at a single\ndeployment level, however, the pipeline would break, thus further\ndeployments wouldn't be proceeded.","sha":"58cea843e915ba4dd7184f7718cb50feca77d05a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211459","number":211459,"mergeCommit":{"message":"[ML] Trained Models: Cannot deploy a model after a failed deployment (#211459)\n\nAfter the recent changes in\nhttps://github.com//pull/205699\nIf a deployment fails, the error will be handled correctly at a single\ndeployment level, however, the pipeline would break, thus further\ndeployments wouldn't be proceeded.","sha":"58cea843e915ba4dd7184f7718cb50feca77d05a"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…yment (elastic#211459) (elastic#212353) # Backport This will backport the following commits from `main` to `8.x`: - [[ML] Trained Models: Cannot deploy a model after a failed deployment (elastic#211459)](elastic#211459) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Robert Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-19T09:45:54Z","message":"[ML] Trained Models: Cannot deploy a model after a failed deployment (elastic#211459)\n\nAfter the recent changes in\nhttps://github.com/elastic/pull/205699\nIf a deployment fails, the error will be handled correctly at a single\ndeployment level, however, the pipeline would break, thus further\ndeployments wouldn't be proceeded.","sha":"58cea843e915ba4dd7184f7718cb50feca77d05a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","backport missing","Team:ML","backport:version","v9.1.0","v8.19.0"],"title":"[ML] Trained Models: Cannot deploy a model after a failed deployment","number":211459,"url":"https://github.com/elastic/kibana/pull/211459","mergeCommit":{"message":"[ML] Trained Models: Cannot deploy a model after a failed deployment (elastic#211459)\n\nAfter the recent changes in\nhttps://github.com/elastic/pull/205699\nIf a deployment fails, the error will be handled correctly at a single\ndeployment level, however, the pipeline would break, thus further\ndeployments wouldn't be proceeded.","sha":"58cea843e915ba4dd7184f7718cb50feca77d05a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211459","number":211459,"mergeCommit":{"message":"[ML] Trained Models: Cannot deploy a model after a failed deployment (elastic#211459)\n\nAfter the recent changes in\nhttps://github.com/elastic/pull/205699\nIf a deployment fails, the error will be handled correctly at a single\ndeployment level, however, the pipeline would break, thus further\ndeployments wouldn't be proceeded.","sha":"58cea843e915ba4dd7184f7718cb50feca77d05a"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…lastic#211459) After the recent changes in elastic#205699 If a deployment fails, the error will be handled correctly at a single deployment level, however, the pipeline would break, thus further deployments wouldn't be proceeded.


Summary
Statecolumn renamed toModel StateScreen.Recording.2025-01-14.at.10.23.55.mov