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

chore: Revert response type of service create API #1979

Merged
merged 3 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1979.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Revert response type of service create API.
14 changes: 11 additions & 3 deletions src/ai/backend/manager/api/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ async def _validate(request: web.Request, params: NewServiceRequestModel) -> Val
@auth_required
@server_status_required(ALL_ALLOWED)
@pydantic_params_api_handler(NewServiceRequestModel)
async def create(request: web.Request, params: NewServiceRequestModel) -> SuccessResponseModel:
async def create(request: web.Request, params: NewServiceRequestModel) -> ServeInfoModel:
"""
Creates a new model service. If `desired_session_count` is greater than zero,
then inference sessions will be automatically scheduled upon successful creation of model service.
Expand Down Expand Up @@ -587,9 +587,17 @@ async def create(request: web.Request, params: NewServiceRequestModel) -> Succes
open_to_public=params.open_to_public,
)
db_sess.add(endpoint)
await db_sess.commit()
await db_sess.flush()
endpoint_id = endpoint.id

return SuccessResponseModel()
return ServeInfoModel(
endpoint_id=endpoint_id,
name=params.service_name,
desired_session_count=params.desired_session_count,
active_routes=[],
service_endpoint=None,
is_public=params.open_to_public,
)


class TryStartResponseModel(BaseModel):
Expand Down
Loading