-
Notifications
You must be signed in to change notification settings - Fork 8
feat(bladectl): add more bladectl commands #91
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
Merged
Conversation
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
2608d84
to
c0bde16
Compare
c0bde16
to
b2eeb71
Compare
This PR introduces a comprehensive set of new subcommands to bladectl, expanding its capabilities for querying and managing compute blade state. It also includes an internal refactor to simplify interface management across the gRPC API. * `get` * `fan`: Returns current fan speed. * `identify`: Indicates whether the identify mode is active. * `stealth`: Shows if stealth mode is currently enabled. * `status`: Prints a full blade status report. * `temperature`: Retrieves current SoC temperature. * `critical`: Shows whether critical mode is active. * `power`: Reports the current power source (e.g., PoE+ or USB). * `set` * `stealth`: Enables stealth mode. * `remove` * `stealth`: Disables stealth mode. * `describe` * `fan`: Outputs the current fan curve configuration. * `monitor`: plot some charts about the state of the compute-blade-agent * **gRPC API refactor**: The gRPC service definitions previously located in `internal/api` have been folded into `internal/agent`. This eliminates redundant interface declarations and ensures that all ComputeBladeAgent implementations are directly compatible with the gRPC API. This reduces duplication and improves long-term maintainability and clarity of the interface contract. ```bash bladectl set fan --percent 90 --blade 1 --blade 2 bladectl unset identify --blade 1 --blade 2 --blade 3 --blade 4 bladectl set stealth --blade 1 --blade 2 --blade 3 --blade 4 bladectl get status --blade 1 --blade 2 --blade 3 --blade 4 ┌───────┬─────────────┬────────────────────┬───────────────┬──────────────┬──────────┬───────────────┬──────────────┐ │ BLADE │ TEMPERATURE │ FAN SPEED OVERRIDE │ FAN SPEED │ STEALTH MODE │ IDENTIFY │ CRITICAL MODE │ POWER STATUS │ ├───────┼─────────────┼────────────────────┼───────────────┼──────────────┼──────────┼───────────────┼──────────────┤ │ 1 │ 50°C │ 90% │ 5825 RPM(90%) │ Active │ Off │ Off │ poe+ │ │ 2 │ 48°C │ 90% │ 5825 RPM(90%) │ Active │ Off │ Off │ poe+ │ │ 3 │ 49°C │ Not set │ 4643 RPM(56%) │ Active │ Off │ Off │ poe+ │ │ 4 │ 49°C │ Not set │ 4774 RPM(58%) │ Active │ Off │ Off │ poe+ │ └───────┴─────────────┴────────────────────┴───────────────┴──────────────┴──────────┴───────────────┴──────────────┘ bladectl rm stealth --blade 1 --blade 2 --blade 3 --blade 4 bladectl rm fan --blade 1 --blade 2 --blade 3 --blade 4 bladectl get status --blade 1 --blade 2 --blade 3 --blade 4 ┌───────┬─────────────┬────────────────────┬───────────────┬──────────────┬──────────┬───────────────┬──────────────┐ │ BLADE │ TEMPERATURE │ FAN SPEED OVERRIDE │ FAN SPEED │ STEALTH MODE │ IDENTIFY │ CRITICAL MODE │ POWER STATUS │ ├───────┼─────────────┼────────────────────┼───────────────┼──────────────┼──────────┼───────────────┼──────────────┤ │ 1 │ 51°C │ Not set │ 5177 RPM(66%) │ Off │ Off │ Off │ poe+ │ │ 2 │ 49°C │ Not set │ 5177 RPM(58%) │ Off │ Off │ Off │ poe+ │ │ 3 │ 50°C │ Not set │ 4659 RPM(60%) │ Off │ Off │ Off │ poe+ │ │ 4 │ 48°C │ Not set │ 4659 RPM(54%) │ Off │ Off │ Off │ poe+ │ └───────┴─────────────┴────────────────────┴───────────────┴──────────────┴──────────┴───────────────┴──────────────┘ ``` when having multiple compute-blades in your bladeconfig: ```yaml blades: - name: 1 blade: server: blade-pi1:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 2 blade: server: blade-pi2:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 3 blade: server: blade-pi3:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 4 blade: server: blade-pi4:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 4 blade: server: blade-pi4:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> current-blade: 1 ``` Fixes #4, #9 (partially), should help with #5
b2eeb71
to
bc3c8c7
Compare
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
cedi
added a commit
that referenced
this pull request
Jun 6, 2025
This PR introduces a comprehensive set of new subcommands to bladectl, expanding its capabilities for querying and managing compute blade state. It also includes an internal refactor to simplify interface management across the gRPC API. * `get` * `fan`: Returns current fan speed. * `identify`: Indicates whether the identify mode is active. * `stealth`: Shows if stealth mode is currently enabled. * `status`: Prints a full blade status report. * `temperature`: Retrieves current SoC temperature. * `critical`: Shows whether critical mode is active. * `power`: Reports the current power source (e.g., PoE+ or USB). * `set` * `stealth`: Enables stealth mode. * `remove` * `stealth`: Disables stealth mode. * `describe` * `fan`: Outputs the current fan curve configuration. * `monitor`: plot some charts about the state of the compute-blade-agent * **gRPC API refactor**: The gRPC service definitions previously located in `internal/api` have been folded into `internal/agent`. This eliminates redundant interface declarations and ensures that all ComputeBladeAgent implementations are directly compatible with the gRPC API. This reduces duplication and improves long-term maintainability and clarity of the interface contract. ```bash bladectl set fan --percent 90 --blade 1 --blade 2 bladectl unset identify --blade 1 --blade 2 --blade 3 --blade 4 bladectl set stealth --blade 1 --blade 2 --blade 3 --blade 4 bladectl get status --blade 1 --blade 2 --blade 3 --blade 4 ┌───────┬─────────────┬────────────────────┬───────────────┬──────────────┬──────────┬───────────────┬──────────────┐ │ BLADE │ TEMPERATURE │ FAN SPEED OVERRIDE │ FAN SPEED │ STEALTH MODE │ IDENTIFY │ CRITICAL MODE │ POWER STATUS │ ├───────┼─────────────┼────────────────────┼───────────────┼──────────────┼──────────┼───────────────┼──────────────┤ │ 1 │ 50°C │ 90% │ 5825 RPM(90%) │ Active │ Off │ Off │ poe+ │ │ 2 │ 48°C │ 90% │ 5825 RPM(90%) │ Active │ Off │ Off │ poe+ │ │ 3 │ 49°C │ Not set │ 4643 RPM(56%) │ Active │ Off │ Off │ poe+ │ │ 4 │ 49°C │ Not set │ 4774 RPM(58%) │ Active │ Off │ Off │ poe+ │ └───────┴─────────────┴────────────────────┴───────────────┴──────────────┴──────────┴───────────────┴──────────────┘ bladectl rm stealth --blade 1 --blade 2 --blade 3 --blade 4 bladectl rm fan --blade 1 --blade 2 --blade 3 --blade 4 bladectl get status --blade 1 --blade 2 --blade 3 --blade 4 ┌───────┬─────────────┬────────────────────┬───────────────┬──────────────┬──────────┬───────────────┬──────────────┐ │ BLADE │ TEMPERATURE │ FAN SPEED OVERRIDE │ FAN SPEED │ STEALTH MODE │ IDENTIFY │ CRITICAL MODE │ POWER STATUS │ ├───────┼─────────────┼────────────────────┼───────────────┼──────────────┼──────────┼───────────────┼──────────────┤ │ 1 │ 51°C │ Not set │ 5177 RPM(66%) │ Off │ Off │ Off │ poe+ │ │ 2 │ 49°C │ Not set │ 5177 RPM(58%) │ Off │ Off │ Off │ poe+ │ │ 3 │ 50°C │ Not set │ 4659 RPM(60%) │ Off │ Off │ Off │ poe+ │ │ 4 │ 48°C │ Not set │ 4659 RPM(54%) │ Off │ Off │ Off │ poe+ │ └───────┴─────────────┴────────────────────┴───────────────┴──────────────┴──────────┴───────────────┴──────────────┘ ``` when having multiple compute-blades in your bladeconfig: ```yaml blades: - name: 1 blade: server: blade-pi1:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 2 blade: server: blade-pi2:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 3 blade: server: blade-pi3:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 4 blade: server: blade-pi4:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> - name: 4 blade: server: blade-pi4:8081 cert: certificate-authority-data: <redacted> client-certificate-data: <redacted> client-key-data: <redacted> current-blade: 1 ``` Fixes #4, #9 (partially), should help with #5 * test: improve unit-testing * fix: pin github.com/warthog618/gpiod --------- Co-authored-by: Cedric Kienzler <cedric@specht-labs.de>
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.
This PR introduces a comprehensive set of new subcommands to bladectl, expanding its capabilities for querying and managing compute blade state. It also includes an internal refactor to simplify interface management across the gRPC API.
get
fan
: Returns current fan speed.identify
: Indicates whether the identify mode is active.stealth
: Shows if stealth mode is currently enabled.status
: Prints a full blade status report.temperature
: Retrieves current SoC temperature.critical
: Shows whether critical mode is active.power
: Reports the current power source (e.g., PoE+ or USB).set
stealth
: Enables stealth mode.remove
stealth
: Disables stealth mode.describe
fan
: Outputs the current fan curve configuration.monitor
: plot some charts about the state of the compute-blade-agentgRPC API refactor: The gRPC service definitions previously located in
internal/api
have been folded intointernal/agent
. This eliminates redundant interface declarations and ensures that all ComputeBladeAgent implementations are directly compatible with the gRPC API. This reduces duplication and improves long-term maintainability and clarity of the interface contract.when having multiple compute-blades in your bladeconfig:
should help with #5
closes #4
closes #9 (at least partially)