Skip to content

[ML] Trained models: Improves UX for deploy action#205699

Merged
rbrtj merged 74 commits intoelastic:mainfrom
rbrtj:trained-models-replace-download-button-by-extending-deploy-action
Feb 11, 2025
Merged

[ML] Trained models: Improves UX for deploy action#205699
rbrtj merged 74 commits intoelastic:mainfrom
rbrtj:trained-models-replace-download-button-by-extending-deploy-action

Conversation

@rbrtj
Copy link
Contributor

@rbrtj rbrtj commented Jan 7, 2025

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
Screen.Recording.2025-01-14.at.10.23.55.mov
try {
await this.ensureModelIsDownloaded(modelId);

this.addActiveOperation({ modelId, type: 'deploying' });
Copy link
Contributor

Choose a reason for hiding this comment

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

how do you queue several deployments of the same model?
in the cloud environment, the depoyment process can take minutes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a mistake. Previously user could start only one deployment at a time, made changes to follow the same pattern in:
b9d6c5f

@darnautov
Copy link
Contributor

We should make the Actions column look a bit neater with primary actions. Either increasing the column width or use icons

image
@darnautov
Copy link
Contributor

After the model downloading I see the "Read to deploy" state, while it should move to "Deploying" right after the downloading

image
@darnautov
Copy link
Contributor

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
@darnautov
Copy link
Contributor

When the user deletes a model after starting a download, we should cancel all queued deployment requests:

start_after_delte.mov
return this.downloadStatus$.getValue()[modelId];
}

private async ensureModelIsDownloaded(modelId: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactor to follow the more reactive pattern done in: 173321f

if (!refresh) return;

// Register callback for expanded rows updates
const removeCallback = trainedModelsService.onFetch((modelItems) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the motivation for registring a callback? Did you consider using an effect that tracks model items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in: 173321f

@rbrtj
Copy link
Contributor Author

rbrtj commented Jan 9, 2025

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

Previously only one deployment could be started at a time, fixed in:
b9d6c5f

blockSpaNavigation: false;
}

export const useUnsavedChangesPrompt = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

@rbrtj rbrtj added the v9.1.0 label Feb 11, 2025
@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 11, 2025

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 2217 2223 +6

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.5MB 1.5MB +49.0B
indexLifecycleManagement 167.7KB 167.8KB +49.0B
indexManagement 765.1KB 765.1KB +49.0B
ingestPipelines 422.1KB 422.2KB +49.0B
ml 4.7MB 4.7MB -341.0B
spaces 266.5KB 266.6KB +49.0B
streamsApp 303.9KB 304.0KB +49.0B
total -47.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
ml 105 104 -1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 78.0KB 78.1KB +54.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
ml 557 560 +3

Total ESLint disabled count

id before after diff
ml 560 563 +3

History

cc @rbrtj

@rbrtj rbrtj merged commit f9c4f59 into elastic:main Feb 11, 2025
9 checks passed
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 13, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 205699 locally

@rbrtj rbrtj added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Feb 13, 2025
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 13, 2025
@darnautov darnautov added backport missing Added to PRs automatically when the are determined to be missing a backport. backport:version Backport to applied version labels v8.19.0 and removed backport:skip This PR does not require backporting labels Feb 13, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/13309448297

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/13309448408

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 205699

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 205699

Questions ?

Please refer to the Backport tool documentation

@rbrtj
Copy link
Contributor Author

rbrtj commented Feb 13, 2025

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

rbrtj added a commit to rbrtj/kibana that referenced this pull request Feb 13, 2025
…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
rbrtj added a commit that referenced this pull request Feb 13, 2025
…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-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 13, 2025
rbrtj added a commit that referenced this pull request Feb 19, 2025
…211459)

After the recent changes in
#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.
rbrtj added a commit to rbrtj/kibana that referenced this pull request Feb 25, 2025
…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)
rbrtj added a commit that referenced this pull request Feb 25, 2025
…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-->
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 4, 2025
…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-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…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.
@nastasha-solomon nastasha-solomon changed the title [ML] Trained models: Replace download button by extending deploy action Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:cloud-deploy Create or update a Cloud deployment Feature:3rd Party Models ML 3rd party models :ml release_note:enhancement Team:ML Team label for ML (also use :ml) t// v8.19.0 v9.1.0

8 participants