DoIT Shared Tools - GitLab - Shared Runner
How to Use the Shared Runner
GitLabCI identifies the runners available for a job by tags defined in the gitlab-ci.yml file. To use the shared runner for the DoIT GitLab instance, use one or both of the following tags:
- aws
- docker
The tags must apply to all stages of the job that you want to use the shared runner. To use the shared runner for all stages, the tag can be set as a default at the top of the file, for example:
default:
tags:
- docker
Capabilities and Limitations of the Shared Runner
The shared runner resides in an Amazon Web Services (AWS) account managed by the DoIT Shared Tools team. It uses Docker Machine to create EC2 spot instances that run GitLabCI jobs for projects in DoIT's GitLab instance.
There is no persistent outgoing IP address for these spot instances. So any GitLabCI job that requires access to resources that are restricted to a certain IP space will fail on the shared runner.
GitLab users can set up their own dedicated runners for their GitLab Groups and Projects.
Advantages of Dedicated Runners
Advantages of a dedicated runner include:
- Greater availability, because it only runs jobs for your projects
- Ability to define a persistent IP address, so the runner can access IP-restricted resources
- Customization of the runner's configuration
- Customization of the runner's host environment (choice of OS, packages, software, etc.)
Advice on Dedicated Runners (not applicable if you use the Shared runner)
Update your runners! Build server issues can be difficult to diagnose. If your job has worked in the past but is now failing, do yourself a favor and first make sure your GitLab runner matches the current minor version of GitLab. You might save yourself a lot of time.
GitLab releases a new version of the GitLab Runner at minimum once per month when the new GitLab minor version is released. GitLab advises keeping your runner on the same minor version as the GitLab instance you're using. Patch versions GitLab Runner are distinct and only need action if the patch is relevant to what your runner does.