chore(backend): drop dead code left by the InfraService refactor
Remove symbols with no remaining consumer: - `gateway_name` property on Docker/MacosInfraService — nothing uses it; the launch flow reads `gateway().name` off the Gateway service. (+ its docker test.) - firecracker `infra_vm` EGRESS_PORT / SUPERVISE_PORT / GIT_HTTP_PORT — dead duplicates; launch.py uses supervisor.types / docker.egress / a local const. - macOS `INFRA_DB_VOLUME` back-compat alias — unused since the DB-volume test moved to `ORCHESTRATOR_DB_VOLUME`. - docker `infra.py`: the unused `ORCHESTRATOR_SOURCE_HASH_LABEL` import and the `__all__` re-exports of the orchestrator constants (consumers import them from `docker.orchestrator`, not `docker.infra`). - macOS `infra.py`: the unused `GatewayError` import + re-export. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,6 @@ from .orchestrator import (
|
|||||||
ORCHESTRATOR_LABEL,
|
ORCHESTRATOR_LABEL,
|
||||||
ORCHESTRATOR_NAME,
|
ORCHESTRATOR_NAME,
|
||||||
ORCHESTRATOR_NETWORK,
|
ORCHESTRATOR_NETWORK,
|
||||||
ORCHESTRATOR_SOURCE_HASH_LABEL,
|
|
||||||
)
|
)
|
||||||
from ...paths import bot_bottle_root
|
from ...paths import bot_bottle_root
|
||||||
from ...gateway import (
|
from ...gateway import (
|
||||||
@@ -86,12 +85,6 @@ class DockerInfraService(InfraService):
|
|||||||
self._orchestrator_label = orchestrator_label
|
self._orchestrator_label = orchestrator_label
|
||||||
self._gateway_name = gateway_name
|
self._gateway_name = gateway_name
|
||||||
|
|
||||||
@property
|
|
||||||
def gateway_name(self) -> str:
|
|
||||||
"""The gateway container — the address the launch flow attributes agents
|
|
||||||
against (gateway IP, git-gate provisioning transport, CA fetch)."""
|
|
||||||
return self._gateway_name
|
|
||||||
|
|
||||||
def orchestrator(self) -> DockerOrchestrator:
|
def orchestrator(self) -> DockerOrchestrator:
|
||||||
"""The control-plane service. Cheap to reconstruct — `ensure_built`
|
"""The control-plane service. Cheap to reconstruct — `ensure_built`
|
||||||
builds its image, `ensure_running` brings it up, and the launch flow
|
builds its image, `ensure_running` brings it up, and the launch flow
|
||||||
@@ -155,8 +148,5 @@ class DockerInfraService(InfraService):
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"DockerInfraService",
|
"DockerInfraService",
|
||||||
"ORCHESTRATOR_NAME",
|
"ORCHESTRATOR_NAME",
|
||||||
"ORCHESTRATOR_NETWORK",
|
|
||||||
"ORCHESTRATOR_IMAGE",
|
|
||||||
"ORCHESTRATOR_SOURCE_HASH_LABEL",
|
|
||||||
"INFRA_NAME",
|
"INFRA_NAME",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -74,11 +74,6 @@ _ROOTFS_IMAGE = {"orchestrator": _ORCHESTRATOR_FC_IMAGE, "gateway": _GATEWAY_IMA
|
|||||||
_ROOTFS_SLACK_MIB = {"orchestrator": 8192, "gateway": 1024}
|
_ROOTFS_SLACK_MIB = {"orchestrator": 8192, "gateway": 1024}
|
||||||
|
|
||||||
ORCHESTRATOR_PORT = 8099
|
ORCHESTRATOR_PORT = 8099
|
||||||
# Gateway data-plane ports (agent-facing): egress proxy, supervise MCP,
|
|
||||||
# git-http. Reached by agent VMs via the PREROUTING DNAT to the gateway VM.
|
|
||||||
EGRESS_PORT = 9099
|
|
||||||
SUPERVISE_PORT = 9100
|
|
||||||
GIT_HTTP_PORT = 9420
|
|
||||||
|
|
||||||
# The infra VMs make direct upstream connections (gateway egress, and buildah
|
# The infra VMs make direct upstream connections (gateway egress, and buildah
|
||||||
# during builds), and the kernel `ip=` cmdline sets no resolver. Public for
|
# during builds), and the kernel `ip=` cmdline sets no resolver. Public for
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ from .gateway import (
|
|||||||
GATEWAY_IMAGE,
|
GATEWAY_IMAGE,
|
||||||
GATEWAY_NAME,
|
GATEWAY_NAME,
|
||||||
GATEWAY_NETWORK,
|
GATEWAY_NETWORK,
|
||||||
GatewayError,
|
|
||||||
MacosGateway,
|
MacosGateway,
|
||||||
ensure_networks,
|
ensure_networks,
|
||||||
)
|
)
|
||||||
@@ -53,8 +52,6 @@ from .orchestrator import (
|
|||||||
# `INFRA_NAME` is kept — now aliasing the gateway container — for callers that
|
# `INFRA_NAME` is kept — now aliasing the gateway container — for callers that
|
||||||
# still import it (probe / reprovision attribute against the gateway).
|
# still import it (probe / reprovision attribute against the gateway).
|
||||||
INFRA_NAME = GATEWAY_NAME
|
INFRA_NAME = GATEWAY_NAME
|
||||||
# Back-compat alias: the DB volume moved to the orchestrator module.
|
|
||||||
INFRA_DB_VOLUME = ORCHESTRATOR_DB_VOLUME
|
|
||||||
|
|
||||||
_REPO_ROOT = Path(__file__).resolve().parents[3]
|
_REPO_ROOT = Path(__file__).resolve().parents[3]
|
||||||
|
|
||||||
@@ -89,10 +86,6 @@ class MacosInfraService(InfraService):
|
|||||||
self._gateway_name = gateway_name
|
self._gateway_name = gateway_name
|
||||||
self._db_volume = db_volume
|
self._db_volume = db_volume
|
||||||
|
|
||||||
@property
|
|
||||||
def gateway_name(self) -> str:
|
|
||||||
return self._gateway_name
|
|
||||||
|
|
||||||
def orchestrator(self) -> MacosOrchestrator:
|
def orchestrator(self) -> MacosOrchestrator:
|
||||||
"""The control-plane service on the host-only control network. Cheap to
|
"""The control-plane service on the host-only control network. Cheap to
|
||||||
reconstruct — the launch flow reads its `url()` / `gateway_url()` /
|
reconstruct — the launch flow reads its `url()` / `gateway_url()` /
|
||||||
@@ -162,9 +155,7 @@ class MacosInfraService(InfraService):
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"MacosInfraService",
|
"MacosInfraService",
|
||||||
"OrchestratorStartError",
|
"OrchestratorStartError",
|
||||||
"GatewayError",
|
|
||||||
"ORCHESTRATOR_NAME",
|
"ORCHESTRATOR_NAME",
|
||||||
"INFRA_NAME",
|
"INFRA_NAME",
|
||||||
"INFRA_DB_VOLUME",
|
|
||||||
"probe_orchestrator_url",
|
"probe_orchestrator_url",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ class TestDockerInfraService(unittest.TestCase):
|
|||||||
p.start()
|
p.start()
|
||||||
self.addCleanup(p.stop)
|
self.addCleanup(p.stop)
|
||||||
|
|
||||||
def test_gateway_name(self) -> None:
|
|
||||||
self.assertEqual(GATEWAY_NAME, self.svc.gateway_name)
|
|
||||||
|
|
||||||
def test_url_delegates_to_the_orchestrator(self) -> None:
|
def test_url_delegates_to_the_orchestrator(self) -> None:
|
||||||
self.assertEqual("http://127.0.0.1:8099", self.svc.url())
|
self.assertEqual("http://127.0.0.1:8099", self.svc.url())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user