Skip to content

[8.19] [ML] Trained Models: Prevent Download of Models Already Present in Other Spaces with Warning (#220238)#220723

Merged
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-220238
May 9, 2025
Merged

[8.19] [ML] Trained Models: Prevent Download of Models Already Present in Other Spaces with Warning (#220238)#220723
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-220238

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…her Spaces with Warning (elastic#220238)

Resolves elastic#206834
Before:
> If a trained model like ELSER has already been downloaded but is not
available in the current space, the download action is available but
results in the following error

![image](https://github.com/user-attachments/assets/e69516e5-749e-4500-b645-099975453f1e)

This PR prevents models from being downloaded if they already exist in a
different space
* If the model is downloaded in a different space and the user has write
permissions for the current space:
<img width="1228" alt="image"
src="https://github.com/user-attachments/assets/db146bbb-a295-471e-b0a1-f1a8c0949739"
/>

* If the model is downloaded in a different space but the user lacks
write permissions for the current space:
<img width="1479" alt="image"
src="https://github.com/user-attachments/assets/dcf195c1-7314-4b0b-af9d-1fbbaffcbb89"
/>

Note:
It adds an additional request to ES, but within a trace, it is just one
extra span, so the performance impact is not significant:

![image](https://github.com/user-attachments/assets/8be08344-eb91-4cdb-a5b1-a4838f5219b6)

I tried adding functional tests for this, but it only applies to hosted
models, which are too large to download durning the testing phase, thus
I don't see a convenient way to test it.

(cherry picked from commit c97f2c7)
@kibanamachine kibanamachine merged commit 7ee9114 into elastic:8.19 May 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

2 participants