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

check model auto deploy #2288

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Conversation

Zhangxunmt
Copy link
Collaborator

@Zhangxunmt Zhangxunmt commented Mar 27, 2024

Description

Checking if the model has auto-deploy enabled at the model level. If true, go ahead with auto deploy. Otherwise return 400 illegal_argument_exception with message asking Users to deploy model first.
If the deploy_setting is null in the Model, by default we treat it as true.

PUT /_plugins/_ml/models/qPUJgo4BHjpQDZnR5sw4
{
    "deploy_setting": {"is_auto_deploy_enabled": false}
}
POST /_plugins/_ml/models/qPUJgo4BHjpQDZnR5sw4/_predict {...}
# Response
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Model not ready yet. Please run this first: POST /_plugins/_ml/models/qPUJgo4BHjpQDZnR5sw4/_deploy"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Model not ready yet. Please run this first: POST /_plugins/_ml/models/qPUJgo4BHjpQDZnR5sw4/_deploy"
  },
  "status": 400
}
PUT /_plugins/_ml/models/qPUJgo4BHjpQDZnR5sw4
{
    "deploy_setting": {"is_auto_deploy_enabled": true}
}
POST /_plugins/_ml/models/qPUJgo4BHjpQDZnR5sw4/_predict {...}
# Response
{
  "inference_results": [
    ......
 ]
}

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.

jngz-es
jngz-es previously approved these changes Mar 27, 2024
Signed-off-by: Xun Zhang <[email protected]>
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 22:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 22:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 22:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 22:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 22:51 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 22:51 — with GitHub Actions Inactive
listener
.onFailure(
new IllegalArgumentException(
"Model not ready yet. Please run this first: POST /_plugins/_ml/models/" + modelId + "/_deploy"
Copy link
Collaborator

@dhrubo-os dhrubo-os Mar 27, 2024

Choose a reason for hiding this comment

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

[nit] We are assuming customer is using dev tools.

May be set a generic message like: "The model is not deployed yet. Please deploy the model first." ?

@Zhangxunmt Zhangxunmt merged commit 848abf6 into opensearch-project:main Mar 27, 2024
9 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 27, 2024
Signed-off-by: Xun Zhang <[email protected]>
(cherry picked from commit 848abf6)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 27, 2024
Signed-off-by: Xun Zhang <[email protected]>
(cherry picked from commit 848abf6)
Zhangxunmt added a commit that referenced this pull request Mar 27, 2024
Signed-off-by: Xun Zhang <[email protected]>
(cherry picked from commit 848abf6)

Co-authored-by: Xun Zhang <[email protected]>
Zhangxunmt added a commit that referenced this pull request Mar 27, 2024
Signed-off-by: Xun Zhang <[email protected]>
(cherry picked from commit 848abf6)

Co-authored-by: Xun Zhang <[email protected]>
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 23:41 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 23:41 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env March 27, 2024 23:41 — with GitHub Actions Inactive
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