如何在Google Cloud Build中更改机器类型并为特定位置设置配额。

huangapple go评论89阅读模式
英文:

How to change machine type in Google Cloud Build and set quota for specific location

问题

我正在使用Google Cloud Build。但是我的设置变得相当慢。

我正在尝试使用缓存,但我也想尝试在构建中使用更快的机器。

因此,我在我的cloudbuilds.yaml文件中指定了以下内容:

options:
  machineType: "E2_HIGHCPU_32"

然而,当我尝试构建时,我收到以下错误消息:

FAILED_PRECONDITION: generic::failed_precondition: 由于配额限制,无法在此区域运行此机器类型的构建

我尝试增加配额,但无法确定是哪个配额或如何操作。

我正在使用europe-west1区域进行构建。

有人能帮我解决这个问题吗?

英文:

I am using Google Cloud build. But my setup is getting quite slow.

Im experimenting with using caching, but I also want to try and use a faster machine for my builds.

Therefore I specified the following in my cloudbuilds.yaml file

options:
  machineType: "E2_HIGHCPU_32"

However, when I try to build I am getting the following error:

FAILED_PRECONDITION: generic::failed_precondition: due to quota restrictions, cannot run builds of this machine type in this region

I tried to increase the quota, but cannot figure out which one it is or how its done.

I am using the region europe-west1 for my builds.

Can anybody help me solve this?

答案1

得分: 1

创建一个新的构建触发器或修改现有的触发器,并确保将区域设置为**"全球",而不是"europe-west1"**或您特定的区域。

此外,转到cloudbuild设置,在工作池选项卡下创建一个与您在cloudbuild.yaml文件中指定的机器类型匹配的私有机器池。

英文:

Create a new build trigger or modify the existing trigger and make sure you leave out the region as "global" instead of "europe-west1" or whatever your specific region is.

Also, go to cloudbuild settings & under the WORKER POOL tab create a private pool machine that matches the machine type you specified in your cloudbuild.yaml file

答案2

得分: 0

如果您实际想增加您的配额,您应该前往配额页面。这里有全局配额和区域配额,因此您需要更新相关的配额(有时需要同时更新两者)。有关更新配额的说明在文档中有详细描述:https://cloud.google.com/docs/quota_detail/view_manage#managing_your_quota_console

您已经在您的YAML文件中正确切换了机器类型。在这种情况下,没有使用私有池的必要;这只会使成本更高,除非您有特定需要需要它,或者需要不同于默认可用机器类型的机器类型(详情请参阅此处)。因此,只需像您已经做过的那样在您的选项中配置它。

英文:

If you actually want to increase your quota, you should go to the Quotas page. There are both global quotas and regional quotas, so you need to update the relevant ones (sometimes both). Instructions for updating quotas is described in the documentation: https://cloud.google.com/docs/quota_detail/view_manage#managing_your_quota_console

You have correctly switched machine type in your YAML file. There is no reason in this case to use a private pool; it only makes it more expensive, so unless you have specific needs that require it or need a different machine type than what is available by default (details here), then just configure it in your options as you've done already.

huangapple
  • 本文由 发表于 2023年7月3日 23:14:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76606058.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定