2

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:

  1. failed build is using and fetching the source and images from gae_runtime Pulling image: asia.gcr.io/gae-runtimes/utilities/buildpack-shim:base_20211020a_18_04_RC00
  2. successful build is fetching the image from Pulling image: asia.gcr.io/fn-img/utilities/buildpack-shim:base_20211020a_18_04_RC00.

How to make the build to pull these image from fn-img and not gae-runtimes?

llompalles
  • 3,072
  • 11
  • 20
Haaru
  • 23
  • 1
  • 5

1 Answers1

0

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 the gcloud app deploy command and set a timeout 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 if gcloud 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.

llompalles
  • 3,072
  • 11
  • 20
  • Can you please let me know the the use of gcloud app deploy command to set timeout in the args field. Or else can you give a sample config.yaml file to configure the args with timeout. – Haaru Nov 12 '21 at 08:49
  • I edited my answer with the config.yaml snippet, but also note that this is only possible in the Flexible environment. – llompalles Nov 17 '21 at 12:32