This tool allows you to quickly run your Cloud Build configuration against multiple machine types in parallel.
Once the jobs are complete you get a read out of the time each took and how much they cost.
This repo includes and example cloudbuild.yaml
that compiles the Linux kernel.
Below are the steps to test out that configuration across the available Cloud Build machine types.
-
Clone this repo and change directories to the
example
folder:git clone https://github.com/viglesiasce/cloudbuild-optimizer cd cloudbuild-optimizer/example
-
Download the latest release:
curl -L "https://github.com/viglesiasce/cloudbuild-optimizer/releases/download/v0.2.0/cloudbuild-optimizer_0.2.0_$(uname)_$(uname -m)" -o cloudbuild-optimizer chmod +x cloudbuild-optimizer
-
Run the tool.
$ ./cloudbuild-optmizer
You should see output as follows:
View your builds here: https://console.cloud.google.com/cloud-build/builds Starting build on DEFAULT... Starting build on E2_HIGHCPU_32... Starting build on E2_HIGHCPU_8... Build completed on E2_HIGHCPU_32 in 5.64 minutes. Build completed on E2_HIGHCPU_8 in 8.56 minutes. Build completed on DEFAULT in 41.50 minutes. Build took 5m38.502519808s minutes on E2_HIGHCPU_32 and cost $0.361 Build took 8m33.552805059s minutes on E2_HIGHCPU_8 and cost $0.137 Build took 41m29.819853143s minutes on DEFAULT and cost $0.124