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

[Semantic Text UI] Handle the case when the model is not yet downloaded #182040

Merged

Conversation

saikatsarkar056
Copy link
Contributor

@saikatsarkar056 saikatsarkar056 commented Apr 29, 2024

When the trained model is not yet downloaded, it can't be deployed. This PR has covered the following:

  • Download the model if it does not exist
  • Tests to support this change

How to test the changes locally

  • Download the elasticsearch changes from GitHub branch
  • Run the elasticsearch: ./gradlew :run -Drun.license_type=trial
  • Download the changes of this PR in local kibana and do the following steps
    • Set isSemanticTextEnabled = true in this location
    • Run yarn start

@saikatsarkar056 saikatsarkar056 requested a review from a team as a code owner April 29, 2024 21:24
@saikatsarkar056 saikatsarkar056 self-assigned this Apr 29, 2024
@saikatsarkar056 saikatsarkar056 changed the title Handle model not downloaded [Semantic Text UI] Handle the case when the model is not yet downloaded Apr 29, 2024
@saikatsarkar056 saikatsarkar056 added backport:skip This commit does not require backporting Feature:Index Management Index and index templates UI release_note:skip Skip the PR/issue when compiling release notes v8.15.0 labels Apr 29, 2024
@saikatsarkar056
Copy link
Contributor Author

@elastic/kibana-management It would be great if I can get a review for this PR.

@saikatsarkar056
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@sphilipse sphilipse left a comment

Choose a reason for hiding this comment

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

one nitpick but generally looks good :)

@yuliacech yuliacech self-requested a review May 6, 2024 10:11
Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot for addressing this use case, @saikatsarkar056!
After testing the changes locally, I'd just want to confirm that the UX with the modal blocking the user from saving the mappings is the best choice. If I understand correctly, the modal will now wait until the model is downloaded and deployed. That could take a really long time. Should we consider starting the download and deployment of the model in the background instead?

@saikatsarkar056 saikatsarkar056 requested a review from a team as a code owner May 7, 2024 22:05
@saikatsarkar056
Copy link
Contributor Author

saikatsarkar056 commented May 7, 2024

Thanks a lot for addressing this use case, @saikatsarkar056! After testing the changes locally, I'd just want to confirm that the UX with the modal blocking the user from saving the mappings is the best choice. If I understand correctly, the modal will now wait until the model is downloaded and deployed. That could take a really long time. Should we consider starting the download and deployment of the model in the background instead?

@yuliacech Please notice this code-block. The model download and deployment are occurring in the background. Only the check to determine if a model has already been downloaded is performed asynchronously, which is quite fast.

Furthermore, I've relocated the CreateInferenceEndpoint block to its own function, allowing us to call it after the model has been downloaded and deployed.

The modifications in this pull request indicate that the model download, model deployment, and CreateInferenceEndpoint processes occur one-after-another in the background.

@saikatsarkar056
Copy link
Contributor Author

@yuliacech Thank you for the feedback. Can you please review this PR once again?

@saikatsarkar056 saikatsarkar056 force-pushed the handle_model_not_downloaded branch 2 times, most recently from d67f89f to 9c5cbbc Compare May 8, 2024 00:48
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
ml 66 67 +1

Async chunks

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

id before after diff
indexManagement 655.2KB 655.8KB +629.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 100 101 +1
Unknown metric groups

API count

id before after diff
ml 153 154 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @saikatsarkar056

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

ML changes LGTM

@saikatsarkar056 saikatsarkar056 merged commit fd44e1f into elastic:main May 8, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Index Management Index and index templates UI release_note:skip Skip the PR/issue when compiling release notes v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants