Skip to content

Add DigitalOcean autoscaler support#580

Open
RJW34 wants to merge 2 commits into
woodpecker-ci:mainfrom
RJW34:feat/digitalocean-provider
Open

Add DigitalOcean autoscaler support#580
RJW34 wants to merge 2 commits into
woodpecker-ci:mainfrom
RJW34:feat/digitalocean-provider

Conversation

@RJW34

@RJW34 RJW34 commented Apr 12, 2026

Copy link
Copy Markdown

Summary

Adds DigitalOcean as a cloud provider for the woodpecker-ci autoscaler, using the official godo SDK.

Closes #103

What's implemented

  • providers/digitalocean/provider.goProvider struct implementing engine.Provider
    • DeployAgent — creates droplets with configurable region, size, image, SSH keys, tags, IPv6, VPC
    • RemoveAgent — finds droplet by name via paginated list, then deletes
    • ListDeployedAgentNames — lists droplets filtered by pool tag, with pagination support
  • providers/digitalocean/flags.go — CLI flags following the same pattern as other providers
    • digitalocean-api-token, digitalocean-region, digitalocean-size, digitalocean-image
    • digitalocean-ssh-keys, digitalocean-tags, digitalocean-ipv6, digitalocean-vpc-uuid
    • Deprecated digitalocean-user-data (matching the deprecation pattern in other providers)
  • providers/digitalocean/provider_test.go — 12 unit tests with interface-based mocking
    • DeployAgent: invalid userdata, success, create failure, SSH keys, VPC UUID
    • RemoveAgent: success, not found, list failure, delete failure
    • ListDeployedAgentNames: matching agents, empty list, list failure
  • cmd/woodpecker-autoscaler/main.go — wired digitalocean case in setupProvider() + flags
  • README.md — marked DigitalOcean as implemented

Design decisions

  • Used DropletsService interface for testability (same pattern as hetznercloud's hcapi.Client)
  • RemoveAgent uses paginated List + name matching since godo's Droplets.GetByName is not in the standard interface
  • Tags are used for pool identification (similar to Vultr's tag-based filtering)
  • Cloud-init user data follows the existing engine.RenderUserDataTemplate pattern

Test plan

  • go test ./providers/digitalocean/... — 12/12 pass
  • go test ./... — all existing tests still pass
  • gofmt — clean
  • go vet — clean
  • go mod tidy — clean

Implements the DigitalOcean cloud provider adapter using the official
godo SDK. Follows the same patterns as the existing Hetzner Cloud and
Vultr providers.

Features:
- Droplet creation with configurable region, size, image, SSH keys
- IPv6 and VPC UUID support
- Tag-based pool filtering for agent listing
- Paginated droplet listing for RemoveAgent and ListDeployedAgentNames

Closes woodpecker-ci#103
@RJW34

RJW34 commented Apr 13, 2026

Copy link
Copy Markdown
Author

Hi maintainers — just checking in on this PR. Happy to address any feedback or make adjustments if needed. The implementation follows the existing provider patterns (Hetzner, Vultr, Linode) and includes full test coverage. Let me know if there's anything I can do to help move this forward. Thanks!

@6543 6543 added feature Add new feature new provider Add new cloud provider labels Apr 21, 2026
@6543

6543 commented Apr 21, 2026

Copy link
Copy Markdown
Member

please resolve conflicts

PS: sorry the autoscaler hat not the most focus the past months as woodpecker itselfe got quite some improvements :)

@xoxys xoxys changed the title feat(providers): add DigitalOcean autoscaler support Add DigitalOcean autoscaler support Apr 24, 2026
Category: category,
},
// TODO: Deprecated remove in v2.0
&cli.StringFlag{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont add deprecations we remove them...

droplets DropletsService
}

func New(_ context.Context, c *cli.Command, cfg *config.Config) (engine.Provider, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolfe config on new and throuw error

not on first agent development!

see #605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Add new feature new provider Add new cloud provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Digital Ocean Autoscaler support

3 participants