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

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

问题描述

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

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

我不明白第二个 Cloud Storage Build 来自哪里,但它似乎不受我的 yaml 文件中的设置或我的全局 GCP 设置的影响.

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

gcloud config set app/cloud_build_timeout 1200gcloud 配置集构建/超时 1200gcloud 配置集容器/构建超时 1200

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

非常感谢您提供任何见解 - 我觉得我已经用尽了我能想到的 Google 搜索关键字的所有可能组合!

解决方案

此超时错误来自应用引擎部署本身,默认情况下有 10 分钟超时.

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

步骤:- 名称:'gcr.io/cloud-builders/gcloud'入口点:'bash'args: ['-c', 'gcloud config set app/cloud_build_timeout 1200 &&gcloud 应用部署']超时:1200s

更新

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

步骤:- 名称:'gcr.io/cloud-builders/gcloud'参数:['应用程序','部署']超时:1200s超时:1200s

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

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.

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

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.

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

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.

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.

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.

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

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.

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

解决方案

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

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

Update

Actually simpler solution:

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

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

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