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

fine tune predict API: read model from index directly #1557

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

ylwu-amzn
Copy link
Collaborator

@ylwu-amzn ylwu-amzn commented Oct 27, 2023

Description

User needs both get model and predict permission for predict API. That's not reasonable.

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

@ylwu-amzn ylwu-amzn temporarily deployed to ml-commons-cicd-env October 27, 2023 00:49 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn temporarily deployed to ml-commons-cicd-env October 27, 2023 00:49 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn temporarily deployed to ml-commons-cicd-env October 27, 2023 00:49 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn marked this pull request as ready for review October 27, 2023 00:52
Copy link
Collaborator

@Zhangxunmt Zhangxunmt left a comment

Choose a reason for hiding this comment

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

Happy to see no UT change needed for this PR.

@@ -109,8 +105,9 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client
log.error("Failed to send error response", ex);
}
});
client.execute(MLModelGetAction.INSTANCE, getModelRequest, listener);

try (ThreadContext.StoredContext context = client.threadPool().getThreadContext().stashContext()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need stashContext here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

model index is system index

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #1557 (c73e480) into main (5d9324c) will increase coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #1557      +/-   ##
============================================
+ Coverage     78.39%   78.42%   +0.02%     
- Complexity     2378     2380       +2     
============================================
  Files           195      195              
  Lines          9594     9593       -1     
  Branches        964      964              
============================================
+ Hits           7521     7523       +2     
+ Misses         1636     1632       -4     
- Partials        437      438       +1     
Flag Coverage Δ
ml-commons 78.42% <0.00%> (+0.02%) ⬆️

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

Files Coverage Δ
...org/opensearch/ml/rest/RestMLPredictionAction.java 51.21% <0.00%> (+1.21%) ⬆️

... and 2 files with indirect coverage changes

@ylwu-amzn ylwu-amzn temporarily deployed to ml-commons-cicd-env October 27, 2023 01:19 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn temporarily deployed to ml-commons-cicd-env October 27, 2023 01:19 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn temporarily deployed to ml-commons-cicd-env October 27, 2023 01:19 — with GitHub Actions Inactive
@ylwu-amzn ylwu-amzn merged commit 0920ba7 into opensearch-project:main Oct 27, 2023
8 of 12 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 27, 2023
ylwu-amzn added a commit that referenced this pull request Oct 27, 2023
Signed-off-by: Yaliang Wu <[email protected]>
(cherry picked from commit 0920ba7)

Co-authored-by: Yaliang Wu <[email protected]>
TrungBui59 pushed a commit to TrungBui59/ml-commons that referenced this pull request Nov 6, 2023
TrungBui59 pushed a commit to TrungBui59/ml-commons that referenced this pull request Nov 6, 2023
austintlee pushed a commit to austintlee/ml-commons that referenced this pull request Feb 29, 2024
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.

4 participants