File tree Expand file tree Collapse file tree
repositories/deployment/db_source
sokovan/deployment/strategy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020from ai .backend .common .data .endpoint .types import EndpointLifecycle
2121from ai .backend .common .data .permission .types import RBACElementType
2222from ai .backend .common .exception import DeploymentNameAlreadyExists
23- from ai .backend .logging import BraceStyleAdapter
24-
25- log = BraceStyleAdapter (logging .getLogger (__name__ ))
2623from 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
3331from ai .backend .manager .data .agent .types import AgentStatus
3432from ai .backend .manager .data .deployment .creator import DeploymentPolicyConfig
3533from ai .backend .manager .data .deployment .scale import (
155153)
156154from ai .backend .manager .utils import query_userinfo_from_session
157155
156+ log = BraceStyleAdapter (logging .getLogger (__name__ ))
157+
158158
159159@dataclass
160160class 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 (
Original file line number Diff line number Diff 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
256252def _build_route_creators (
You can’t perform that action at this time.
0 commit comments