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

Introduce Ml Inference Search Request Extension #3284

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mingshl
Copy link
Collaborator

@mingshl mingshl commented Dec 16, 2024

Description

Introduce Ml Inference Search Request Extension, this is adding ml_inference search extension during search request/query phase,

For the search response side, I already introduced a ml_inference search response extension in earlier PR released in 2.18. Support ML Inference Search Processor Writing to Search Extension

Related Issues

#3286
#3054

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dhrubo-os
Copy link
Collaborator

@mingshl let's take the update from main. File has conflict.

@mingshl mingshl force-pushed the feature/ml-inference-search-extension branch from b2504c4 to d5f7605 Compare December 17, 2024 19:45
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 17, 2024 19:45 — with GitHub Actions Failure
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 17, 2024 19:45 — with GitHub Actions Failure
@mingshl
Copy link
Collaborator Author

mingshl commented Dec 17, 2024

thanks @dhrubo-os , rebased and resolved conflicts.

@mingshl mingshl changed the title Introduce Ml Inference Search Extension Introduce Ml Inference Search Request Extension Dec 17, 2024
@dhrubo-os
Copy link
Collaborator

Tests are failing

@mingshl
Copy link
Collaborator Author

mingshl commented Dec 30, 2024

Tests are failing

there is no changes related to ConversationalMemory, will try rerun the tests.

> Task :opensearch-ml-memory:test

ConversationalMemoryHandlerITTests > testDifferentUsers_DifferentConversations FAILED
    java.lang.NoClassDefFoundError at ConversationalMemoryHandlerITTests.java:389
        Caused by: java.lang.ClassNotFoundException at ConversationalMemoryHandlerITTests.java:389

@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 30, 2024 22:40 — with GitHub Actions Failure
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 31, 2024 00:36 — with GitHub Actions Failure
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 31, 2024 00:36 — with GitHub Actions Failure
@mingshl mingshl force-pushed the feature/ml-inference-search-extension branch from d5f7605 to cfa8a38 Compare December 31, 2024 06:29
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 31, 2024 06:30 — with GitHub Actions Failure
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval December 31, 2024 06:30 — with GitHub Actions Failure
@mingshl
Copy link
Collaborator Author

mingshl commented Dec 31, 2024

rebased and resolved conflicts.

@dhrubo-os
Copy link
Collaborator

D:\a\ml-commons\ml-commons\common\build\generated\sources\delombok\java\main\org\opensearch\ml\common\utils\StringUtils.java:379: error: unknown tag: implNote
     * @implNote This method uses JsonPath for JSON manipulation and StringUtils for path existence checks.
       ^

@mingshl mingshl force-pushed the feature/ml-inference-search-extension branch from 9c576ec to 3cf89dc Compare December 31, 2024 22:34
@mingshl mingshl requested a deployment to ml-commons-cicd-env-require-approval December 31, 2024 22:34 — with GitHub Actions Waiting
@mingshl mingshl requested a deployment to ml-commons-cicd-env-require-approval December 31, 2024 22:34 — with GitHub Actions Waiting
@mingshl mingshl force-pushed the feature/ml-inference-search-extension branch from 3cf89dc to 037fd7f Compare December 31, 2024 22:39
@mingshl mingshl temporarily deployed to ml-commons-cicd-env-require-approval December 31, 2024 22:40 — with GitHub Actions Inactive
@mingshl mingshl temporarily deployed to ml-commons-cicd-env-require-approval December 31, 2024 22:40 — with GitHub Actions Inactive
@mingshl mingshl temporarily deployed to ml-commons-cicd-env-require-approval January 2, 2025 20:33 — with GitHub Actions Inactive
@mingshl mingshl had a problem deploying to ml-commons-cicd-env-require-approval January 16, 2025 06:03 — with GitHub Actions Failure
@mingshl mingshl temporarily deployed to ml-commons-cicd-env-require-approval January 16, 2025 06:03 — with GitHub Actions Inactive
@mingshl mingshl temporarily deployed to ml-commons-cicd-env-require-approval January 16, 2025 23:47 — with GitHub Actions Inactive
@mingshl mingshl temporarily deployed to ml-commons-cicd-env-require-approval January 17, 2025 20:23 — with GitHub Actions Inactive
@austintlee
Copy link
Collaborator

Looks good overall, but can you add REST test cases with some non trivial examples?

@@ -41,6 +41,7 @@ dependencies {
testImplementation("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
testImplementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}")
testImplementation group: 'com.networknt' , name: 'json-schema-validator', version: '1.4.0'
testImplementation 'com.jayway.jsonpath:json-path:2.9.0'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious why do we need this here? I don't see any tests in memory module.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if I remove this dependency, it's throwing error in the build

ConversationMetaIndexITTests > testConversationsCanBeDeleted FAILED
    java.lang.NoClassDefFoundError at ConversationMetaIndexITTests.java:268
        Caused by: java.lang.ExceptionInInitializerError at IndexUtils.java:126

ConversationMetaIndexITTests > testCanQueryOverConversations FAILED
    java.lang.NoClassDefFoundError at ConversationMetaIndexITTests.java:431
        Caused by: java.lang.ExceptionInInitializerError at IndexUtils.java:126

ConversationMetaIndexITTests > testCanGetAConversationById FAILED
    java.lang.NoClassDefFoundError at ConversationMetaIndexITTests.java:539
        Caused by: java.lang.ExceptionInInitializerError at IndexUtils.java:126

ConversationMetaIndexITTests > testCanQueryOverConversationsByAdditionalInfo FAILED
    java.lang.NoClassDefFoundError at ConversationMetaIndexITTests.java:679
        Caused by: java.lang.ExceptionInInitializerError at IndexUtils.java:126

ConversationMetaIndexITTests > testCanAddNewConversation FAILED
    java.lang.NoClassDefFoundError at ConversationMetaIndexITTests.java:152
        Caused by: java.lang.ExceptionInInitializerError at IndexUtils.java:126

@@ -219,13 +226,15 @@ private void rewriteQueryString(SearchRequest request, String queryString, Actio
* @param queryString the original query string
* @param requestListener the {@link ActionListener} to be notified when the query string or query template is updated
* @param processOutputMap the list of output mappings
* @param requestContext
Copy link
Collaborator

Choose a reason for hiding this comment

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

add a description?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added and rebased

@mingshl mingshl force-pushed the feature/ml-inference-search-extension branch from d23f14c to 0960694 Compare January 25, 2025 06:11
@mingshl
Copy link
Collaborator Author

mingshl commented Jan 25, 2025

Looks good overall, but can you add REST test cases with some non trivial examples?

I added two REST tests to verify in the new commit add REST test and javadoc and just rebased the changes from main branch

@mingshl mingshl had a problem deploying to ml-commons-cicd-env January 25, 2025 06:12 — with GitHub Actions Failure
@mingshl mingshl temporarily deployed to ml-commons-cicd-env January 25, 2025 06:12 — with GitHub Actions Inactive
@mingshl mingshl temporarily deployed to ml-commons-cicd-env January 25, 2025 07:26 — with GitHub Actions Inactive
@mingshl mingshl temporarily deployed to ml-commons-cicd-env January 25, 2025 08:26 — with GitHub Actions Inactive
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 71.14094% with 43 lines in your changes missing coverage. Please review.

Project coverage is 80.30%. Comparing base (f28bb74) to head (0960694).
Report is 173 commits behind head on main.

Files with missing lines Patch % Lines
...va/org/opensearch/ml/common/utils/StringUtils.java 51.11% 19 Missing and 3 partials ⚠️
...l/processor/MLInferenceSearchRequestProcessor.java 68.00% 5 Missing and 3 partials ⚠️
...ava/org/opensearch/ml/processor/ModelExecutor.java 58.82% 5 Missing and 2 partials ⚠️
...ml/searchext/MLInferenceRequestParametersUtil.java 75.00% 1 Missing and 3 partials ⚠️
...rg/opensearch/ml/plugin/MachineLearningPlugin.java 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3284      +/-   ##
============================================
- Coverage     81.31%   80.30%   -1.01%     
- Complexity     6094     6713     +619     
============================================
  Files           573      602      +29     
  Lines         25268    28974    +3706     
  Branches       2666     3213     +547     
============================================
+ Hits          20547    23269    +2722     
- Misses         3601     4327     +726     
- Partials       1120     1378     +258     
Flag Coverage Δ
ml-commons 80.30% <71.14%> (-1.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants