From 8a869c4ba3778c6f865f110ab97832a2bbdb6e92 Mon Sep 17 00:00:00 2001 From: Kyujin Cho Date: Fri, 14 Feb 2025 19:53:03 +0900 Subject: [PATCH 1/3] fix(BA-660): Model service not destroyed when auto scaling rule is set --- changes/.fix.md | 1 + src/ai/backend/manager/models/endpoint.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changes/.fix.md diff --git a/changes/.fix.md b/changes/.fix.md new file mode 100644 index 00000000000..02aff7e11d8 --- /dev/null +++ b/changes/.fix.md @@ -0,0 +1 @@ +Fix model service not removed when auto scaling rules are set diff --git a/src/ai/backend/manager/models/endpoint.py b/src/ai/backend/manager/models/endpoint.py index 1812605b6b8..0e3a2ad0d0e 100644 --- a/src/ai/backend/manager/models/endpoint.py +++ b/src/ai/backend/manager/models/endpoint.py @@ -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() From 95c617db7405870c427e8b75ebf6ebeef3fdd3a0 Mon Sep 17 00:00:00 2001 From: Kyujin Cho Date: Fri, 14 Feb 2025 11:02:03 +0000 Subject: [PATCH 2/3] docs: Rename the news fragment with the PR number .fix.md -> 3711.fix.md Co-authored-by: octodog --- changes/{.fix.md => 3711.fix.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changes/{.fix.md => 3711.fix.md} (100%) diff --git a/changes/.fix.md b/changes/3711.fix.md similarity index 100% rename from changes/.fix.md rename to changes/3711.fix.md From e933da3ffc83e7702ef8c83361f68d49ddfc6773 Mon Sep 17 00:00:00 2001 From: Kyujin Cho Date: Fri, 14 Feb 2025 11:04:12 +0000 Subject: [PATCH 3/3] chore: update api schema dump Co-authored-by: octodog --- docs/manager/rest-reference/openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manager/rest-reference/openapi.json b/docs/manager/rest-reference/openapi.json index 03b8c65b892..248d84cf02f 100644 --- a/docs/manager/rest-reference/openapi.json +++ b/docs/manager/rest-reference/openapi.json @@ -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",