refactor(backend): rename teardown_consolidated -> deprovision_consolidated
The backends' public teardown entry point now pairs with `launch_consolidated` under the provision/deprovision verb used everywhere else (`deprovision_bottle`, `deprovision_git_gate`). Renamed across all three backends' consolidated_launch + launch modules and the tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -168,7 +168,7 @@ def launch_consolidated(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def teardown_consolidated(
|
def deprovision_consolidated(
|
||||||
bottle_id: str, *, orchestrator_url: str, infra_name: str = INFRA_NAME,
|
bottle_id: str, *, orchestrator_url: str, infra_name: str = INFRA_NAME,
|
||||||
timeout: float | None = None,
|
timeout: float | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
@@ -180,6 +180,6 @@ def teardown_consolidated(
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"LaunchContext",
|
"LaunchContext",
|
||||||
"launch_consolidated",
|
"launch_consolidated",
|
||||||
"teardown_consolidated",
|
"deprovision_consolidated",
|
||||||
"ConsolidatedLaunchError",
|
"ConsolidatedLaunchError",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ from .compose import (
|
|||||||
)
|
)
|
||||||
from .consolidated_compose import consolidated_agent_compose
|
from .consolidated_compose import consolidated_agent_compose
|
||||||
from ...orchestrator.store.config_store import resolve_teardown_timeout
|
from ...orchestrator.store.config_store import resolve_teardown_timeout
|
||||||
from .consolidated_launch import launch_consolidated, teardown_consolidated
|
from .consolidated_launch import launch_consolidated, deprovision_consolidated
|
||||||
from .infra import INFRA_NAME
|
from .infra import INFRA_NAME
|
||||||
from .gateway import DockerGateway
|
from .gateway import DockerGateway
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ def launch(
|
|||||||
plan.egress_plan, git_gate_plan, image_ref=plan.image, tokens=token_values,
|
plan.egress_plan, git_gate_plan, image_ref=plan.image, tokens=token_values,
|
||||||
)
|
)
|
||||||
stack.callback(
|
stack.callback(
|
||||||
teardown_consolidated, ctx.bottle_id,
|
deprovision_consolidated, ctx.bottle_id,
|
||||||
orchestrator_url=ctx.orchestrator_url,
|
orchestrator_url=ctx.orchestrator_url,
|
||||||
timeout=teardown_timeout,
|
timeout=teardown_timeout,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ def launch_consolidated(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def teardown_consolidated(
|
def deprovision_consolidated(
|
||||||
bottle_id: str, *, orchestrator_url: str, timeout: float | None = None,
|
bottle_id: str, *, orchestrator_url: str, timeout: float | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Deregister the bottle and remove its git-gate state from the gateway
|
"""Deregister the bottle and remove its git-gate state from the gateway
|
||||||
@@ -160,7 +160,7 @@ def teardown_consolidated(
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"LaunchContext",
|
"LaunchContext",
|
||||||
"launch_consolidated",
|
"launch_consolidated",
|
||||||
"teardown_consolidated",
|
"deprovision_consolidated",
|
||||||
"ConsolidatedLaunchError",
|
"ConsolidatedLaunchError",
|
||||||
"OrchestratorStartError",
|
"OrchestratorStartError",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
|||||||
from .consolidated_launch import (
|
from .consolidated_launch import (
|
||||||
launch_consolidated,
|
launch_consolidated,
|
||||||
persist_env_var_secret,
|
persist_env_var_secret,
|
||||||
teardown_consolidated,
|
deprovision_consolidated,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ def launch(
|
|||||||
tokens=token_values,
|
tokens=token_values,
|
||||||
)
|
)
|
||||||
stack.callback(
|
stack.callback(
|
||||||
teardown_consolidated, ctx.bottle_id,
|
deprovision_consolidated, ctx.bottle_id,
|
||||||
orchestrator_url=ctx.orchestrator_url,
|
orchestrator_url=ctx.orchestrator_url,
|
||||||
timeout=teardown_timeout,
|
timeout=teardown_timeout,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ def register_agent(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def teardown_consolidated(
|
def deprovision_consolidated(
|
||||||
bottle_id: str, *, orchestrator_url: str, timeout: float | None = None,
|
bottle_id: str, *, orchestrator_url: str, timeout: float | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Deregister the bottle and remove its git-gate state from the gateway.
|
"""Deregister the bottle and remove its git-gate state from the gateway.
|
||||||
@@ -200,7 +200,7 @@ __all__ = [
|
|||||||
"ensure_gateway",
|
"ensure_gateway",
|
||||||
"live_source_ips",
|
"live_source_ips",
|
||||||
"register_agent",
|
"register_agent",
|
||||||
"teardown_consolidated",
|
"deprovision_consolidated",
|
||||||
"ConsolidatedLaunchError",
|
"ConsolidatedLaunchError",
|
||||||
"OrchestratorStartError",
|
"OrchestratorStartError",
|
||||||
"GATEWAY_NETWORK",
|
"GATEWAY_NETWORK",
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ from .consolidated_launch import (
|
|||||||
GatewayEndpoint,
|
GatewayEndpoint,
|
||||||
ensure_gateway,
|
ensure_gateway,
|
||||||
register_agent,
|
register_agent,
|
||||||
teardown_consolidated,
|
deprovision_consolidated,
|
||||||
)
|
)
|
||||||
|
|
||||||
_REPO_DIR = str(Path(__file__).resolve().parent.parent.parent.parent)
|
_REPO_DIR = str(Path(__file__).resolve().parent.parent.parent.parent)
|
||||||
@@ -202,7 +202,7 @@ def launch(
|
|||||||
env_var_secret=plan.env_var_secret,
|
env_var_secret=plan.env_var_secret,
|
||||||
)
|
)
|
||||||
stack.callback(
|
stack.callback(
|
||||||
teardown_consolidated, ctx.bottle_id,
|
deprovision_consolidated, ctx.bottle_id,
|
||||||
orchestrator_url=ctx.orchestrator_url,
|
orchestrator_url=ctx.orchestrator_url,
|
||||||
timeout=teardown_timeout,
|
timeout=teardown_timeout,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from unittest.mock import MagicMock, Mock, patch
|
|||||||
|
|
||||||
from bot_bottle.backend.docker.consolidated_launch import (
|
from bot_bottle.backend.docker.consolidated_launch import (
|
||||||
launch_consolidated,
|
launch_consolidated,
|
||||||
teardown_consolidated,
|
deprovision_consolidated,
|
||||||
)
|
)
|
||||||
from bot_bottle.egress import EgressPlan, EgressRoute
|
from bot_bottle.egress import EgressPlan, EgressRoute
|
||||||
from bot_bottle.git_gate import GitGatePlan
|
from bot_bottle.git_gate import GitGatePlan
|
||||||
@@ -91,7 +91,7 @@ class TestTeardownConsolidated(unittest.TestCase):
|
|||||||
client = Mock()
|
client = Mock()
|
||||||
with patch(f"{_UTIL}.OrchestratorClient", return_value=client), \
|
with patch(f"{_UTIL}.OrchestratorClient", return_value=client), \
|
||||||
patch(f"{_UTIL}.deprovision_git_gate") as deprov:
|
patch(f"{_UTIL}.deprovision_git_gate") as deprov:
|
||||||
teardown_consolidated("b1", orchestrator_url="http://orch:8080")
|
deprovision_consolidated("b1", orchestrator_url="http://orch:8080")
|
||||||
client.teardown_bottle.assert_called_once_with("b1")
|
client.teardown_bottle.assert_called_once_with("b1")
|
||||||
deprov.assert_called_once()
|
deprov.assert_called_once()
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class TestLaunchCommittedImage(unittest.TestCase):
|
|||||||
mock.patch.object(launch_mod.docker_mod, "verify_agent_image"), \
|
mock.patch.object(launch_mod.docker_mod, "verify_agent_image"), \
|
||||||
mock.patch.object(launch_mod.docker_mod, "image_created_at"), \
|
mock.patch.object(launch_mod.docker_mod, "image_created_at"), \
|
||||||
mock.patch.object(launch_mod, "launch_consolidated", return_value=_CTX), \
|
mock.patch.object(launch_mod, "launch_consolidated", return_value=_CTX), \
|
||||||
mock.patch.object(launch_mod, "teardown_consolidated"), \
|
mock.patch.object(launch_mod, "deprovision_consolidated"), \
|
||||||
mock.patch.object(launch_mod, "DockerGateway", return_value=gw), \
|
mock.patch.object(launch_mod, "DockerGateway", return_value=gw), \
|
||||||
mock.patch.object(launch_mod, "consolidated_agent_compose", side_effect=compose), \
|
mock.patch.object(launch_mod, "consolidated_agent_compose", side_effect=compose), \
|
||||||
mock.patch.object(launch_mod, "write_compose_file", return_value=Path("/tmp/c.yml")), \
|
mock.patch.object(launch_mod, "write_compose_file", return_value=Path("/tmp/c.yml")), \
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class TestTeardownWarning(unittest.TestCase):
|
|||||||
with mock.patch.object(launch_mod.docker_mod, "build_image"), \
|
with mock.patch.object(launch_mod.docker_mod, "build_image"), \
|
||||||
mock.patch.object(launch_mod.docker_mod, "verify_agent_image"), \
|
mock.patch.object(launch_mod.docker_mod, "verify_agent_image"), \
|
||||||
mock.patch.object(launch_mod, "launch_consolidated", return_value=ctx), \
|
mock.patch.object(launch_mod, "launch_consolidated", return_value=ctx), \
|
||||||
mock.patch.object(launch_mod, "teardown_consolidated"), \
|
mock.patch.object(launch_mod, "deprovision_consolidated"), \
|
||||||
mock.patch.object(launch_mod, "DockerGateway", return_value=gw), \
|
mock.patch.object(launch_mod, "DockerGateway", return_value=gw), \
|
||||||
mock.patch.object(
|
mock.patch.object(
|
||||||
launch_mod, "consolidated_agent_compose",
|
launch_mod, "consolidated_agent_compose",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from bot_bottle.backend.macos_container.consolidated_launch import (
|
|||||||
GatewayEndpoint,
|
GatewayEndpoint,
|
||||||
ensure_gateway,
|
ensure_gateway,
|
||||||
register_agent,
|
register_agent,
|
||||||
teardown_consolidated,
|
deprovision_consolidated,
|
||||||
)
|
)
|
||||||
from bot_bottle.egress import EgressPlan, EgressRoute
|
from bot_bottle.egress import EgressPlan, EgressRoute
|
||||||
from bot_bottle.git_gate import GitGatePlan
|
from bot_bottle.git_gate import GitGatePlan
|
||||||
@@ -129,7 +129,7 @@ class TestTeardown(unittest.TestCase):
|
|||||||
deprovision = Mock()
|
deprovision = Mock()
|
||||||
with patch(f"{_UTIL}.OrchestratorClient", return_value=client), \
|
with patch(f"{_UTIL}.OrchestratorClient", return_value=client), \
|
||||||
patch(f"{_UTIL}.deprovision_git_gate", deprovision):
|
patch(f"{_UTIL}.deprovision_git_gate", deprovision):
|
||||||
teardown_consolidated("b1", orchestrator_url="http://o:8099")
|
deprovision_consolidated("b1", orchestrator_url="http://o:8099")
|
||||||
client.teardown_bottle.assert_called_once_with("b1")
|
client.teardown_bottle.assert_called_once_with("b1")
|
||||||
self.assertEqual("b1", deprovision.call_args.args[1])
|
self.assertEqual("b1", deprovision.call_args.args[1])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user