Task 001: dockerized monorepo foundation

This commit is contained in:
2026-05-21 16:57:58 +03:00
commit d42f0c4392
83 changed files with 4236 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY apps/runner/src ./src
EXPOSE 8010
CMD ["python", "-m", "src.presentation.main"]
View File
+1
View File
@@ -0,0 +1 @@
"""Runner service package."""
+3
View File
@@ -0,0 +1,3 @@
# Application
Runner use cases, job orchestration, and command policies belong in this layer.
+1
View File
@@ -0,0 +1 @@
"""Application layer for runner use cases."""
+3
View File
@@ -0,0 +1,3 @@
# Domain
Runner job entities and invariants belong in this layer.
+1
View File
@@ -0,0 +1 @@
"""Domain layer for runner job concepts."""
+4
View File
@@ -0,0 +1,4 @@
# Infrastructure
CLI execution, workspace, filesystem, and artifact storage adapters belong in
this layer.
@@ -0,0 +1 @@
"""Infrastructure adapters for runner execution."""
+3
View File
@@ -0,0 +1,3 @@
# Presentation
Runner HTTP routes and API wiring belong in this layer.
+1
View File
@@ -0,0 +1 @@
"""Presentation layer for runner HTTP APIs."""
+33
View File
@@ -0,0 +1,33 @@
from __future__ import annotations
import json
import os
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
class HealthHandler(BaseHTTPRequestHandler):
def do_GET(self) -> None:
if self.path != "/health":
self.send_error(HTTPStatus.NOT_FOUND)
return
body = json.dumps({"service": "runner", "status": "ok"}).encode("utf-8")
self.send_response(HTTPStatus.OK)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
def log_message(self, format: str, *args: object) -> None:
return
def run() -> None:
port = int(os.environ.get("PORT", "8010"))
server = ThreadingHTTPServer(("0.0.0.0", port), HealthHandler)
server.serve_forever()
if __name__ == "__main__":
run()
+3
View File
@@ -0,0 +1,3 @@
# Shared
Cross-layer runner primitives belong here. Keep this layer small.
+1
View File
@@ -0,0 +1 @@
"""Shared runner primitives."""