如何让Cloud Run处理多个同时部署?

如何让Cloud Run处理多个同时部署?

问题描述:

我有一个包含4个组件的项目,每个组件都在Google Cloud Run上设置了托管,并分别进行了测试和生产部署.我还使用Google Cloud Build来处理&组件的部署.

I've got a project with 4 components, and every component has hosting set up on Google Cloud Run, separate deployments for testing and for production. I'm also using Google Cloud Build to handle the build & deployment of the components.

由于源系统中缺少良好的Webhook事件,因此,每当发生新更改时,我当前都*触发项目中所有组件的重建.在项目中,这意味着要构建和部署8个不同的映像,因为测试和生产也使用不同的构建时间设置.

Due to lack of good webhook events from source system, I'm currently forced to trigger a rebuild of all components in a project every time there is a new change. In the project this means 8 different images to build and deploy, as testing and production use different build-time settings as well.

我已经设法优化Cloud Build以很好地处理8个并发构建,但是它们都在同一时间完成,然后将所有8个都推送到Cloud Run.通常,Cloud Run似乎根本不喜欢这样,并开始向我抛出一些我无法解决的错误.

I've managed to optimize Cloud Build to handle the 8 concurrent builds pretty nicely, but they all finish around the same time, and then all 8 are pushed to Cloud Run. It often seems like Cloud Run does not like this at all and starts throwing some errors to me that I've been unable to resolve.

首先也是更严重的是,在8个部署中,大约有4-6个部署会按预期进行,而其余部署则被严重延迟或只是失败,通常这样一来,前几个部署会顺利进行,然后一些部署会非常顺利延迟,最后的1-2失败了.这似乎是由于该区域中一些对帐请求配额"用尽(在本例中为 europe-north1 )引起的,因为这是我在Cloud Run服务顶部看到的错误-查看:

First and more serious is that often about 4-6 of the 8 deployments go through as expected, and the remaining ones either are significantly delayed or just fail, often so that the first few go through fine, then a few with significant delays, and the final 1-2 just fail. This seems to be caused by some "reconciliation request quota" being exhausted in the region (in this case europe-north1), as this is the error I can see at the top of the Cloud Run service -view:

此外,大多数令人讨厌的是,Cloud Run仪表板本身似乎无法处理已部署的8个服务,因为仅坐在列出该服务的仪表板视图中,经常会向我抛出与某些读取配额有关的另一个错误:

Additionally and mostly annoyingly, the Cloud Run dashboard itself does not seem to handle having 8 services deployed, as just sitting on the dashboard view listing the services regularly throws me another error related to some read quotas:

我尝试通过推荐的发送反馈"按钮与Google联系,但未收到〜1wk +的答复(谁知道我何时发送邮件,因为他们似乎没有确认收据).

I've tried contacting Google via their recommended "Send feedback" button but have received no reply in ~1wk+ (who knows when I sent it, because they don't seem to confirm receipt).

我可以尝试改善情况的一个选项是在不同区域中部署测试"和生产"变体,但是这并不是最佳选择,并且似乎这是一些关于极限的简单配置.我还有其他选择可以考虑吗?还是我应该尝试在这些设备上建立一些同步,以使并非所有部署都立即被触发?

One option I can do to try and improve the situation is to deploy the "testing" and "production" variants in different regions, however that would be less than optimal, and seems like this is some simple configuration somewhere about the limits. Are there other options for me to consider? Or should I just try to set up some synchronization on these that not all deployments are fired at once?

在这种情况下,优化一次构建和部署所有组件的需求并不是真正的选择,因为它们也具有一些共享的代码,并且当更改时,仍然有必要提供支持.

Optimizing the need to build and deploy all components at once is not really an option in this case, since they have some shared code as well, and when that changes it would still be necessary to support this.

这是Cloud Run的问题.开发人员有望能够并行部署许多服务.

This is an issue with Cloud Run. Developers are expected to be able to deploy many services in parallel.

该错误应在几天或几周内修复.

The bug should be fixed within a few days or couple of weeks.