Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is set global limit for gcloud steps timeout for all builds?

Where can I find global limit for gcloud build step timeout?

This is my gcloud build config:

steps:
  - name: 'gcr.io/cloud-builders/yarn'
  - name: 'gcr.io/cloud-builders/yarn'
    args: ['build-nginx-config']
  - name: 'gcr.io/cloud-builders/yarn'
    args: ['build']
    timeout: 3601s
  ...
timeout: 7200s

And this is what I get when I try to run this build:

[10:41:45]ERROR: (gcloud.builds.submit) INVALID_ARGUMENT: invalid build:
invalid timeout in build step #2:
build step timeout "1h0m1s" must be <= build timeout "1h0m0s"

So somewhere we have setup max for step timeout and I cannot find this place. Any advice?

UPD so it looks like build step timeout cannot be more than 1h.
But you can skip it completely and in this case step timeout is unlimited. The only limit remaining - is the overall build timeout limit.

like image 282
chestozo Avatar asked Nov 20 '25 02:11

chestozo


1 Answers

You can set the global timeout for your whole build execution by adding the timeout element at the root level of your cloudbuild.yaml file, like so:

steps:
  - name: 'gcr.io/cloud-builders/yarn'
  - name: 'gcr.io/cloud-builders/yarn'
    args: ['build-nginx-config']
  - name: 'gcr.io/cloud-builders/yarn'
    args: ['build']
    timeout: 3601s
  ...
timeout: 3602s // This value is > to your build step's timeout

The default value for the whole build timeout is 10min, as documented here. You can override this value by setting it explicitly in your file and set a value to up to 24h.

If you submit your build via the gcloud tool (which I see you do), the default timeout is set to 10min by default also there. You can override it by running:

gcloud config set builds/timeout 7200
like image 111
LundinCast Avatar answered Nov 22 '25 16:11

LundinCast