How cloudbase/garm works
GARM is a self-hosted manager for ephemeral GitHub Actions and Gitea runners. Administrators configure forge entities, pools or scale sets, then incoming workflow-job webhooks or GitHub’s native scale-set queue drive runner provisioning; providers create the compute instances, and agents report runner state. The repository also exposes an API, CLI, browser UI, templates, object storage, and monitoring. The map combines README-described capabilities with sampled routing and worker code; several runtime links are documented at a high level but their detailed implementations were not sampled.
Main entry points: controllers.go API handlers · scaleset/controller.go Scale-set workers · entity/controller.go Entity workers · routers.go HTTP router
Components 21
Management surfaces
- GARM CLI
cmd/garm-cli/cmd - Web UI
webapp/src/routes - API clients
client
API and configuration
- HTTP router
apiserver/routers/routers.go - API handlers
apiserver/controllers/controllers.go - Authentication
auth - Forge entities and pools
runner - Runner templates
runner/templates.go
Runner orchestration
- Entity workers
workers/entity/controller.go - Pool scaling
runner/pool - Scale-set workers
workers/scaleset/controller.go - Instance lifecycle
workers/provider/instance_manager.go
Persistence and integrations
- Provider adapters
runner/providers - Forge API integration
util/github/client.go - Embedded SQL store
database/sql - Runner agent channel
workers/websocket/agent - Agent tools and objects
runner/object_store.go - Metrics and events
metrics
Other components
- Administrator
- GitHub / Gitea
- Infrastructure provider
Connections 23
- Administrator → GARM CLI: manages via
- Administrator → Web UI: manages via
- GARM CLI → API clients: calls
cmd/garm-cli/cmd/controller.go - Web UI → API clients: uses
- API clients → HTTP router: sends requests
- HTTP router → API handlers: routes to
apiserver/routers/routers.go - HTTP router → Authentication: applies middleware
apiserver/routers/routers.go - GitHub / Gitea → API handlers: posts job webhook
- API handlers → Entity workers: dispatches job
apiserver/controllers/controllers.go - Forge entities and pools → Entity workers: configures entities
workers/entity/controller.go - Entity workers → Embedded SQL store: loads entities
workers/entity/controller.go - Entity workers → Pool scaling: coordinates pools
- GitHub / Gitea → Scale-set workers: queues scale-set jobs
- Scale-set workers → Embedded SQL store: loads scale sets
workers/scaleset/controller.go - Pool scaling → Instance lifecycle: requests instances
- Scale-set workers → Instance lifecycle: provisions instances
- Instance lifecycle → Provider adapters: creates instances
workers/provider/instance_manager.go - Provider adapters → Infrastructure provider: manages compute
- Scale-set workers → Forge API integration: reconciles runners
- Runner templates → Forge entities and pools: supplies configuration
- API handlers → Agent tools and objects: serves tool operations
- Runner agent channel → API handlers: reports state
apiserver/controllers/controllers.go - API handlers → Metrics and events: registers metrics client
apiserver/controllers/controllers.go