Files
gongzhiyong 111be3e435 Promote the minimal swarm prototype to the repository root
The standalone prototype should be the root-level project shape for fengqun while preserving the existing planning documents already at the root. This keeps README, examples, tests, and the Python package directly discoverable without deleting the prior docs.

Constraint: User clarified that swarm-minimal is the repository root, but other existing root files must remain.
Rejected: Deleting existing root docs | They are part of the fengqun repository context and were explicitly protected.
Confidence: high
Scope-risk: narrow
Directive: Keep secrets in ignored .env only; do not commit live credentials.
Tested: python3 -B -m unittest discover -s tests; git diff --check; secret-pattern scan showed only placeholders/test values/task-id false positives.
Not-tested: Remote web UI rendering after push.
2026-05-16 13:32:11 +08:00

62 lines
1.9 KiB
Python

"""Azure resource plan for the minimal swarm.
This module is declarative on purpose. The prototype can run locally without
Azure credentials, while the resource names and secret references can be bound
later when the real Azure resources are available.
"""
from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class AzureResource:
key: str
service: str
purpose: str
required: bool = True
def azure_resource_plan() -> list[AzureResource]:
"""Return the Azure resources needed by the minimal swarm."""
return [
AzureResource(
key="postgresql",
service="Azure Database for PostgreSQL Flexible Server",
purpose="authoritative task pool, shared state, score history, and convergence records",
),
AzureResource(
key="redis",
service="Azure Cache for Redis",
purpose="worker locks, heartbeats, hot pheromone scores, and Redis Streams notifications",
),
AzureResource(
key="blob_storage",
service="Azure Blob Storage",
purpose="large artifacts, run logs, traces, and final result attachments",
),
AzureResource(
key="aks",
service="Azure Kubernetes Service",
purpose="run coordinator and worker containers",
),
AzureResource(
key="secret_store",
service="Azure Key Vault or OpenBao",
purpose="store database, Redis, Blob, and model-provider secrets",
),
AzureResource(
key="monitor",
service="Azure Monitor and Log Analytics",
purpose="logs, metrics, alerts, and convergence observability",
),
AzureResource(
key="container_registry",
service="Azure Container Registry",
purpose="custom worker and coordinator images",
required=False,
),
]