refactor(backend): verb-first names for the provisioning modules
Rename the module files to match their functions' verb-first names: `bottle_provision.py` -> `provision_bottle.py`, `gateway_provision.py` -> `provision_gateway.py` (and the test file to match). Imports, docstrings, and the git_gate/service.py pointer updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ from ...gateway import GATEWAY_NETWORK
|
|||||||
from .infra import INFRA_NAME, DockerInfraService
|
from .infra import INFRA_NAME, DockerInfraService
|
||||||
from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
||||||
from ...orchestrator.reprovision import reprovision_bottles
|
from ...orchestrator.reprovision import reprovision_bottles
|
||||||
from ..bottle_provision import deprovision_bottle, provision_bottle
|
from ..provision_bottle import deprovision_bottle, provision_bottle
|
||||||
from .gateway_transport import DockerGatewayTransport
|
from .gateway_transport import DockerGatewayTransport
|
||||||
from .gateway_net import next_free_ip
|
from .gateway_net import next_free_ip
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
How the launcher stages files + runs commands in the running gateway container:
|
How the launcher stages files + runs commands in the running gateway container:
|
||||||
`docker exec` / `docker cp` over the docker socket. The backend-neutral
|
`docker exec` / `docker cp` over the docker socket. The backend-neutral
|
||||||
provisioning logic that drives it lives in `backend.gateway_provision`.
|
provisioning logic that drives it lives in `backend.provision_gateway`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ from ...orchestrator.lifecycle import (
|
|||||||
)
|
)
|
||||||
from ...orchestrator.reprovision import reprovision_bottles
|
from ...orchestrator.reprovision import reprovision_bottles
|
||||||
from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
||||||
from ..bottle_provision import deprovision_bottle, provision_bottle
|
from ..provision_bottle import deprovision_bottle, provision_bottle
|
||||||
from . import cleanup, infra_vm, util
|
from . import cleanup, infra_vm, util
|
||||||
from .gateway import FirecrackerGateway
|
from .gateway import FirecrackerGateway
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
How the launcher stages files + runs commands in the running gateway: the
|
How the launcher stages files + runs commands in the running gateway: the
|
||||||
docker exec/cp equivalents over SSH (dropbear + the stable infra key). The
|
docker exec/cp equivalents over SSH (dropbear + the stable infra key). The
|
||||||
backend-neutral provisioning logic that drives it lives in
|
backend-neutral provisioning logic that drives it lives in
|
||||||
`backend.gateway_provision`.
|
`backend.provision_gateway`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ from ...log import info
|
|||||||
from ...orchestrator.client import OrchestratorClient, OrchestratorClientError
|
from ...orchestrator.client import OrchestratorClient, OrchestratorClientError
|
||||||
from ...orchestrator.reprovision import reprovision_bottles
|
from ...orchestrator.reprovision import reprovision_bottles
|
||||||
from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
from ...orchestrator.store.secret_store import ENV_VAR_SECRET_NAME
|
||||||
from ..bottle_provision import deprovision_bottle, provision_bottle
|
from ..provision_bottle import deprovision_bottle, provision_bottle
|
||||||
from . import util as container_mod
|
from . import util as container_mod
|
||||||
from .enumerate import CONTAINER_NAME_PREFIX, EnumerationError, enumerate_active
|
from .enumerate import CONTAINER_NAME_PREFIX, EnumerationError, enumerate_active
|
||||||
from .gateway import GATEWAY_NETWORK
|
from .gateway import GATEWAY_NETWORK
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
How the launcher stages files + runs commands in the running gateway container:
|
How the launcher stages files + runs commands in the running gateway container:
|
||||||
the `container` CLI's exec/cp equivalents. The backend-neutral provisioning
|
the `container` CLI's exec/cp equivalents. The backend-neutral provisioning
|
||||||
logic that drives it lives in `backend.gateway_provision`; Docker uses
|
logic that drives it lives in `backend.provision_gateway`; Docker uses
|
||||||
`docker exec`/`docker cp` and Firecracker uses SSH.
|
`docker exec`/`docker cp` and Firecracker uses SSH.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Register a bottle with the orchestrator and provision its git-gate state into
|
|||||||
the shared gateway (`provision_bottle`), and the inverse teardown
|
the shared gateway (`provision_bottle`), and the inverse teardown
|
||||||
(`deprovision_bottle`). Backend-neutral — each backend's consolidated_launch
|
(`deprovision_bottle`). Backend-neutral — each backend's consolidated_launch
|
||||||
drives these through its own `GatewayTransport` rather than re-implementing
|
drives these through its own `GatewayTransport` rather than re-implementing
|
||||||
them. The git-gate half of the work lives in `gateway_provision`.
|
them. The git-gate half of the work lives in `provision_gateway`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -16,7 +16,7 @@ from ..git_gate import GitGatePlan
|
|||||||
from ..orchestrator.client import OrchestratorClient, RegisteredBottle
|
from ..orchestrator.client import OrchestratorClient, RegisteredBottle
|
||||||
from ..orchestrator.registration import registration_inputs
|
from ..orchestrator.registration import registration_inputs
|
||||||
from ..orchestrator.store.secret_store import new_env_var_secret
|
from ..orchestrator.store.secret_store import new_env_var_secret
|
||||||
from .gateway_provision import GatewayTransport, deprovision_git_gate, provision_git_gate
|
from .provision_gateway import GatewayTransport, deprovision_git_gate, provision_git_gate
|
||||||
|
|
||||||
|
|
||||||
def provision_bottle(
|
def provision_bottle(
|
||||||
@@ -60,7 +60,7 @@ class GitGate:
|
|||||||
# `sh`, so the script needs the x bit. The gateway copy does not
|
# `sh`, so the script needs the x bit. The gateway copy does not
|
||||||
# necessarily preserve this mode (`docker cp` does, the Apple `container
|
# necessarily preserve this mode (`docker cp` does, the Apple `container
|
||||||
# cp` does not), so provisioning re-applies +x on the gateway side — see
|
# cp` does not), so provisioning re-applies +x on the gateway side — see
|
||||||
# backend/gateway_provision.py.
|
# backend/provision_gateway.py.
|
||||||
access_hook.chmod(0o700)
|
access_hook.chmod(0o700)
|
||||||
upstreams_with_files: list[GitGateUpstream] = []
|
upstreams_with_files: list[GitGateUpstream] = []
|
||||||
for u in upstreams:
|
for u in upstreams:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from bot_bottle.git_gate import GitGatePlan
|
|||||||
from bot_bottle.orchestrator.client import RegisteredBottle
|
from bot_bottle.orchestrator.client import RegisteredBottle
|
||||||
|
|
||||||
_MOD = "bot_bottle.backend.docker.consolidated_launch"
|
_MOD = "bot_bottle.backend.docker.consolidated_launch"
|
||||||
_UTIL = "bot_bottle.backend.bottle_provision"
|
_UTIL = "bot_bottle.backend.provision_bottle"
|
||||||
|
|
||||||
|
|
||||||
def _egress_plan() -> EgressPlan:
|
def _egress_plan() -> EgressPlan:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from bot_bottle.git_gate import GitGatePlan
|
|||||||
from bot_bottle.orchestrator.client import RegisteredBottle
|
from bot_bottle.orchestrator.client import RegisteredBottle
|
||||||
|
|
||||||
_MOD = "bot_bottle.backend.macos_container.consolidated_launch"
|
_MOD = "bot_bottle.backend.macos_container.consolidated_launch"
|
||||||
_UTIL = "bot_bottle.backend.bottle_provision"
|
_UTIL = "bot_bottle.backend.provision_bottle"
|
||||||
|
|
||||||
|
|
||||||
def _egress_plan() -> EgressPlan:
|
def _egress_plan() -> EgressPlan:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import unittest
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import Mock, patch
|
||||||
|
|
||||||
from bot_bottle.backend.gateway_provision import (
|
from bot_bottle.backend.provision_gateway import (
|
||||||
GatewayProvisionError,
|
GatewayProvisionError,
|
||||||
deprovision_git_gate,
|
deprovision_git_gate,
|
||||||
provision_git_gate,
|
provision_git_gate,
|
||||||
Reference in New Issue
Block a user