Provision runners in Google Cloud Compute Engine

Tier: Free, Premium, Ultimate Offering: GitLab.com
History

You can create a project or group runner for GitLab.com and provision it on your Google Cloud project. When you create a runner, the GitLab UI provides on-screen instructions and scripts to automatically provision the runner in your Google Cloud project.

A runner authentication token is assigned to your runner when you create it. A GRIT Terraform script uses this token to register the runner. The runner then uses the token to authenticate with GitLab when it picks up jobs from the job queue.

After provisioning, an autoscaling fleet of runners is ready to run CI/CD jobs in Google Cloud. The runner manager creates temporary runners automatically.

Prerequisites:

To create a group or project runner and provision it on Google Cloud:

  1. On the left sidebar, select Search or go to and find your group.
  2. Create a new runner.
    • To create a new group runner, select Build > Runners > New group runner.
    • To create a new project runner, select Settings > CI/CD > Runners > New project runner.
  3. In the Tags section, in the Tags field, enter the job tags to specify jobs the runner can run. To use the runner for jobs without tags in addition to the tagged jobs, select Run untagged.
  4. Optional. In the Configuration section, add runner description and additional configurations.
  5. Select Create runner.
  6. In the Platform section, select Google Cloud.
  7. In Environment, enter the following details of the Google Cloud environment:

    • Google Cloud project ID
    • Region
    • Zone
    • Machine type
  8. In Set up GitLab Runner, select Setup instructions. In the dialog:

    1. To enable the required services, service account, and permissions, in Configure Google Cloud project run the Bash script once for each Google Cloud project.
    2. Create a main.tf file with the configuration from Install and register GitLab Runner. The script uses the GitLab Runner Infrastructure Toolkit (GRIT) to provision the infrastructure on the Google Cloud project to execute your runner manager.

After you execute the scripts, a runner manager connects with the runner authentication token. The runner manager might take up to one minute to show as online and start receiving jobs.