DoIT Shared Tools - GitLab - Shared Runner
A shared runner is available to any GitLabCI job running in the DoIT GitLab instance. GitLab Runner is a utility created by GitLab to run CI/CD jobs for GitLabCI.
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.)