-
Notifications
You must be signed in to change notification settings - Fork 350
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
Endpoint.undeploy_all() has an edge case where it doesn't undeploy all models #1441
Comments
I was just going to post but I see someone else found this bug. This is indeed a bug.
The problematic code is here:
|
I believe the fix is to replace:
with
|
@rosiezou The PR you mention doesn't fix the underlying bug in the SDK. That was just a workaround as the SDK was not working. |
#1441 PiperOrigin-RevId: 499322703
#1441 PiperOrigin-RevId: 499322703
#1441 PiperOrigin-RevId: 499322703
#1441 PiperOrigin-RevId: 500253890
googleapis#1441 PiperOrigin-RevId: 500253890
@jaycee-li I'm pretty sure this is still a bug. Can you double-check? Happy to chat offline. |
The issue is resolved per offline discussion. |
https://github.com/googleapis/python-aiplatform/blob/main/google/cloud/aiplatform/models.py#L1567 finds the model ids to undeploy by looking at the traffic_split.keys()
It is possible to get into a state where an Endpoint has a deployed model with no traffic split. In that state, the model id will not appear in traffic_split.keys(). undeploy_all will return successfully, but Endpoint.delete() will fail because models without traffic split are still deployed to the endpoint.
A better approach would be to use something like [m.id for m in endpoint.list_models()] to get the list of keys. Perhaps it would be [m.id for m in self._gca_resource.list_models()], but I'm not sure.
The text was updated successfully, but these errors were encountered: