1

When attempting to deploy to Cloud Run using the gcloud run deploy I am hitting the 10m Cloud Build timeout limit. gcloud run deploy is working well as long as the build step does not exceed 10m. When the build step exceeds 10m, the build fails with the "Timed out" status as shown in below screenshot. AFAIK there are no arguments to gcloud run deploy that can set the Cloud Build timeout limit. gcloud run deploy docs are here: https://cloud.google.com/sdk/gcloud/reference/run/deploy

I've attempted to increase the Cloud Build timeout limit using gcloud config set builds/timeout 20m and gcloud config set container/build_timeout 20m, but these settings are not reflected in the execution details of the cloud build process when using gcloud run deploy.

In the GUI, this is the setting I want to change: enter image description here

Is it possible to increase the Cloud Build timeout limit using gcloud run deploy?

Andy Merlino
  • 178
  • 1
  • 7
  • 1
    What command do you use? Do you use the param `--source`? – guillaume blaquiere Feb 26 '21 at 14:43
  • @guillaumeblaquiere Hi. Yes I am using the --source command. Sorry I should have mentioned that. I also tried creating a configuration with builds/timout set to 20m and including the " --configuration=" command, but I did not have any luck with that either. Thanks! – Andy Merlino Feb 26 '21 at 17:13

3 Answers3

2

How about splitting the command into (more easily configured) constituents?

[I've not tried this]

Build the container image specifying the timeout :

gcloud builds submit --source=.... --timeout=...

Then reference the image that results when you gcloud run deploy:

gcloud run deploy ... --image=...
DazWilkin
  • 32,823
  • 5
  • 47
  • 88
2

I know this is answered and confirmed, but @DazWikin's solution was the harder way to solve this problem than @SimonKarman's solution.

For those who do not have the cloudbuild.yml file like myself, this solution still is a valid one, you just need to edit the one created by google itself. You can find it under builds > triggers > Desired Trigger (Edit)

enter image description here

enter image description here

Then when you open the editor you can apply the timeout. If you want other changes to the yaml file you can also checkout the schema here: https://cloud.google.com/build/docs/build-config-file-schema#yaml

Note: I am using cloudrun and this worked for me and therefore I am not 100% if it works with all builds generated by google

Hope it will be helpful for someone else in future :)

Mehdi Amenein
  • 937
  • 9
  • 23
1

If you're using a --source such as the cloudbuild.yaml you can add the following property to alter the timeout in seconds:

...
timeout: "1800s"
...

You can find this in the documentation

Simon Karman
  • 124
  • 11