Shared Windows Runners for GitLab.com
Overview
We provide Linux shared autoscaling runners, with gitlab-org&1768 (closed) we now have an autoscaler for Windows, where it will work similarly to the Linux autoscaler where it will provision a VM
Proposal
We will most likely need more than 1 Runner manager for HA, we can start with 2 Runner managers:
-
Create a new Windows machine, we don't know if the size is good, but we can start with a
n1-standard-2
machine on GCP. This should/can use thewindows-server-2019-dc-core-v20190827
-
Install autoscaler
- Configuration TBA
-
Install GitLab Runner, latest version
- Install it as a service
-
Register a new Shared Runner using the
custom
executor- Add the following tags
windows
- Don't allow Runner to run jobs without tags so each job that it runs will have to have the
windows
tag.
- Add the following tags
-
Update
config.toml
be like the following:concurrent = 350 check_interval = 1 listen_address = "0.0.0.0:9402" sentry_dsn = "xxx" [[runners]] request_concurrency = 10 # Taken from linux shared runner managers name = "windows-autoscaler" url = "https://gitlab.com/" token = "xxx" executor = "custom" builds_dir = "C:\build" cache_dir = "C:\cache" limit = 350 # Taken from linux shared runner managers [runners.custom] prepare_exec = "C:\autoscaler" # Path to autoscaler installation prepare_args = ["custom", "prepare"] run_script = "C:\autoscaler" # Path to autoscaler installation run_args = ["custom", "run"] cleanup_script = "C:\autoscaler" # Path to autoscaler installation cleanup_args = ["custom", "cleanup"]
Ideally, all the configuration should be within chef or some other kind of automation so we can easily handle version upgrades. This may not make the very first iteration of the MVC though.
GCP Environment
- A Windows CI specific GCP project, e.g.
gitlab-ci-windows
- Two network segments, one for runner-managers and one for the runner-job VM's to make firewall rules easier to define/follow
- Runner managers tagged with
runner-manager
- Runner jobs tagged with
runner-job
- Firewall rules as defined in gitlab-org/gitlab-runner#4623 (comment 215251222)
To be discussed
- Size of the machine that runner manager will run on
- The number of runner managers we have, more than 1 is suggested for HA.
- How the runner-managers should run, VM's or k8s? (Probably VM's to start)