garm-provider-vultr

Version, currently 0.1.01 version
  • 0.1.0latestMar 1, 2026

github.com/Youngv/garm-provider-vultr

No description declared in shard.yml.

0 stars
0 dependents
License: Apache-2.0

Installation

# Add this to your shard.yml
dependencies:
  garm-provider-vultr:
    github: Youngv/garm-provider-vultr
    version: ~> 0.1.0

Then run:

shards install

shard.yml

Crystal
>= 1.14.0
License
Apache-2.0
Author
Youngv
Target
  • garm-provider-vultr from src/main.cr

Dependencies

This version declares no dependencies.

README

garm-provider-vultr

A garm external provider for Vultr, written in Crystal.

This provider enables garm to manage GitHub Actions self-hosted runners on Vultr cloud instances.

Prerequisites

  • Crystal >= 1.14.0
  • A Vultr account with API access
  • A running garm installation

Building

Development build

shards build --release

Static build (for Docker / container deployment)

The garm container does not have system libraries like libz.so. You must build a statically linked binary:

docker run --rm -v $(pwd):/workspace -w /workspace \
  crystallang/crystal:latest-alpine \
  sh -c "shards install --production && crystal build src/main.cr -o bin/garm-provider-vultr --release --static --no-debug && strip bin/garm-provider-vultr"

The binary will be available at bin/garm-provider-vultr.

Configuration

Provider Config File

Create a JSON configuration file (e.g., /etc/garm/vultr-provider.json):

{
  "api_key": "",
  "region": "ewr",
  "plan": "vc2-1c-1gb",
  "os_id": 1743,
  "sshkey_id": [],
  "enable_ipv6": false,
  "firewall_group_id": "",
  "enable_vpc": false,
  "attach_vpc": []
}
FieldTypeRequiredDescription
api_keystringNo*Vultr API key. Prefer using VULTR_API_KEY env var instead.
regionstringYesDefault Vultr region (e.g., ewr, lax, ord). See Vultr regions.
planstringYesDefault instance plan (e.g., vc2-1c-1gb). See Vultr plans.
os_idintYes**Default OS template ID (e.g., 1743 for Ubuntu 22.04 x64).
sshkey_idstring[]NoSSH key IDs to inject into instances.
enable_ipv6boolNoEnable IPv6 on instances.
firewall_group_idstringNoVultr firewall group ID to apply.
enable_vpcboolNoEnable VPC for instances.
attach_vpcstring[]NoVPC IDs to attach to instances.

* The API key can be provided via the VULTR_API_KEY environment variable (recommended) or in the config file.

** At least one OS source must be provided: os_id, snapshot_id, or image_id (via pool extra_specs).

Pool Extra Specs

Per-pool overrides can be set in the garm pool configuration under extra_specs:

{
  "region": "lax",
  "plan": "vc2-2c-4gb",
  "os_id": 2136,
  "snapshot_id": "",
  "image_id": "",
  "sshkey_id": ["ssh-key-1"],
  "enable_ipv6": true,
  "firewall_group_id": "fw-123",
  "enable_vpc": true,
  "attach_vpc": ["vpc-1"],
  "extra_packages": ["docker.io"],
  "disable_updates": false,
  "enable_boot_debug": false
}
FieldTypeDescription
regionstringOverride default Vultr region.
planstringOverride default instance plan.
os_idintOverride default OS template ID.
snapshot_idstringUse a Vultr snapshot instead of os_id.
image_idstringUse a Vultr marketplace image instead of os_id.
sshkey_idstring[]Override SSH key IDs.
enable_ipv6boolEnable IPv6 on instances.
firewall_group_idstringOverride firewall group ID.
enable_vpcboolEnable VPC for instances.
attach_vpcstring[]VPC IDs to attach.
extra_packagesstring[]Extra packages to install via cloud-init (e.g., ["docker.io"]).
disable_updatesboolDisable OS updates on boot.
enable_boot_debugboolEnable boot debug logging.

Pool extra_specs override the provider config defaults.

Environment Variables

VariableDescription
VULTR_API_KEYVultr API key (preferred over config file).

The following are set by garm automatically:

VariableDescription
GARM_COMMANDThe operation to execute.
GARM_PROVIDER_CONFIG_FILEPath to the provider config file.
GARM_CONTROLLER_IDUnique garm controller ID.
GARM_POOL_IDPool ID (for CreateInstance, ListInstances).
GARM_INSTANCE_IDInstance provider ID (for GetInstance, DeleteInstance, Start, Stop).
GARM_POOL_EXTRASPECSBase64-encoded pool extra specs JSON.
GARM_INTERFACE_VERSIONProvider interface version.

Garm Configuration

Add the provider to your garm config:

[[provider]]
name = "vultr"
description = "Vultr provider"
provider_type = "external"
  [provider.external]
  config_file = "/etc/garm/vultr-provider.json"
  provider_executable = "/usr/local/bin/garm-provider-vultr"
  interface_version = "0.1.1"
  environment_variables = ["VULTR_API_KEY=your-api-key-here"]

Supported Commands

CommandDescription
CreateInstanceCreates a new Vultr instance with cloud-init for runner bootstrap.
DeleteInstanceDeletes a Vultr instance (idempotent - no-op if already deleted).
GetInstanceReturns instance details.
ListInstancesLists all instances for a given pool.
RemoveAllInstancesRemoves all instances tagged with the controller ID.
StartStarts (boots) a stopped instance.
StopStops (halts) a running instance.

Common Vultr OS IDs

OS IDOS
1743Ubuntu 22.04 x64
2136Ubuntu 24.04 x64
1946Debian 12 x64
2076Rocky Linux 9 x64
2187AlmaLinux 9 x64

Troubleshooting

  • API errors: Check that VULTR_API_KEY is set and valid.
  • Instance not creating: Verify region, plan, and os_id are valid Vultr values.
  • Runner not registering: Check the instance's cloud-init logs at /var/log/cloud-init-output.log.
  • Logs: The provider writes diagnostic logs to stderr. Check garm's logs for provider output.

License

Apache-2.0