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

handle update endpoint errors #414

Merged
merged 5 commits into from
Dec 28, 2023

Conversation

saiatmakuri
Copy link
Contributor

@saiatmakuri saiatmakuri commented Dec 26, 2023

Pull Request Summary

  • throw a 400 for ObjectHasInvalidValueException and EndpointResourceInvalidRequestException for update model endpoint route
  • capture EndpointInfraStateNotFound as an explicit 500

Test Plan and Usage Guide

update unit tests

@saiatmakuri saiatmakuri added the bug Something isn't working label Dec 26, 2023
@saiatmakuri saiatmakuri self-assigned this Dec 26, 2023
@saiatmakuri saiatmakuri marked this pull request as ready for review December 27, 2023 03:51
@@ -362,13 +362,22 @@ async def execute(
# infra_state to make sure that after the update, all resources are valid and in sync.
# E.g. If user only want to update gpus and leave gpu_type as None, we use the existing gpu_type
# from infra_state to avoid passing in None to validate_resource_requests.
raw_request = request.dict(exclude_unset=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good Catch here. I'm guessing the bug here was that pydantic fields with non-falsey defaults were evaluating as being set by the user even if they were not explicitly set in the request?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, primarily that a user could not specify None for fields for which it's allowed, ie gpu_type

@saiatmakuri saiatmakuri merged commit d0061f2 into main Dec 28, 2023
5 checks passed
@saiatmakuri saiatmakuri deleted the saiatmakuri/handle-update-endpoint-errors branch December 28, 2023 07:45
@yunfeng-scale yunfeng-scale mentioned this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants