My gcloud app deploy fails due to timeout during build. After looking at logs, its taking more than 10 min and the App Engine Standard timeout can't be changed. But the previous all my builds went fine and the only change I noticed between successful and failed build logs are:
How to make the build to pull these image from fn-img and not gae-runtimes?
It turns out that you can only configure timeouts for App Engine builds if you are using the Flexible environment. You can configure the timeout by using Cloud Build to deploy your App Engine Standard service. As such you could avoid the 10 minutes timeout limit.
In this documentation page there is a step by step guide on how to do it but basically the key step is this one:
In the
args
field, invoke thegcloud app deploy
command and set atimeout
for App Engine to use when it invokes Cloud Build. This is required because Cloud Build build steps and builds have a default timeout of 10 minutes and App Engine deployments could take longer than that to complete. Specifying a longer timeout will make sure that the build doesn't timeout ifgcloud app deploy
takes longer than 10 minutes to complete.
steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args: ['-c', 'gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy']
timeout: '1600s'
On the other hand, the App Engine standard environment does not allow the build timeout to be configured. If you're using Cloud Build for deploying on the App Engine standard environment, and your build is failing with a timeout error, consider using the App Engine flexible environment or Cloud Run instead of the App Engine standard environment.