svcforge: reference implementation
ci / lint (push) Successful in 1m19s
ci / unit (push) Failing after 1m2s
ci / integration (push) Has been skipped
ci / types (push) Successful in 1m37s
ci / security (push) Failing after 38s
ci / dockerfile (push) Successful in 14s
ci / image (api) (push) Has been skipped
ci / image (reconciler) (push) Has been skipped
ci / image (worker) (push) Has been skipped
ci / bump (push) Has been skipped
ci / lint (push) Successful in 1m19s
ci / unit (push) Failing after 1m2s
ci / integration (push) Has been skipped
ci / types (push) Successful in 1m37s
ci / security (push) Failing after 38s
ci / dockerfile (push) Successful in 14s
ci / image (api) (push) Has been skipped
ci / image (reconciler) (push) Has been skipped
ci / image (worker) (push) Has been skipped
ci / bump (push) Has been skipped
Complete working build of the system learn-python/ teaches. 164 tests, mypy --strict clean, domain coverage 99%.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"""`python -m services.api` — what the container's ENTRYPOINT runs.
|
||||
|
||||
One uvicorn worker per container, on purpose. Replicas are Kubernetes' job: `--workers N`
|
||||
forks processes the orchestrator cannot see, size, or drain, and it breaks the in-process
|
||||
Prometheus registry that /metrics depends on.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import uvicorn
|
||||
|
||||
from svcforge_core.settings import load_settings
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Load settings (fail fast if the env is wrong), then serve."""
|
||||
settings = load_settings()
|
||||
uvicorn.run(
|
||||
"services.api.main:app",
|
||||
factory=True,
|
||||
host="0.0.0.0", # noqa: S104 - a container binds all interfaces; the pod is the boundary
|
||||
port=8000,
|
||||
log_level=settings.log_level,
|
||||
access_log=False, # structlog owns request logging (Module 7); two sources would double it
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user