Topics Map > GitLab
Topics Map > Shared Tools

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.)

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.

Additional Resources



Keywords:
gitlab gitlabci ci/cd ci cd aws docker shared runner 
Doc ID:
121471
Owned by:
Benjamin S. in Shared Tools
Created:
2022-09-20
Updated:
2024-09-13
Sites:
DoIT Help Desk, Shared Tools