在哪里为所有构建的gcloud步骤超时设置全局限制? [英] Where is set global limit for gcloud steps timeout for all builds?
问题描述
在哪里可以找到gcloud构建步骤超时的全局限制?
Where can I find global limit for gcloud build step timeout?
这是我的gcloud构建配置:
This is my gcloud build config:
steps:
- name: 'gcr.io/cloud-builders/yarn'
- name: 'gcr.io/cloud-builders/yarn'
args: ['build-nginx-config']
- name: 'gcr.io/cloud-builders/yarn'
args: ['build']
timeout: 3601s
...
timeout: 7200s
这是我尝试运行此构建时得到的:
And this is what I get when I try to run this build:
[10:41:45]ERROR: (gcloud.builds.submit) INVALID_ARGUMENT: invalid build:
invalid timeout in build step #2:
build step timeout "1h0m1s" must be <= build timeout "1h0m0s"
所以在某个地方,我们为逐步超时设置了最大值,但我找不到这个地方.有什么建议吗?
So somewhere we have setup max for step timeout and I cannot find this place. Any advice?
UPD ,因此构建步骤超时不能超过1小时.
但是您可以完全跳过它,在这种情况下,步超时是无限的.剩下的唯一限制-是整体构建超时限制.
UPD so it looks like build step timeout cannot be more than 1h.
But you can skip it completely and in this case step timeout is unlimited. The only limit remaining - is the overall build timeout limit.
推荐答案
您可以通过在 cloudbuild的根目录级别添加
文件,如下所示: timeout
元素来设置整个构建执行的全局超时.yaml
You can set the global timeout for your whole build execution by adding the timeout
element at the root level of your cloudbuild.yaml
file, like so:
steps:
- name: 'gcr.io/cloud-builders/yarn'
- name: 'gcr.io/cloud-builders/yarn'
args: ['build-nginx-config']
- name: 'gcr.io/cloud-builders/yarn'
args: ['build']
timeout: 3601s
...
timeout: 3602s // This value is > to your build step's timeout
如所述,整个构建超时的默认值为10分钟.这里.您可以通过在文件中明确设置该值并将其设置为最长24h来覆盖此值.
The default value for the whole build timeout is 10min, as documented here. You can override this value by setting it explicitly in your file and set a value to up to 24h.
如果您通过 gcloud
工具提交构建文件(据我所知),默认情况下默认超时也会设置为10分钟,同时
If you submit your build via the gcloud
tool (which I see you do), the default timeout is set to 10min by default also there. You can override it by running:
gcloud config set builds/timeout 7200
这篇关于在哪里为所有构建的gcloud步骤超时设置全局限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!