Skip to content

Commit 10ddb6b

Browse files
committed
wip
1 parent 8b7deee commit 10ddb6b

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/ai/backend/manager/repositories/deployment/db_source/db_source.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
from ai.backend.common.data.endpoint.types import EndpointLifecycle
2121
from ai.backend.common.data.permission.types import RBACElementType
2222
from ai.backend.common.exception import DeploymentNameAlreadyExists
23-
from ai.backend.logging import BraceStyleAdapter
24-
25-
log = BraceStyleAdapter(logging.getLogger(__name__))
2623
from ai.backend.common.types import (
2724
MODEL_SERVICE_RUNTIME_PROFILES,
2825
AccessKey,
2926
KernelId,
3027
RuntimeVariant,
3128
SessionId,
3229
)
30+
from ai.backend.logging import BraceStyleAdapter
3331
from ai.backend.manager.data.agent.types import AgentStatus
3432
from ai.backend.manager.data.deployment.creator import DeploymentPolicyConfig
3533
from ai.backend.manager.data.deployment.scale import (
@@ -155,6 +153,8 @@
155153
)
156154
from ai.backend.manager.utils import query_userinfo_from_session
157155

156+
log = BraceStyleAdapter(logging.getLogger(__name__))
157+
158158

159159
@dataclass
160160
class EndpointWithRoutesRawData:
@@ -2544,8 +2544,7 @@ async def apply_strategy_mutations(
25442544
async with self._begin_session_read_committed() as db_sess:
25452545
await self._create_routes(db_sess, rollout)
25462546
await self._drain_routes(db_sess, drain)
2547-
swapped = await self._complete_deployment_revision_swap(db_sess, completed_ids)
2548-
return swapped
2547+
return await self._complete_deployment_revision_swap(db_sess, completed_ids)
25492548

25502549
@staticmethod
25512550
async def _create_routes(

src/ai/backend/manager/sokovan/deployment/strategy/rolling_update.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,7 @@ def _compute_routes_to_terminate(
246246
"""
247247
available_count = len(classified.new_healthy) + len(classified.old_active)
248248
can_terminate = available_count - min_available
249-
to_terminate = max(
250-
0, min(can_terminate, len(classified.old_active))
251-
) # clamp to actual old count
252-
253-
return to_terminate
249+
return max(0, min(can_terminate, len(classified.old_active))) # clamp to actual old count
254250

255251

256252
def _build_route_creators(

0 commit comments

Comments
 (0)