[cueadmin] Add lock-state filter and idle sort to host list#2480
Open
ramonfigueiredo wants to merge 2 commits into
Open
[cueadmin] Add lock-state filter and idle sort to host list#2480ramonfigueiredo wants to merge 2 commits into
ramonfigueiredo wants to merge 2 commits into
Conversation
Add two options to `cueadmin -lh` to help surface idle hosts:
- `-lock-state {OPEN,LOCKED,NIMBY_LOCKED}` filters the host list to a single lock state (e.g. NIMBY_LOCKED).
- `-sort-idle` sorts the output by most idle resources first (idle cores, then idle memory) instead of by host name.
Filtering and sorting are applied client-side in displayHosts(), so no gRPC or backend changes are required. Existing default behavior (sort by name, no filter) is unchanged.
Contributor
📝 WalkthroughWalkthroughAdded ChangesHost lock-state filter and idle sort
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant cueadmin_common
participant opencue_api
participant cueadmin_output
User->>cueadmin_common: cueadmin -lh -lock-state LOCKED -sort-idle
cueadmin_common->>opencue_api: getHosts(match, state, alloc, lock_state, sort_idle)
opencue_api-->>cueadmin_common: hosts list
cueadmin_common->>cueadmin_output: displayHosts(hosts, lock_state, sort_idle)
cueadmin_output->>cueadmin_output: filter by lock_state
cueadmin_output->>cueadmin_output: sort by idle resources or name
cueadmin_output-->>User: printed host list
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Document the two new `cueadmin -lh` options for surfacing idle hosts:
- `-lock-state {OPEN,LOCKED,NIMBY_LOCKED}` filters the host list to a single lock state.
- `-sort-idle` sorts the output by most idle resources first.
Updates the cueadmin command and tools reference, the cueadmin tutorial, the desktop rendering control guide, and the cueadmin README, noting that NIMBY_LOCKED indicates an active user and that `-lh` reports current state only (poll over time to track idle duration).
Collaborator
Author
|
@DiegoTavares / @lithorus |
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.
Related Issues
Summarize your change.
[cueadmin] Add lock-state filter and idle sort to host list
Add two options to
cueadmin -lhto help surface idle hosts:-lock-state {OPEN,LOCKED,NIMBY_LOCKED}filters the host list to a single lock state (e.g. NIMBY_LOCKED).-sort-idlesorts the output by most idle resources first (idle cores, then idle memory) instead of by host name.Filtering and sorting are applied client-side in displayHosts(), so no gRPC or backend changes are required. Existing default behavior (sort by name, no filter) is unchanged.
[docs/cueadmin] Document -lock-state and -sort-idle host list options
Document the two new
cueadmin -lhoptions for surfacing idle hosts:-lock-state {OPEN,LOCKED,NIMBY_LOCKED}filters the host list to a single lock state.-sort-idlesorts the output by most idle resources first.Updates the cueadmin command and tools reference, the cueadmin tutorial, the desktop rendering control guide, and the cueadmin README, noting that NIMBY_LOCKED indicates an active user and that
-lhreports current state only (poll over time to track idle duration).