aws-samples / amazon-ec2-gitlab-runner

This repository contains code to deploy and manage Gitlab Runners on Amazon EC2.
MIT No Attribution
58 stars 36 forks source link

Questions #2

Closed syavich closed 2 years ago

syavich commented 2 years ago

Hello,

  1. Is it possible to use this stack with "shell" gitlab-runner executor instead of docker?
  2. It's not clear when does the cluster scales in in order to reduce amount of unused nodes. Thanks in advance
qisylvia commented 2 years ago

@syavich Thanks for your questions.

  1. The stack is written specifically for docker executor. We have not experimented with shell executor. I suppose you could replace it with shell executor but work is required to update the Launch Template to create shell executors.
  2. A CloudWatch Event Rule "ExecuteRunnerMonitor" runs the Runner monitor lambda function every minute (See the gitlbab-runner.yaml file). The function adjusts the desired capacity of the runner autoscaling group according to the workload. The calculation is in the index.ts. file: let desiredCapacity = (metrics.currentJobCount + newJobCountBeforeScaling) / concurrentJobsPerRunner desiredCapacity = Math.ceil(desiredCapacity) // Make sure we dont go below our min desiredCapacity = Math.max(desiredCapacity, metrics.minInstances) // Make sure we dont go above our max desiredCapacity = Math.min(desiredCapacity, metrics.maxInstances)

Hope that answers your questions.