Skip to content

Instantly share code, notes, and snippets.

@waiyanwh
Last active April 27, 2022 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waiyanwh/ea37f17cb6ca17e7cd17aced694adbfa to your computer and use it in GitHub Desktop.
Save waiyanwh/ea37f17cb6ca17e7cd17aced694adbfa to your computer and use it in GitHub Desktop.
AWS gitlab runner autoscaling
concurrent = 4
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Autoscale runner"
limit = 8
url = "https//gitlab.com/"
token = "Your Token Here"
executor = "docker+machine"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "alpine:latest"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = true
volumes = ["/cache"]
shm_size = 0
[runners.cache]
Type = "s3"
Shared = true
[runners.cache.s3]
ServerAddress = "s3.amazonaws.com"
AccessKey = "<your AWS Access Key ID>"
SecretKey = "<your AWS Secret Access Key>"
BucketName = "<the bucket where your cache should be kept>"
BucketLocation = "ap-southeast-1"
[runners.cache.gcs]
[runners.machine]
IdleCount = 0
IdleTime = 60
MachineDriver = "amazonec2"
MachineName = "gitlab-docker-machine-%s"
MachineOptions = ["amazonec2-access-key=XXXX","amazonec2-secret-key=XXXX","amazonec2-region=ap-southeast-1", "amazonec2-vpc-id=XXXX", "amazonec2-subnet-id=XXXX", "amazonec2-zone=XXXX", "amazonec2-ami=ami-xxxxxxxxxxxx", "amazonec2-use-private-address=true", "amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,true,gitlab-runner-autoscale,true", "amazonec2-security-group=docker-machine-scaler", "amazonec2-instance-type=m4.large", "amazonec2-request-spot-instance=true", "amazonec2-spot-price=0.04"]
OffPeakTimezone = ""
OffPeakIdleCount = 0
OffPeakIdleTime = 1200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment