refactor(orchestrator): move registry into store/registry_store
tracker-policy-pr / check-pr (pull_request) Successful in 11s
test / integration-docker (pull_request) Successful in 18s
lint / lint (push) Failing after 58s
test / unit (pull_request) Successful in 2m14s
test / integration-firecracker (pull_request) Successful in 3m25s
test / coverage (pull_request) Successful in 35s
test / publish-infra (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Successful in 11s
test / integration-docker (pull_request) Successful in 18s
lint / lint (push) Failing after 58s
test / unit (pull_request) Successful in 2m14s
test / integration-firecracker (pull_request) Successful in 3m25s
test / coverage (pull_request) Successful in 35s
test / publish-infra (pull_request) Has been skipped
registry.py is a SQLite-backed store (its class is already RegistryStore), so it belongs with the other orchestrator-owned stores rather than at the package root. Moved orchestrator/registry.py -> orchestrator/store/ registry_store.py, joining queue_store / secret_store / config_store. Repointed the in-package importers (.registry -> .store.registry_store) and the tests, bumped the moved file's relative-import depths, renamed the test file to match, and listed it in the store package docstring. Full unit suite green (2243). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,7 @@ orchestrator -> firecracker).
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .registry import BottleRecord, RegistryStore, new_identity_token
|
from .store.registry_store import BottleRecord, RegistryStore, new_identity_token
|
||||||
from .broker import (
|
from .broker import (
|
||||||
BrokerAuthError,
|
BrokerAuthError,
|
||||||
LaunchBroker,
|
LaunchBroker,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from .store.store_manager import StoreManager
|
|||||||
from .broker import LaunchBroker, StubBroker
|
from .broker import LaunchBroker, StubBroker
|
||||||
from .server import make_server
|
from .server import make_server
|
||||||
from .docker_broker import DockerBroker
|
from .docker_broker import DockerBroker
|
||||||
from .registry import RegistryStore, default_db_path
|
from .store.registry_store import RegistryStore, default_db_path
|
||||||
from .service import Orchestrator
|
from .service import Orchestrator
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from collections.abc import Iterable
|
|||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
from .broker import LaunchBroker, LaunchRequest, sign_request
|
from .broker import LaunchBroker, LaunchRequest, sign_request
|
||||||
from .registry import DEFAULT_REAP_GRACE_SECONDS, BottleRecord, RegistryStore
|
from .store.registry_store import DEFAULT_REAP_GRACE_SECONDS, BottleRecord, RegistryStore
|
||||||
from .supervisor import (
|
from .supervisor import (
|
||||||
AuditEntry,
|
AuditEntry,
|
||||||
COMPONENT_FOR_TOOL,
|
COMPONENT_FOR_TOOL,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"""Orchestrator-owned SQLite stores.
|
"""Orchestrator-owned SQLite stores.
|
||||||
|
|
||||||
The stores whose tables only the orchestrator (control plane) opens: the
|
The stores whose tables only the orchestrator (control plane) opens: the
|
||||||
supervise proposal/response `queue_store`, the agent-secret `secret_store`, and
|
per-host bottle `registry_store`, the supervise proposal/response `queue_store`,
|
||||||
the orchestrator `config_store`. They build on the shared `DbStore` /
|
the agent-secret `secret_store`, and the orchestrator `config_store`. They build
|
||||||
`migrations` base in `bot_bottle.store`.
|
on the shared `DbStore` / `migrations` base in `bot_bottle.store`.
|
||||||
|
|
||||||
Callers import the concrete module directly, e.g.
|
Callers import the concrete module directly, e.g.
|
||||||
`from bot_bottle.orchestrator.store.queue_store import QueueStore`.
|
`from bot_bottle.orchestrator.store.queue_store import QueueStore`.
|
||||||
|
|||||||
+3
-3
@@ -36,9 +36,9 @@ from collections.abc import Iterable
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ..store.db_store import DbStore
|
from ...store.db_store import DbStore
|
||||||
from ..store.migrations import TableMigrations
|
from ...store.migrations import TableMigrations
|
||||||
from ..paths import host_db_path
|
from ...paths import host_db_path
|
||||||
|
|
||||||
# 256 bits of urandom, URL-safe — unguessable per-bottle identity token.
|
# 256 bits of urandom, URL-safe — unguessable per-bottle identity token.
|
||||||
IDENTITY_TOKEN_BYTES = 32
|
IDENTITY_TOKEN_BYTES = 32
|
||||||
+1
-1
@@ -9,7 +9,7 @@ import unittest
|
|||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from bot_bottle.orchestrator.registry import (
|
from bot_bottle.orchestrator.store.registry_store import (
|
||||||
BottleRecord,
|
BottleRecord,
|
||||||
RegistryStore,
|
RegistryStore,
|
||||||
new_identity_token,
|
new_identity_token,
|
||||||
@@ -22,7 +22,7 @@ from unittest.mock import patch
|
|||||||
from bot_bottle.orchestrator_auth import ROLE_CLI, ROLE_GATEWAY, mint
|
from bot_bottle.orchestrator_auth import ROLE_CLI, ROLE_GATEWAY, mint
|
||||||
from bot_bottle.orchestrator.broker import StubBroker
|
from bot_bottle.orchestrator.broker import StubBroker
|
||||||
from bot_bottle.orchestrator.server import dispatch, make_server
|
from bot_bottle.orchestrator.server import dispatch, make_server
|
||||||
from bot_bottle.orchestrator.registry import BottleRecord, RegistryStore
|
from bot_bottle.orchestrator.store.registry_store import BottleRecord, RegistryStore
|
||||||
from bot_bottle.orchestrator.service import Orchestrator
|
from bot_bottle.orchestrator.service import Orchestrator
|
||||||
from bot_bottle.orchestrator.store.store_manager import StoreManager
|
from bot_bottle.orchestrator.store.store_manager import StoreManager
|
||||||
from bot_bottle.orchestrator.supervisor import (
|
from bot_bottle.orchestrator.supervisor import (
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from pathlib import Path
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from bot_bottle.orchestrator.broker import LaunchBroker, LaunchRequest, StubBroker
|
from bot_bottle.orchestrator.broker import LaunchBroker, LaunchRequest, StubBroker
|
||||||
from bot_bottle.orchestrator.registry import RegistryStore
|
from bot_bottle.orchestrator.store.registry_store import RegistryStore
|
||||||
from bot_bottle.orchestrator.service import Orchestrator
|
from bot_bottle.orchestrator.service import Orchestrator
|
||||||
from bot_bottle.orchestrator.store.secret_store import new_env_var_secret
|
from bot_bottle.orchestrator.store.secret_store import new_env_var_secret
|
||||||
from bot_bottle.orchestrator.store.store_manager import StoreManager
|
from bot_bottle.orchestrator.store.store_manager import StoreManager
|
||||||
|
|||||||
Reference in New Issue
Block a user