ForkScalewayScalewaypublished Nov 10, 2023seen 5d

scaleway/woodpecker-autoscaler

forked from woodpecker-ci/autoscaler

Open original ↗

Captured source

source ↗
published Nov 10, 2023seen 5dcaptured 17hhttp 200method plain

scaleway/woodpecker-autoscaler

Description: Scale your woodpecker agents automatically to the moon and back based on the current load.

Language: Go

License: Apache-2.0

Stars: 1

Forks: 0

Open issues: 0

Created: 2023-11-10T15:03:22Z

Pushed: 2024-04-06T09:01:30Z

Default branch: main

Fork: yes

Parent repository: woodpecker-ci/autoscaler

Archived: no

README:

Autoscaler

Scale your woodpecker agents automatically to the moon and back based on the current load.

Usage

If you are using docker-compose you can add the following to your docker-compose.yml file:

# docker-compose.yml
version: '3'

services:
woodpecker-server:
image: woodpeckerci/woodpecker-server:next
[...]

woodpecker-autoscaler:
image: woodpeckerci/autoscaler:next
restart: always
depends_on:
- woodpecker-server
environment:
- WOODPECKER_SERVER=https://your-woodpecker-server.tld # the url of your woodpecker server / could also be a public url
- WOODPECKER_TOKEN=${WOODPECKER_TOKEN} # the api token you can get from the UI https://your-woodpecker-server.tld/user
- WOODPECKER_MIN_AGENTS=0
- WOODPECKER_MAX_AGENTS=3
- WOODPECKER_WORKFLOWS_PER_AGENT=2 # the number of workflows each agent can run at the same time
- WOODEPCKER_GRPC_ADDR=https://grpc.your-woodpecker-server.tld # the grpc address of your woodpecker server, publicly accessible from the agents
- WOODEPCKER_GRPC_SECURE=true
- WOODPECKER_AGENT_ENV= # optional environment variables to pass to the agents
- WOODPECKER_PROVIDER=hetznercloud # set the provider, you can find all the available ones down below
- WOODPECKER_HETZNERCLOUD_API_TOKEN=${WOODPECKER_HETZNERCLOUD_API_TOKEN} # your api token for the Hetzner cloud

The agents will use WOODEPCKER_GRPC_ADDR and a token automatically generated by the autoscaler to connect to the server.Therefore the WOODEPCKER_GRPC_ADDR has to be publicly accessible from the newly created agents. Check for example how you could use caddy to expose the grpc connection.

Roadmap

  • [ ] Add support for multiple providers
  • [x] Hetzner Cloud
  • [ ] Amazon AWS
  • [ ] Google Cloud
  • [ ] Azure
  • [ ] Digital Ocean
  • [x] Linode (temp disabled until security issue was addressed)
  • [ ] Oracle Cloud
  • [ ] Equinix Metal
  • [ ] Cleanup agents
  • [x] Remove agents which exist on the provider but are not in the server list (they wont be able to connect to the server anyway as their is no agent token for them)
  • [x] Remove agents from server list which do not exist on the provider
  • [ ] Remove agents which have not connected for a long time
  • [x] Release as container image
  • [x] Add docs
  • [ ] Support agent deployment with specific attributes (e.g. platforms, architectures, etc.)