Open
Conversation
…eful shutdown and CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EvaluatorPoolStatefulSets, autoscaling screener pods based on queue depth from the Ridges API.GET /screener/queue-depth) and backing DB queries.no-new-privileges./healthz,/readyz) for Kubernetes probes.Details
Operator and CRD
EvaluatorPoolCRD (groupridges.ai/v1alpha1) with min/max replicas and scale-down stabilization. The controller runs preflight checks (secret, API reachability, labeled nodes), manages a StatefulSet + PDB + NetworkPolicy, and autoscales by polling queue depth with stepwise scale-down and stabilization windows. Exposes Prometheus metrics for queue depth, desired replicas, preflight status, drift corrections, and scaling errors.Screener queue-depth endpoint
GET /screener/queue-depth?stage={screener_1,screener_2,validator}returns queuedepthandactiveevaluation count. Backed by newget_queue_depth()andget_active_evaluation_count()queries.Sandbox hardening
Sandbox containers now run as UID 65534 (nobody) with a read-only root filesystem, a 64 MB tmpfs at
/tmp, a PID limit of 256, all capabilities dropped, andno-new-privileges. Temp directory permissions are set before mounting.HOME=/tmpandgit safe.directoryare configured via environment. The sandbox image Dockerfile fixes NVM directory permissions for non-root access.Sandbox proxy hardening
The nginx proxy runs as the
nginxuser on port 8080. Only/api/inference,/api/embedding, and/api/usageare proxied to the gateway (rate-limited at 30 req/s, burst 10); all other paths return 403. Temp/pid files are written to a writable/sandbox-proxydirectory.Validator graceful shutdown
A SIGTERM handler marks the health server as shutting down, wakes idle sleep loops via
asyncio.Event, finishes the current evaluation if one is running, then disconnects from the platform. A lightweight async health server serves/healthz(liveness) and/readyz(readiness) on port 8080.CI and Dockerfiles
Multi-stage Dockerfile for the screener image (Python 3.12, Docker CLI, shallow
.git, non-root user UID 1000). Multi-stage Dockerfile for the operator (static Go binary on distroless/nonroot). GitHub Actions workflow builds both images in a matrix and pushes to GHCR onmainand version tags.