00418a2834
Retire "sidecar" for the consolidated per-host path (PRD 0070 naming decision): the orchestrator is the umbrella/control plane, and the egress/git/supervise data-plane unit it runs is the "gateway". - git mv sidecar.py -> gateway.py and the two integration + one unit test files; DockerSidecar->DockerGateway, Sidecar->Gateway, SidecarError->GatewayError, SIDECAR_*->GATEWAY_*, ensure_sidecar-> ensure_gateway, sidecar_status->gateway_status, container name bot-bottle-orch-sidecar->bot-bottle-orch-gateway. - Prose rename across broker/registry/egress/policy_resolver + PRD 0070. - Preserved: the image name bot-bottle-sidecars, the BOT_BOTTLE_SIDECAR_IMAGE env var, Dockerfile.sidecars, and PRD 0069's own stage-name cross-references (that doc still uses "sidecar"). No behavior change. Full unit suite green (1679 tests; the 13 test_sidecar_init /bin/sleep errors are pre-existing NixOS-local noise). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WBMWTEtQdJ4W5UrWuLHCck
65 lines
2.3 KiB
Python
65 lines
2.3 KiB
Python
"""Per-host orchestrator service (PRD 0070).
|
|
|
|
A single persistent per-host service that will run the gateway functions
|
|
(egress / git-gate / supervise), coordinate with the console, and broker
|
|
agent launches. This package is being built bottom-up, starting with the
|
|
backend-neutral "consolidation core" that needs no VM packaging:
|
|
|
|
* `registry` — the SQLite runtime-state store + fail-closed
|
|
attribution (source IP + per-bottle identity token).
|
|
* `broker` — the signed, structured launch-request contract + a
|
|
`LaunchBroker` (stub for the harness) that verifies
|
|
provenance before acting.
|
|
* `gateway` — the consolidated per-host gateway: a `Gateway`
|
|
lifecycle contract (idempotent singleton) + a
|
|
`DockerGateway` impl. One gateway shared by all
|
|
bottles instead of one per bottle.
|
|
* `service` — the `Orchestrator`: owns the registry, brokers the
|
|
launch lifecycle (launch/teardown), manages the
|
|
shared gateway, attributes.
|
|
* `control_plane` — the HTTP control-plane RPC (launch / teardown /
|
|
list / attribute / gateway / health).
|
|
|
|
The actual backend-native launch (a real docker/firecracker broker) and
|
|
the egress/git/supervise data plane land in later slices once this core is
|
|
proven (see the PRD sequencing: plain-process dev-harness -> docker
|
|
orchestrator -> firecracker).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from .registry import BottleRecord, RegistryStore, new_identity_token
|
|
from .broker import (
|
|
BrokerAuthError,
|
|
LaunchBroker,
|
|
LaunchRequest,
|
|
StubBroker,
|
|
sign_request,
|
|
verify_request,
|
|
)
|
|
from .docker_broker import DockerBroker, DockerBrokerError
|
|
from .gateway import DockerGateway, Gateway, GatewayError
|
|
from .service import Orchestrator
|
|
from .control_plane import ControlPlaneServer, dispatch, make_server
|
|
|
|
__all__ = [
|
|
"BottleRecord",
|
|
"RegistryStore",
|
|
"new_identity_token",
|
|
"BrokerAuthError",
|
|
"LaunchBroker",
|
|
"LaunchRequest",
|
|
"StubBroker",
|
|
"DockerBroker",
|
|
"DockerBrokerError",
|
|
"Gateway",
|
|
"DockerGateway",
|
|
"GatewayError",
|
|
"sign_request",
|
|
"verify_request",
|
|
"Orchestrator",
|
|
"ControlPlaneServer",
|
|
"dispatch",
|
|
"make_server",
|
|
]
|