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

[Backport 2.16] [Backport 2.x] Adds preset contentRegistry for IngestProcessors (#3281) #3405

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport ca0f0da from #3317

… (#3317)

* Adds preset contentRegistry for IngestProcessors (#3281)

* add preset xContentRegistry to ingestProcessors for custom parametized local models

Curently local models that use the parameters map within the payload to create a request can not create objects to be used for local model prediction. This requires a opensearch core change because it needs the contentRegistry,however given there is not much dependency on the registry (currently) we can give it the preset registry given in the MachineLearningPlugin class vai the getNamedXContent() class

Signed-off-by: Brian Flores <iflorbri@amazon.com>

* Adds UT for proving models depend on xContentRegistry for prediction

Signed-off-by: Brian Flores <iflorbri@amazon.com>

* apply spotless

Signed-off-by: Brian Flores <iflorbri@amazon.com>

* Adds IT for Asymmetric Embedding scenario with MLInferenceIngestProcessor

We needed to make sure that a IT existed so that the preset content registry on the processor could work with parametized local models. By providing an IT that uses the asymetric embedding model its proven that the content registry is needed to create the embeddings. In this specific test case I used a ingest pipeline to convert passage embeddings, by simulating the pipeline to save test time.

Signed-off-by: Brian Flores <iflorbri@amazon.com>

---------

Signed-off-by: Brian Flores <iflorbri@amazon.com>
(cherry picked from commit df1b1ef)

* apply spotless

Signed-off-by: Brian Flores <iflorbri@amazon.com>

* Adds check for Java 11

The test passes on JAVA 21 but for some reason Java 11 has trouble passing in a message so it returns null when getMessage occurs so when Mockito tries to invoke getMessage it will get get a second NPE. and thus is why the exception is caught. This code change is to get around the gap that Java 11 has.

Signed-off-by: Brian Flores <iflorbri@amazon.com>

* spotless

Signed-off-by: Brian Flores <iflorbri@amazon.com>

---------

Signed-off-by: Brian Flores <iflorbri@amazon.com>
(cherry picked from commit ca0f0da)
@dhrubo-os dhrubo-os merged commit a02e1dd into 2.16 Jan 18, 2025
6 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants