为什么我不能在Google Cloud Build上覆盖超时? [英] Why can't I override the timeout on my Google Cloud Build?

查看:133
本文介绍了为什么我不能在Google Cloud Build上覆盖超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google Cloud Build设置CI管道.

I am attempting to setup a CI Pipeline using Google Cloud Build.

我正在尝试部署构建时间很长的MeteorJS应用-GCB的默认构建超时为10分钟,建议

I am attempting to deploy a MeteorJS app which has a lengthy build time - the default build timeout for GCB is 10 minutes and it was recommended here that I increase the timeout.

我已经设置了cloudbuild.yaml文件,并将timeout选项增加到20分钟:

I have setup my cloudbuild.yaml file with the timeout option increased to 20 minutes:

steps:
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['app', 'deploy']
timeout: 1200s

我在与Bitbucket Repo连接的GCB中有一个Trigger设置,当我进行更改并触发Trigger时,我得到2个新版本-一个来自Bitbucket,另一个来自Google Cloud Storage.

I have a Trigger setup in GCB connected to a Bitbucket Repo and when I push a change and the Trigger fires, I get 2 new builds - one coming from Bitbucket and one whose source is Google Cloud Storage.

一旦经过10分钟的构建时间,Cloud Storage的构建将超时,这将导致Bitbucket构建也因Error Response: [4] DEADLINE_EXCEEDED

Once 10 minutes of build time has elapsed, the build from Cloud Storage will timeout which will cause the Bitbucket build to fail as well with Error Response: [4] DEADLINE_EXCEEDED

有时,无论出于何种原因,Cloud Storage构建都会在不到10分钟的时间内完成,这将使Bitbucket构建成功完成并部署.

Occasionally, for whatever reason, the Cloud Storage build will finish in under 10 minutes which will allow the Bitbucket build to finish successfully and deploy.

如果我尝试取消/停止Cloud Storage构建,它也会停止Bitbucket构建.

If I attempt to cancel/stop the Cloud Storage build, it will also stop the Bitbucket build.

下面的屏幕快照显示了两次完全相同的构建尝试,但结果不同.

The screenshot below shows 2 attempts of the exact same build with differing results.

我不知道第二个Cloud Storage Build的来源,但似乎不受yaml文件中的设置或全局GCP设置的影响.

I do not understand where this second Cloud Storage Build is coming from, but it does not seem to be affected by the settings in my yaml file or my global GCP settings.

我试图从gcloud CLI运行以下命令:

I have attempted to run the following commands from the gcloud CLI:

gcloud config set app/cloud_build_timeout 1200
gcloud config set builds/timeout 1200
gcloud config set container/build-timeout 1200

我还尝试使用CPU较高的构建机器来加快此过程,但似乎没有任何效果.

I have also attempted to use a high CPU build machine to speed up the process but it did not seem to have any effect.

任何见识将不胜感激-我觉得我已经想尽了所有可能的Google搜索关键字组合!

Any insight would be greatly appreciated - I feel that I have exhausted every possible combination of Google Search keywords I can think up!

推荐答案

此超时错误来自App Engine部署本身,默认情况下具有10分钟的超时时间.

This timeout error comes from app engine deployment itself which has 10 min timeout by default.

您将需要像这样更新容器本身内部的app/cloud_build_timeout属性:

You will need to update app/cloud_build_timeout property inside container itself like this:

steps:
- name: 'gcr.io/cloud-builders/gcloud'
  entrypoint: 'bash'
  args: ['-c', 'gcloud config set app/cloud_build_timeout 1200 && gcloud app deploy']
timeout: 1200s

更新

实际上更简单的解决方案:

steps:
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['app', 'deploy']
  timeout: 1200s
timeout: 1200s

这篇关于为什么我不能在Google Cloud Build上覆盖超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆