Search code examples
google-cloud-platformgoogle-kubernetes-enginegoogle-cloud-build

Google Cloud Build Time Out after 10 mins


I have a Google Cloud Build build that times out after 10 min. The build status is set to "Build failed (timeout)" and I'm okay with it taking longer than 10 minutes.


Solution

  • We can give time out manually as below using YAML :

    In cloudbuild.yaml you have to add something like timeout: 1200s

    E.g.

    steps:
    - name: 'gcr.io/cloud-builders/docker'
      args: [ 'build', '-t', 'gcr.io/[PRODUCT_ID]/[CONTAINER_IMAGE]', '.' ]
    images: 
    - 'gcr.io/[PRODUCT_ID]/[CONTAINER_IMAGE]'
    timeout: 1200s
    

    Note : The maximum value that can be applied to timeout is 24 hours. The timeout must be specified in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s" . If timeout is not set, a default timeout of 10 minutes will apply to the build.

    See the full definition of a Build Resource and configuring the deployment in the documentation.