Set up a GCP VM build infrastructure
Currently, this feature is behind the Feature Flag CI_VM_INFRASTRUCTURE
. Contact Harness Support to enable the feature.
This topic describes how to set up a CI build infrastructure in Google Cloud Platform (GCP). To do this, you will create an Ubuntu VM and then install a Harness Delegate and Drone VM Runner on it. The runner creates VMs dynamically in response to CI build requests.
This is one of several CI build infrastructure options. For example, you can also set up a Kubernetes cluster build infrastructure.
The following diagram illustrates a CI build farm. The Harness Delegate communicates directly with your Harness instance. The VM Runner maintains a pool of VMs for running builds. When the delegate receives a build request, it forwards the request to the runner, which runs the build on an available VM.
Prepare the Google Cloud VM
These are the requirements to configure the Google Cloud VM. This is the primary VM where you will host your Harness Delegate and runner.
-
Log into the Google Cloud Console and launch a VM to host your Harness Delegate and runner.
- Select a machine type with 4 vCPU and 16 GB memory or more. Harness recommends an Ubuntu 20.04 LTS machine image, such as Focal or Jammy.
- To find images to use on Google Compute Engine, run
gcloud compute images list
. Valid image references follow the format ofprojects/PROJECT/global/images/IMAGE
. For example:projects/docs-test/global/images/ubuntu-pro-1804-bionic-v20220131
.
-
Configure the VM to allow ingress on ports 22 and 9079.
-
SSH into the VM, if you haven't done so already.
-
Run
gcloud auth application-default login
to create anapplication_default_credentials.json
file at/home/$(whoami)/.config/gcloud
.