Setting Up Goma
This section will describe steps needed to run a dummy Goma server. At the end ot this section our Goma server will be ready to schedule remote jobs using the BuildGrid backend.
Setting up Server
Creating Service Account
Goma server needs a Google Cloud service account in order to authenticate the clients. Therefore, you’ll need to create a service account in GCP and download its key.
-
Follow this guide to create a service account. Fill the requested fields with anything you like. This does not matter for now.
-
Once the service account is ready, create and download the credentials in JSON format. Save the file somewhere - make sure it will be readable by the user running Goma server. This guide has all that you need to complete this step.
Getting the Code
Go and checkout the goma server with:
Patching Goma
As mentioned previously BuildGrid worker properties must match the one requested by the Goma server or BuildGrid scheduler won’t be able to schedule an actual job. Goma server requests the container-image
property to be set on the worker but BuildGrid does not allow such property to be set. Therefore either BuildGrid or Goma server needs to be patched. We’ll do the latter as in this particular case patching Goma will be easier.
In Goma server repo, edit cmd/remoteexec_proxy/main.go
and apply following patch:
This simply removes the unsupported property so the build requests won’t be flagged with it making BuildGrid schedule the remote build.
Once patched, we’ll run the Goma server:
The above command will:
- make Goma server listen for incoming client connections on port
5050
- connect to BuildGrid at
localhost:50051
- use
goma-test
instance - use insecure connection to RBE backend
If everything went well you should get similar output:
Getting the Goma Client
We won’t be building the Goma client from sources (although we could) - we’ll use the precompiled binaries that are available through CIPD (Chrome Infrastructure Package Deployment). For that purpose we’ll install chromium’s depot_tools
(we’ll need it later anyway). Follow the depot_tools install guide to setup the required tools (do not checkout the chromium code yet - we just need depot_tools
at this stage). Once ready, run:
After that Goma client should be available in ~/goma
. Feel free to use a different install path - just remember to adjust all the commands copied from here so that the correct install path is used.