MCPcopy Index your code
hub / github.com/compute-blade-community/compute-blade-agent

github.com/compute-blade-community/compute-blade-agent @v0.11.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.11.2 ↗ · + Follow
511 symbols 1,347 edges 69 files 177 documented · 35% updated 3d agov0.11.2 · 2026-03-04★ 336 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

compute-blade-agent

:warning: Beta Release: This software is currently in beta, and both configurations and APIs may undergo breaking changes. It is not yet 100% feature complete, but it functions as intended.

Quick Start

Install the agent with the one-liner below:

curl -L -o /tmp/compute-blade-agent-installer.sh https://raw.githubusercontent.com/compute-blade-community/compute-blade-agent/main/hack/autoinstall.sh
chmod +x /tmp/compute-blade-agent-installer.sh
/tmp/compute-blade-agent-installer.sh

Components

compute-blade-agent: Hardware Interaction & Monitoring

The agent runs as a system service and monitors various hardware states and events:

  • Reacts to button presses and SoC temperature.
  • Automatically enters critical mode (fan 100%, red LED) when overheating.
  • Exposes system metrics via a Prometheus endpoint (/metrics).

The identify function can be triggered via bladectl or a physical button press. It makes the edge LED blink to assist locating a blade in a rack.

bladectl: User Command-Line Tool

bladectl is a CLI utility for remote or local interaction with the running agent. Example use cases:

bladectl set identify --wait    # Blink LED until button is pressed
bladectl set identify --confirm # Cancel identification
bladectl unset identify         # Cancel identification (alternative)

fanunit.uf2: Smart Fan Unit Firmware

This firmware runs on the fan unit microcontroller and:

  • Controls fan speed via UART commands from blade agents.
  • Reports RPM and airflow temperature back to the blade.
  • Forwards button events (1x = left blade, 2x = right blade).
  • Uses EMC2101 for optional advanced features like airflow-based fan control.

To install it, download the fanunit.uf2, and follow the firmware upgrade instructions here.

Installation

Install the agent with the one-liner below:

curl -L -o /tmp/compute-blade-agent-installer.sh https://raw.githubusercontent.com/compute-blade-community/compute-blade-agent/main/hack/autoinstall.sh
chmod +x /tmp/compute-blade-agent-installer.sh
/tmp/compute-blade-agent-installer.sh

Note: bladectl requires root privileges when used locally, due to restricted access to the Unix socket (/tmp/compute-blade-agent.sock).

Configuration

The default configuration file is located at:

/etc/compute-blade-agent/config.yaml

You can also override any config option via environment variables using the BLADE_ prefix.

Examples

YAML:

listen:
  metrics: ":9666"

Environment variable override:

BLADE_LISTEN_METRICS=":1234"

Common Overrides

Variable Description
BLADE_STEALTH_MODE=false Enable/disable stealth mode
BLADE_FAN_SPEED_PERCENT=80 Set static fan speed
BLADE_CRITICAL_TEMPERATURE_THRESHOLD=60 Set critical temp threshold (°C)
BLADE_HAL_RPM_REPORTING_STANDARD_FAN_UNIT=false Disable RPM monitoring for lower CPU use
OTEL_EXPORTER_OTLP_ENDPOINT Endpoint for the OTLP exporter

Exposing the gRPC API for Remote Access

To allow secure remote use of bladectl over the network:

1. Update your config (/etc/compute-blade-agent/config.yaml):

listen:
  metrics: ":9666"
  grpc: ":8081"
  authenticated: true
  mode: tcp

2. Restart the agent:

systemctl restart compute-blade-agent

This will:

  • Generate new mTLS server and client certificates in /etc/compute-blade-agent/*.pem
  • Write a new bladectl config to: ~/.config/bladectl/config.yaml with the client certificates in place

Using bladectl from your local machine

  1. Copy the config from the blade:
scp root@blade-pi1:~/.config/bladectl/config.yaml ~/.config/bladectl/config.yaml
  1. Fix the server address to point to the blade:
yq e '.blades[] | select(.name == "blade-pi1") .blade.server = "blade-pi1.local:8081"' -i ~/.config/bladectl/config.yaml

Your bladectl tool can now securely talk to the remote agent via gRPC over mTLS.

Extension points exported contracts — how you extend this code

ComputeBladeHal (Interface)
ComputeBladeHal abstracts hardware details of the Compute Blade and provides a simple interface [5 implementers]
pkg/hal/hal.go
PacketGenerator (Interface)
(no doc) [5 implementers]
pkg/smartfanunit/commands.go
Clock (Interface)
Clock is an interface for the time package [2 implementers]
pkg/util/clock.go
LedEngine (Interface)
LedEngine is the interface for controlling effects on the computeblade RGB LEDs [1 implementers]
pkg/ledengine/ledengine.go
EventBus (Interface)
EventBus is a simple event bus with topic-based publish/subscribe. This is, by no means, a performant or complete implem [1 …
pkg/events/eventbus.go
ComputeBladeAgent (Interface)
ComputeBladeAgent implements the core-logic of the agent. It is responsible for handling events and interfacing with the [1 …
pkg/agent/agent.go
FanController (Interface)
(no doc) [1 implementers]
pkg/fancontroller/fancontroller.go
Option (FuncType)
(no doc)
pkg/certificate/options.go

Core symbols most depended-on inside this repo

FromContext
called by 71
pkg/log/logger.go
C
called by 25
pkg/events/eventbus.go
Close
called by 24
pkg/hal/hal.go
RegisterEvent
called by 23
pkg/agent/state.go
String
called by 17
pkg/events/event.go
Now
called by 15
pkg/util/clock.go
clientsFromContext
called by 15
cmd/bladectl/main.go
Run
called by 13
pkg/hal/hal.go

Shape

Method 292
Function 139
Struct 50
TypeAlias 15
Interface 14
FuncType 1

Languages

Go100%

Modules by API surface

api/bladeapi/v1alpha1/blade.pb.go80 symbols
api/bladeapi/v1alpha1/blade_grpc.pb.go40 symbols
pkg/hal/hal_bcm2712.go26 symbols
pkg/hal/hal.go26 symbols
pkg/hal/hal_bcm2711.go18 symbols
pkg/smartfanunit/commands.go17 symbols
pkg/ledengine/ledengine.go16 symbols
pkg/smartfanunit/emc2101/emc2101.go14 symbols
pkg/events/eventbus.go14 symbols
pkg/hal/hal_rk3588.go13 symbols
pkg/agent/state.go13 symbols
pkg/hal/smartfanunit.go12 symbols

For agents

$ claude mcp add compute-blade-agent \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page