Autoscaler
The Crow CI Autoscaler dynamically provisions cloud servers to execute pipelines, then terminates them when idle.
Supported Providers
Section titled “Supported Providers”| Provider | Configuration Reference |
|---|---|
| AWS | flags.go |
| Hetzner Cloud | flags.go |
| Linode | flags.go |
| Scaleway | flags.go |
| Vultr | flags.go |
Additional providers with a Go SDK can be added — contributions welcome!
-
Deploy alongside the server — the autoscaler listens for build triggers
-
Configure server connection — provide server address and authentication tokens
-
Configure scaling limits — set min/max agents and workflows per agent
-
Configure gRPC — remote agents need secure gRPC connection to server
-
Configure cloud provider — set provider credentials and instance settings
Complete Example
Section titled “Complete Example”Configuration Reference
Section titled “Configuration Reference”Server Connection
Section titled “Server Connection”| Variable | Description |
|---|---|
CROW_SERVER | Server address (internal or public URL) |
CROW_TOKEN | Admin API token for agent management |
CROW_AUTOSCALER_TOKEN | Registration token for autoscaler |
Scaling
Section titled “Scaling”| Variable | Default | Description |
|---|---|---|
CROW_MIN_AGENTS | 0 | Minimum agents always running |
CROW_MAX_AGENTS | 1 | Maximum concurrent agents |
CROW_WORKFLOWS_PER_AGENT | 1 | Parallel workflows per agent |
Timeouts
Section titled “Timeouts”| Variable | Default | Description |
|---|---|---|
CROW_AGENT_IDLE_TIMEOUT | 10m | Time before idle agent is terminated |
CROW_AGENT_SERVER_CONNECTION_TIMEOUT | 10m | Max time without server connection |
gRPC Connection
Section titled “gRPC Connection”Remote agents require secure gRPC to connect back to the server.
| Variable | Description |
|---|---|
CROW_GRPC_ADDR | Public gRPC address (no protocol prefix) |
CROW_GRPC_SECURE | Set true for TLS connection |
Agent Image
Section titled “Agent Image”| Variable | Default | Description |
|---|---|---|
CROW_AGENT_IMAGE | auto | Container image for spawned agents |
When CROW_AGENT_IMAGE is not set, the autoscaler queries the Crow server’s /version endpoint and uses the matching agent image automatically — for example, if the server reports version v5.3.2, the autoscaler uses codefloe.com/crowci/crow-agent:v5.3.2.
Set this variable explicitly only if you need to pin a specific agent version or use a custom image.
Agent Configuration
Section titled “Agent Configuration”| Variable | Default | Description |
|---|---|---|
CROW_AGENT_ENV | none | Environment variables passed to spawned agents (comma-separated KEY=value pairs) |
CROW_FILTER_LABELS | none | Only count queued tasks matching this label (key=value) toward scaling decisions. Required for multiple autoscalers. |
Example agent environment:
gRPC Proxy Setup
Section titled “gRPC Proxy Setup”Remote agents need a TLS-secured gRPC endpoint. Configure your reverse proxy to forward to the server’s gRPC port (default: 9000).
Traefik
Section titled “Traefik”Hybrid Setup
Section titled “Hybrid Setup”Combine static agents (always-on) with autoscaled agents (on-demand) for cost efficiency.
| Agent Type | Use Case |
|---|---|
| Static | Fast, lightweight builds; always available |
| Autoscaled | Resource-intensive builds; cost-optimized |
Example: Run a small static agent alongside the server for quick jobs. The autoscaler provisions powerful VMs only when the static agent is at capacity.
Use labels to route workflows:
Static agent configuration:
Workflow targeting autoscaled agents (.crow.yaml):
The autoscaler checks for available agents before provisioning. If a static agent can handle the workload, no new VM is created.
Multiple Autoscalers
Section titled “Multiple Autoscalers”A single Crow server can use multiple autoscalers simultaneously. Each autoscaler runs as an independent process with its own registration token, provider configuration, and scaling limits.
Why Use Multiple Autoscalers
Section titled “Why Use Multiple Autoscalers”Multiple autoscalers let you target different cloud providers from a single server, for example, Hetzner for Linux builds and Azure for Windows builds.
You can also provision different instance sizes, using small VMs for unit tests and large VMs for integration tests.
Multi-region setups are possible too, placing agents in eu-west for European teams and us-east for US teams.
For cost optimization, non-urgent work can run on spot or preemptible instances while time-sensitive builds use on-demand capacity.
Finally, you can serve different architectures by provisioning amd64 agents from one provider and arm64 agents from another.
How It Works
Section titled “How It Works”Each autoscaler reports its capabilities to the server via heartbeat. The server uses two mechanisms to route workflows to the right autoscaler:
-
Agent labels (
CROW_AGENT_LABELSinsideCROW_AGENT_ENV) — the autoscaler reports these to the server, which uses them to determine whether the autoscaler can provision agents for a given workflow. A workflow’slabels:must match an autoscaler’s reported labels for that autoscaler to handle it. -
Filter labels (
CROW_FILTER_LABELS) — the autoscaler uses these locally to decide which queued tasks count toward its scaling decisions. Without this, every autoscaler would see all pending tasks and try to scale up for work meant for a different autoscaler.
Example: Dual-Provider Setup
Section titled “Example: Dual-Provider Setup”Register two autoscalers on the server and note their tokens.
Workflows select their tier with labels: