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

fix(BA-660): Model service not destroyed when auto scaling rule is set #3711

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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/3711.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix model service not removed when auto scaling rules are set
2 changes: 1 addition & 1 deletion docs/manager/rest-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Backend.AI Manager API",
"description": "Backend.AI Manager REST API specification",
"version": "25.1.1",
"version": "25.2.0",
"contact": {
"name": "Lablup Inc.",
"url": "https://docs.backend.ai",
Expand Down
11 changes: 10 additions & 1 deletion src/ai/backend/manager/models/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,19 @@ class EndpointAutoScalingRuleRow(Base):
endpoint_row = relationship("EndpointRow", back_populates="endpoint_auto_scaling_rules")

@classmethod
async def list(cls, session: AsyncSession, load_endpoint=False) -> Sequence[Self]:
async def list(
cls,
session: AsyncSession,
load_endpoint=False,
endpoint_status_filter: Container[EndpointLifecycle] = frozenset([
EndpointLifecycle.CREATED
]),
) -> Sequence[Self]:
query = sa.select(EndpointAutoScalingRuleRow)
if load_endpoint:
query = query.options(selectinload(EndpointAutoScalingRuleRow.endpoint_row))
if endpoint_status_filter:
query = query.filter(EndpointRow.lifecycle_stage.in_(endpoint_status_filter))
result = await session.execute(query)
return result.scalars().all()

Expand Down
Loading