Repository navigation
feat(status): public node and tenant usage at /status - #37
Merged
Merged
Conversation
carrel.winlab.tw shows how busy the cluster is and who uses how much. GET /status returns the node's physical use, Carrel's allocations and each tenant's machine count, vCPU, RAM and disk, by slug only. Responses are cached for 15 seconds so the public endpoint cannot drive inventory calls. The edge sends /status to the control plane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om cancelling inventory - A tenant is named only when it is active and serves a ready domain, so its slug is already public; all other tenants are summed into "others". - The inventory fetch runs on a context visitors cannot cancel, with a 10 s timeout, so a disconnect cannot fail members' capacity_get. - Failures are cached for 5 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The carrel.winlab.tw page should show the cluster's hardware state and who uses how much, without signing in.
What
GET /status(new, unauthenticated, GET only):node: logical CPUs and utilization, memory and disk total/used (GiB), from the same cached inventory ascapacity_get.allocated: Carrel's admission limits and commitments (capacity_get.allocatable).tenants: for each tenant with machines,name(slug),machines,vcpu,memory_gib,disk_gib, sorted by vCPU.Cache-Control: public, max-age=15.scripts/edge-agent.py:/statusjoinsCONTROL_PATHSso the edge sends it to the control plane.Verified
go test -race ./internal/carrel/andgo vetpass on sandbox; new tests check the tenant share, that machine details do not leak, that a second load is served from cache, and that POST is 405.pytest tests/test_edge_agent.py: 7 passed.🤖 Generated with Claude Code