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

Use model type to check local or remote model #3597

Merged
merged 6 commits into from
Mar 3, 2025

Conversation

b4sjoo
Copy link
Collaborator

@b4sjoo b4sjoo commented Feb 28, 2025

Description

In stead of using user input algorithm we use model type extracting from model cache to check local or remote model, this will fix disable local model will cause remote neural search failure issue

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.

@@ -132,12 +132,12 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client
* @return MLPredictionTaskRequest
*/
@VisibleForTesting
MLPredictionTaskRequest getRequest(String modelId, String algorithm, RestRequest request) throws IOException {
MLPredictionTaskRequest getRequest(String modelId, String modelType, String userAlgorithm, RestRequest request) throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add java doc for this method. I'm afraid this could be confusing later if we don't have enough documentation about this in the code.

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

@b4sjoo
Copy link
Collaborator Author

b4sjoo commented Mar 3, 2025

Rebased

@b4sjoo b4sjoo had a problem deploying to ml-commons-cicd-env March 3, 2025 19:54 — with GitHub Actions Error
@b4sjoo b4sjoo temporarily deployed to ml-commons-cicd-env March 3, 2025 19:54 — with GitHub Actions Inactive
@b4sjoo b4sjoo had a problem deploying to ml-commons-cicd-env March 3, 2025 19:54 — with GitHub Actions Failure
@b4sjoo b4sjoo temporarily deployed to ml-commons-cicd-env March 3, 2025 19:54 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os merged commit 696b1e1 into opensearch-project:main Mar 3, 2025
8 of 10 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 3, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.11 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.11 2.11
# Navigate to the new working tree
cd .worktrees/backport-2.11
# Create a new branch
git switch --create backport/backport-3597-to-2.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.11
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.11

Then, create a pull request where the base branch is 2.11 and the compare/head branch is backport/backport-3597-to-2.11.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.12 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.12 2.12
# Navigate to the new working tree
cd .worktrees/backport-2.12
# Create a new branch
git switch --create backport/backport-3597-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.12
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.12

Then, create a pull request where the base branch is 2.12 and the compare/head branch is backport/backport-3597-to-2.12.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.13 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.13 2.13
# Navigate to the new working tree
cd .worktrees/backport-2.13
# Create a new branch
git switch --create backport/backport-3597-to-2.13
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.13
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.13

Then, create a pull request where the base branch is 2.13 and the compare/head branch is backport/backport-3597-to-2.13.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.14 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.14 2.14
# Navigate to the new working tree
cd .worktrees/backport-2.14
# Create a new branch
git switch --create backport/backport-3597-to-2.14
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.14
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.14

Then, create a pull request where the base branch is 2.14 and the compare/head branch is backport/backport-3597-to-2.14.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.15 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.15 2.15
# Navigate to the new working tree
cd .worktrees/backport-2.15
# Create a new branch
git switch --create backport/backport-3597-to-2.15
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.15
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.15

Then, create a pull request where the base branch is 2.15 and the compare/head branch is backport/backport-3597-to-2.15.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 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.16 2.16
# Navigate to the new working tree
cd .worktrees/backport-2.16
# Create a new branch
git switch --create backport/backport-3597-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-3597-to-2.16.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.17 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.17 2.17
# Navigate to the new working tree
cd .worktrees/backport-2.17
# Create a new branch
git switch --create backport/backport-3597-to-2.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.17

Then, create a pull request where the base branch is 2.17 and the compare/head branch is backport/backport-3597-to-2.17.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.18 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.18 2.18
# Navigate to the new working tree
cd .worktrees/backport-2.18
# Create a new branch
git switch --create backport/backport-3597-to-2.18
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 696b1e1739cbbb5ef138255339acd02375719570
# Push it to GitHub
git push --set-upstream origin backport/backport-3597-to-2.18
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.18

Then, create a pull request where the base branch is 2.18 and the compare/head branch is backport/backport-3597-to-2.18.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 3, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
@dhrubo-os
Copy link
Collaborator

@b4sjoo majority auto backports are failing. Are you planning to raise PR for those?

rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 4, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 4, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 5, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 5, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 5, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 5, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 5, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
rithin-pullela-aws pushed a commit to rithin-pullela-aws/ml-commons that referenced this pull request Mar 5, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
(cherry picked from commit 696b1e1)
akolarkunnu pushed a commit to akolarkunnu/ml-commons that referenced this pull request Mar 11, 2025
* use model type to check local or remote model

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* spotless

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Ignore test resource

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Add java doc

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

* Handle when model not in cache

Signed-off-by: Sicheng Song <sicheng.song@outlook.com>

---------

Signed-off-by: Sicheng Song <sicheng.song@outlook.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.

4 participants