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

Issue 1878/1879/1880 fixing index not found for model group/model/tasks #1889

Conversation

sam-herman
Copy link
Collaborator

Description

When model/model group/task is not created yet, return an empty search response instead of a broken 404 with cryptic index not found message.
More description in:
#1878
#1879
#1880

Issues Resolved

#1878
#1879
#1880

Check List

  • [X ] New functionality includes testing.
    • [ X] All tests pass
  • New functionality has been documented.
    • [X ] New functionality has javadoc added
  • [ X] Commits are signed per the DCO using --signoff

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.

Signed-off-by: Samuel Herman <sherman8915@gmail.com>
Signed-off-by: Samuel Herman <sherman8915@gmail.com>
Signed-off-by: Samuel Herman <sherman8915@gmail.com>
@sam-herman sam-herman temporarily deployed to ml-commons-cicd-env January 18, 2024 20:13 — with GitHub Actions Inactive
@sam-herman sam-herman temporarily deployed to ml-commons-cicd-env January 18, 2024 20:13 — with GitHub Actions Inactive
@sam-herman sam-herman temporarily deployed to ml-commons-cicd-env January 18, 2024 20:13 — with GitHub Actions Inactive
@sam-herman sam-herman temporarily deployed to ml-commons-cicd-env January 18, 2024 20:13 — with GitHub Actions Inactive
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (38b51f2) 82.63% compared to head (0f69b95) 82.64%.

Files Patch % Lines
.../opensearch/ml/action/handler/MLSearchHandler.java 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1889   +/-   ##
=========================================
  Coverage     82.63%   82.64%           
  Complexity     5391     5391           
=========================================
  Files           521      521           
  Lines         21724    21731    +7     
  Branches       2211     2211           
=========================================
+ Hits          17952    17959    +7     
  Misses         2873     2873           
  Partials        899      899           
Flag Coverage Δ
ml-commons 82.64% <95.83%> (+<0.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.

@@ -162,7 +166,8 @@ public void search(SearchRequest request, ActionListener<SearchResponse> actionL
}
}

private QueryBuilder rewriteQueryBuilder(QueryBuilder queryBuilder, List<String> modelGroupIds) {
@VisibleForTesting
Copy link
Collaborator

Choose a reason for hiding this comment

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

the neural search guys told me to try not to use this, but ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@HenryL27 it's an interesting point! I had a PR recently to remove those and all Guava dependencies completely, but there seem to be a lack of consensus around it 😄
#1855

@ylwu-amzn ylwu-amzn merged commit 41fac82 into opensearch-project:main Jan 19, 2024
11 of 13 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1889-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 41fac826c8fd1182f83c1f3f6b301bf17022eb2f
# Push it to GitHub
git push --set-upstream origin backport/backport-1889-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1889-to-2.x.

@sam-herman sam-herman deleted the issue-1878-fixing-index-not-found-for-model-group branch January 19, 2024 18:06
@ylwu-amzn
Copy link
Collaborator

The backport to 2.x failed:

@samuel-oci Seems there are some conflicts for 2.x. Can you help manually backport this PR to 2.x ?

@sam-herman
Copy link
Collaborator Author

sam-herman commented Jan 22, 2024

The backport to 2.x failed:

@samuel-oci Seems there are some conflicts for 2.x. Can you help manually backport this PR to 2.x ?

@ylwu-amzn what is the process? should I just create the backport branch and send the PR?

@ylwu-amzn
Copy link
Collaborator

@samuel-oci no need to create backport branch in ml-commons branch, just use your forked repo like this PR

sam-herman added a commit to sam-herman/ml-commons that referenced this pull request Jan 22, 2024
…ks (opensearch-project#1889)

* adding tests for search of ML constructs

Signed-off-by: Samuel Herman <sherman8915@gmail.com>

* improve test coverage on MLSearchHandler

Signed-off-by: Samuel Herman <sherman8915@gmail.com>

* fix headers on test

Signed-off-by: Samuel Herman <sherman8915@gmail.com>

---------

Signed-off-by: Samuel Herman <sherman8915@gmail.com>
(cherry picked from commit 41fac82)
Signed-off-by: Samuel Herman <sherman8915@gmail.com>
@sam-herman
Copy link
Collaborator Author

@samuel-oci no need to create backport branch in ml-commons branch, just use your forked repo like this PR

@ylwu-amzn created #1895

ylwu-amzn pushed a commit that referenced this pull request Jan 22, 2024
…ks (#1889) (#1895)

* adding tests for search of ML constructs



* improve test coverage on MLSearchHandler



* fix headers on test



---------


(cherry picked from commit 41fac82)

Signed-off-by: Samuel Herman <sherman8915@gmail.com>
Signed-off-by: samuel-oci <97131656+samuel-oci@users.noreply.github.com>
austintlee pushed a commit to austintlee/ml-commons that referenced this pull request Mar 19, 2024
…ks (opensearch-project#1889)

* adding tests for search of ML constructs

Signed-off-by: Samuel Herman <sherman8915@gmail.com>

* improve test coverage on MLSearchHandler

Signed-off-by: Samuel Herman <sherman8915@gmail.com>

* fix headers on test

Signed-off-by: Samuel Herman <sherman8915@gmail.com>

---------

Signed-off-by: Samuel Herman <sherman8915@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants