Repository navigation
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9135 +/- ##
============================================
+ Coverage 91.80% 91.82% +0.01%
Complexity 5066 5066
============================================
Files 1270 1272 +2
Lines 55193 55301 +108
Branches 6987 6994 +7
============================================
+ Hits 50672 50782 +110
Misses 2800 2800
+ Partials 1721 1719 -2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/request-review @aicam |
Contributor
|
@sshiv012 Please review it as well. |
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.
What changes were proposed in this PR?
Problem. When a computing unit stays
Pendingon a full cluster, Admin > Computing Units (#8888) lists the unit but not how much of the cluster is left, so an admin still runskubectl describe nodesto find which resource ran out. The backend has reported it since #8986 (GET /computing-unit/admin/cluster-capacity), but nothing in the UI reads it.Fix. Adds a Cluster capacity card above the units table. CPU, memory and GPU each get a row with a bar of the share allocated, then the allocated, available and total amounts: CPU in cores to the millicore, memory in binary units (
GiB, as unit limits are written) and GPU as a count. The bars share one scale, so the resource that runs out first stands out. From 80% a row turns gold and is marked "Running low", and from 95% red and "Nearly full", with an icon and a screen-reader label so color is not the only signal. The share is rounded down, so 100% shows only when nothing is left, and it can pass 100% (the bar cannot) when pods request more than the nodes offer. A note under the rows says that allocated means requested, not used, and that available is summed across nodes.The card polls every 30 seconds rather than the table's 5, since capacity only moves when units start or stop and the backend lists every pod in the cluster to answer. A refresh button fetches at once and restarts the 30 seconds, so a click is not followed by a second cluster-wide listing seconds later. On a deployment without Kubernetes units the endpoint answers 404, so the card never shows and the poll ends. Any other failure shows the cluster's own message (a missing read grant reads "nodes is forbidden: ..."), and a failed refresh keeps the last numbers under a warning, as the table does. A resource the cluster has none of, usually GPU, reads "None in the cluster", and a missing, non-numeric or negative figure reads "Not reported" without taking the other rows down. When the card is narrower than the table needs, which the sidebar decides rather than the window, the rows stack into one labelled line per figure.
Not included. Telling the owner when an admin terminates their unit (#6483). The card shows what the endpoint reports, so the endpoint's limits carry over:
availableis an upper bound summed across nodes, so free capacity spread over several nodes can still refuse a unit that needs one node's worth, and a tainted node (say an RKE2 server reserved for control-plane pods) still counts although no unit can be scheduled there. Like the units table, the card keeps polling while the browser tab is hidden.Any related issues, documentation, discussions?
Closes #6482. Part of #6476.
Reads the endpoint added in #8986, on the page added in #8888.
How was this PR tested?
Before

After

Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code, Claude Opus 5.5