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

include deployment status in deploy API response #1336

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

Zhangxunmt
Copy link
Collaborator

@Zhangxunmt Zhangxunmt commented Sep 13, 2023

Description

This is to add deployment status with minimum impact to the current code and API workflows. Verified it works with local environment.

Before this change:

POST /_plugins/_ml/models/mUFIL4kB4ubqQRzeKvr1/_deploy

sample response for remote model
{
"task_id": "OP5JL4kB28KP1SGMupr3",
"status": "CREATED"
}

This is ridiculous - deploying a remote model doesn't need to be asyncrhonize. I need to see the deployment status right away without sending another API request to query the Task Id!

After this change:

POST /_plugins/_ml/models/mUFIL4kB4ubqQRzeKvr1/_deploy

sample response for remote model
{
"task_id": "OP5JL4kB28KP1SGMupr3",
"task_type" : "DEPLOY_MODEL"
"status": "COMPLETED"
}

For non remote models, the response will be
{
"task_id": "OP5JL4kB28KP1SGMupr3",
"task_type" : "DEPLOY_MODEL"
"status": "CREATED"
}

If the deployment fails, the response will send back the error message right away.

@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 13, 2023 23:39 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 13, 2023 23:39 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt added the enhancement New feature or request label Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #1336 (0940aa2) into 2.x (24a629b) will decrease coverage by 0.32%.
The diff coverage is 2.56%.

@@             Coverage Diff              @@
##                2.x    #1336      +/-   ##
============================================
- Coverage     78.62%   78.31%   -0.32%     
- Complexity     2272     2273       +1     
============================================
  Files           190      190              
  Lines          9250     9286      +36     
  Branches        909      910       +1     
============================================
- Hits           7273     7272       -1     
- Misses         1568     1603      +35     
- Partials        409      411       +2     
Flag Coverage Δ
ml-commons 78.31% <2.56%> (-0.32%) ⬇️

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

Files Changed Coverage Δ
.../action/register/TransportRegisterModelAction.java 96.17% <ø> (-0.05%) ⬇️
...h/ml/action/deploy/TransportDeployModelAction.java 64.97% <2.56%> (-17.77%) ⬇️

... and 1 file with indirect coverage changes

@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 17:07 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 17:07 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 19:02 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 19:02 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 19:02 — with GitHub Actions Inactive
@@ -23,6 +23,8 @@
import java.util.Set;
import java.util.stream.Collectors;

import javax.swing.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we avoid to import javax.swing.* 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.

Good catch! Removed this redundant line in the refresh!

@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 20:05 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 20:05 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 20:05 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 20:29 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 20:29 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 20:29 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 21:00 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 21:00 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env September 14, 2023 21:00 — with GitHub Actions Inactive
@opensearch-trigger-bot
Copy link
Contributor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport main enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants