Conversation
- prepareLogger: JSONFormatter to stdout (12-factor XI, event stream); logstash hook Fatal -> Warn so a dead sink never takes down the scheduler - executorInvokeWorker.RunSync: stamp a short sync_id per sync attempt and thread it through every log line + into executor.RunOnce, so all lines of one run correlate in the stream - rename logrus field "worker" -> "repo" on the two worker loggers (executorInvokeWorker, ExternalWorker); Prometheus label "worker" and manager's "manager" field unchanged for metric/API compatibility
Pin go-version, refresh flake.lock/gomod2nix and module deps.
Replace RLIMIT_AS pre/post-hook utility with ephemeral cgroup v2 job isolation. Each sync attempt now runs in its own cgroup: memory.max is enforced with swap disabled and oom.group set, so a job exceeding its budget is killed atomically instead of silently spilling to swap. The child enters the cgroup atomically via clone3 (CgroupFD). Per-attempt telemetry (duration, memory.peak, oom_kill) is collected from the cgroup and accumulated into a per-repo EWMA, exposed via new Prometheus gauges (lug_job_*).
Expose POST /lug/v1/admin/worker/:name/abort. Cancellation propagates through the worker context and kills the complete cgroup process tree.
Gate queued launches on memory PSI and learned per-repo peak-memory EWMA, while retaining concurrent_limit as a hard cap. Grants reserve estimated memory until workers return idle
…rence Document all REST endpoints including the new abort endpoint, Prometheus metrics (sync counters, resource telemetry gauges, admission verdicts), structured log events, cgroup v2 requirements for rootful Docker / rootless Podman / bare systemd, elastic admission control, per-repo resource controls, development workflow with cgroup-aware test execution, and the manual sync triggering workaround.
…etails
New REST endpoints:
GET /lug/v1/admin/queue — running workers (with cgroup/PID
info) and the pending launch queue in FIFO order.
POST /lug/v1/admin/worker/:name/sync — insert/lift the named worker to the
head of the pending queue and launch immediately if capacity allows.
Returns 409 if the worker is already syncing (abort first).
GET /lug/v1/admin/worker/:name/job — live job detail: cgroup path, main
PID, start time, and real-time cgroup stats (memory.current,
memory.peak, memory.max, pids.current). Includes an nsenter attach
hint for interactive debugging.
Implementation: queue inspection and manual-sync requests are routed through
dedicated channels into the manager Run() goroutine, so pending-queue access
is race-free without adding a mutex. Active job tracking is published from
shellScriptExecutor (mutex-protected) via the new jobInspector interface and
surfaced in worker.Status.ActiveJob.
Non-Linux: ReadCgroupStats and jobCgroup.Path stubs compile on all platforms;
ActiveJob.CgroupPath is empty when cgroup isolation is unavailable.
This branch has not been deployed
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.
No description provided.