-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathblue_green.py
More file actions
32 lines (24 loc) · 1.01 KB
/
blue_green.py
File metadata and controls
32 lines (24 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Blue-green deployment strategy evaluation for a single deployment cycle (BEP-1049).
Provisions a full set of new-revision routes, validates them, then atomically
switches traffic from the old revision to the new one.
"""
from __future__ import annotations
from collections.abc import Sequence
from typing import override
from ai.backend.manager.data.deployment.types import (
DeploymentInfo,
RouteInfo,
)
from ai.backend.manager.models.deployment_policy import DeploymentStrategySpec
from .types import AbstractDeploymentStrategy, StrategyCycleResult
class BlueGreenStrategy(AbstractDeploymentStrategy):
"""Blue-green deployment strategy FSM."""
@override
def evaluate_cycle(
self,
deployment: DeploymentInfo,
routes: Sequence[RouteInfo],
spec: DeploymentStrategySpec,
) -> StrategyCycleResult:
"""Evaluate one cycle of blue-green deployment for a single deployment."""
raise NotImplementedError("Blue-green deployment strategy is not yet implemented")