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

Cannot clean up model registry, after undeploy (and gratitious sleep) #2807

Closed
cjmcgraw opened this issue Oct 12, 2023 · 1 comment
Closed
Assignees
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.

Comments

@cjmcgraw
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version:
  • Python version: python --version
  • pip version: pip --version
  • google-cloud-aiplatform version: pip show google-cloud-aiplatform

Steps to reproduce

  1. Deploy model to endpoint with SDK
  2. Undeploy model from endpoint and then delete

Code example

old_model_id = ...
print("undeploying model")
endpoint.undeploy(
    deployed_model_id=deployed_model.id,
    sync=True
)
print("successfully undeployed model!")
print("waiting for undeployed model to release resources")
time.sleep(60)
print("deleting model version", old_model_id)
model = aiplatform.Model(old_model_id)
model.wait()
model.delete(sync=True)
print("finished deleting model", old_model_id)

Stack trace

google.api_core.exceptions.FailedPrecondition: 400 The model "<...>" can't be deleted because it's deployed or being deployed at the following endpoint(s): <...> Undeploy the model from all endpoints first and then delete it

Unsure if this is because of some caching layer or something?

@product-auto-label product-auto-label bot added the api: vertex-ai Issues related to the googleapis/python-aiplatform API. label Oct 13, 2023
@sasha-gitg sasha-gitg self-assigned this Oct 13, 2023
@sasha-gitg
Copy link
Member

Please confirm the endpoint referenced in the exception, <...> Undeploy the model from all endpoints first and then delete it, is the same resource as the referenced Endpoint when undeploying earlier in the code block.

If it is, check that the Model hasn't been deployed multiple times to the same Endpoint. Endpoint.list_models()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.
Projects
None yet
Development

No branches or pull requests

2 participants