Skip to content

Custom runner with auto-sleep

In some cases (e.g., building plv8 for #14 (closed)) we need a powerful runner.

The idea is to have a powerful runner in AWS that automatically stops when not used:

  • create such a runner in AWS (one time job, can be automated though but first time it makes sense to do it manually)
  • if runner is not used for an hour, we stop the machine (via awscli or AWS API)
  • when it's needed again, it wakes up
  • additionally, we could use spot instances to optimize costs even more (but we need to make sure the EBS volumes is persistent and the jobs can be retried without the need to re-setup the environment – if VM is lost, the data is on EBS still, and we just need to get another VM)

Instance type to consider: m6a.2xlarge (can be reconsidered) – Intel, 8 vCPUs, 32 GiB RAM, $252/month regular cost, $127/month spot cost

Related: https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/

Edited by Nikolay Samokhvalov