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 before delete #3209

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

xinyual
Copy link
Collaborator

@xinyual xinyual commented Nov 11, 2024

Description

This pr is to check all downstream service before deleting ml model. Two downstream tasks are checking here:

  1. Agent
  2. Pipelines

For agent, we enforce this tool factory to implement a method to return the key field name of each tool. Then we create a should DSL query like

{
  "query": {
  "should": [
  "terms": {
            "tool.parameters.model_id": ["delete_model_id"]
        },
    "terms": {
            "tool.parameters.embedding_model_id": ["delete_model_id"]
        }
  },
  "terms": {
            "tool.parameters.inference_model_id": ["delete_model_id"]
        }
  }]
}

For pipelines, we fetch all ingestion pipelines and search pipelines and check for each pipeline whether they contain the candidate model id.

Related Issues

#3191
#3087
#3088

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.

Signed-off-by: xinyual <[email protected]>
@xinyual xinyual temporarily deployed to ml-commons-cicd-env November 12, 2024 02:55 — with GitHub Actions Inactive
@xinyual xinyual had a problem deploying to ml-commons-cicd-env November 12, 2024 02:55 — with GitHub Actions Failure
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
@xinyual xinyual had a problem deploying to ml-commons-cicd-env November 12, 2024 07:14 — with GitHub Actions Failure
@xinyual xinyual had a problem deploying to ml-commons-cicd-env November 12, 2024 07:14 — with GitHub Actions Failure
@xinyual xinyual marked this pull request as ready for review November 12, 2024 07:15
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 9, 2024 06:49 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 9, 2024 06:53 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 9, 2024 06:53 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 9, 2024 07:49 — with GitHub Actions Inactive
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 13, 2024 08:45 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 13, 2024 08:45 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 13, 2024 09:42 — with GitHub Actions Inactive
@@ -32,7 +32,7 @@
*/
@Log4j2
@ToolAnnotation(AgentTool.TYPE)
public class AgentTool implements Tool {
public class AgentTool implements WithoutModelTool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would like to think the other way. Regardless of having model, any tool developer can extend the Tool interface. So let's not change the Tool interface. Instead we can extend the Tool interface to ToolWithModel which can have this extra method and the tools which aren't using models can implement Tool and the tools which are using models can implement ToolWithModel interface?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, Please check it. Also with the logic in AgentModelSearcher to construct query.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I have concern. For this, we should make sure when a new tool with mlmodel is developed, it needs to implement ToolWithModel but not Tool. It's a requirement for code review and it's more like a soft rule. So I'm afraid in the future it may skip this logic if we code reviewers miss this.

@xinyual xinyual had a problem deploying to ml-commons-cicd-env December 16, 2024 03:20 — with GitHub Actions Failure
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 16, 2024 03:20 — with GitHub Actions Inactive
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 17, 2024 11:21 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 17, 2024 11:21 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 17, 2024 12:18 — with GitHub Actions Inactive
Signed-off-by: xinyual <[email protected]>
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 19, 2024 02:10 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 19, 2024 02:10 — with GitHub Actions Inactive
@xinyual xinyual temporarily deployed to ml-commons-cicd-env December 19, 2024 03:07 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants