Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
fix(doctor): per-OS compute remedies + resources-set-max drift nudge (#400)#405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
997705a
fix(doctor): per-OS compute remedies + resources-set-max drift nudge …
LukasWodka 741bc3f
remedies: the memory slider lives at Settings -> Resources -> Advanced
LukasWodka b0f235e
drift nudge: CPU-major node selection, matching resources set max (Bu…
LukasWodka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| // Package doctor implements the checks behind `tracebloc cluster doctor`: | ||
| // a read-only, best-effort health sweep of a running tracebloc client | ||
| // cluster. Each check reports ✔/⚠/✖ plus a one-line remedy, so a customer | ||
| @@ -30,6 +30,7 @@ | ||
| "k8s.io/client-go/kubernetes" | ||
| "github.com/tracebloc/cli/internal/cluster" | ||
| "github.com/tracebloc/cli/internal/resources" | ||
| ) | ||
| // Status is a single check's severity. Ordered so the numerically-greatest | ||
| @@ -596,12 +597,21 @@ | ||
| // node as a whole — never OR cpu/mem and GPU across different nodes, which | ||
| // would pass even when no single node can run the job (Bugbot on PR #91). | ||
| var cpuMemFits, fullFits bool | ||
| // Largest Ready node for the drift nudge — CPU-major with memory as the | ||
| // tie-break, EXACTLY like resources.nodeLarger, so the advertised ceiling | ||
| // always matches what `resources set max` will actually apply (Bugbot). | ||
| var bestCPU, bestMem resource.Quantity | ||
| for i := range nodes.Items { | ||
| n := nodes.Items[i] | ||
| if !nodeReady(n) { | ||
| continue | ||
| } | ||
| alloc := n.Status.Allocatable | ||
| if alloc.Cpu().Cmp(bestCPU) > 0 || | ||
| (alloc.Cpu().Cmp(bestCPU) == 0 && alloc.Memory().Cmp(bestMem) > 0) { | ||
| bestCPU = *alloc.Cpu() | ||
| bestMem = *alloc.Memory() | ||
| } | ||
| nodeCPUMem := alloc.Cpu().Cmp(cpuReq) >= 0 && alloc.Memory().Cmp(memReq) >= 0 | ||
| nodeGPU := !gpuRequested | ||
| if gpuRequested { | ||
| @@ -633,7 +643,19 @@ | ||
| Remedy: "If GPU training is expected, ensure one node has both the compute and the GPU capacity, with its device plugin.", | ||
| } | ||
| default: | ||
| return Result{Name: name, Status: StatusOK, Detail: fmt.Sprintf("a Ready node can schedule a training job (%s)", req)} | ||
| detail := fmt.Sprintf("a Ready node can schedule a training job (%s)", req) | ||
| // Drift nudge (#400 / backend#1236): the install-time auto-size goes | ||
| // stale when a machine GROWS. When the configured budget uses no more | ||
| // than half of what this machine could give one run (largest node − | ||
| // platform overhead), say so. | ||
| m := resources.Machine{CPU: bestCPU, Mem: bestMem} | ||
| maxCores, maxGiB := resources.MaxRunCores(m), resources.MaxRunGiB(m) | ||
| if maxCores >= 1 && maxGiB >= 2 && | ||
| cpuReq.MilliValue()*2 <= int64(maxCores)*1000 && | ||
| memReq.Value()*2 <= int64(maxGiB)<<30 { | ||
| detail += fmt.Sprintf(" — this machine could give a run up to cpu=%d,memory=%dGi ('tracebloc resources set max')", maxCores, maxGiB) | ||
| } | ||
cursor[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return Result{Name: name, Status: StatusOK, Detail: detail} | ||
| } | ||
| } | ||
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.