使用App Engine SDK并行模块部署 [英] Parallel Module Deployment using App Engine SDK

查看:68
本文介绍了使用App Engine SDK并行模块部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR 是否可以并行部署App Engine模块?

我已经使用Google的 App Engine SDK for Go 构建了一个go应​​用程序.该应用程序定义了多个模块.这些模块是独立的,不需要其他模块之间的依赖.

I've built a go application using Google's App Engine SDK for Go. This application defines multiple modules. These modules are self-contained, and do not require any sort of dependency across other modules.

当我尝试将模块部署到Google时云,我不禁注意到模块是按顺序上传的.如果部署相对较快,那会很好,但是每个模块都需要它自己的Go二进制文件的冗余编译.因此,除了常规的上传时间之外,每次部署时,我都必须等待应用编译[模块数] x [编译时间].

When I attempt to deploy the modules to the Google Cloud, I can't help but notice that the modules are uploaded sequentially. This would be fine if deployment was relatively quick, but each module requires it's own redundant compilation of the Go binary. Hence, on top of the regular upload time, I have to wait for my app to compile [module count] x [compilation time] every time I want to deploy.

显而易见的(快速)解决方案是并行部署,因此我创建了一个简单的bash脚本来独立部署每个模块.我立即遇到的解决方案"问题是来自App Engine API的HTTP 500响应.每当更新任何单个模块时,涵盖所有模块的整个伞形应用程序似乎都会锁定".这种情况会造成竞争,在这种情况下,只有第一个触发部署的模块成功,其他模块失败.

The obvious (quick) solution is to deploy in parallel, so I created a simple bash script to deploy each module independently. The problem I immediately encountered with this "solution" was a HTTP 500 response from the App Engine API. The whole umbrella application, spanning across all the modules, seems to "lock" whenever any individual module is updated. This scenario creates a race condition, under which only the first module to trigger a deploy succeeds and the others fail.

我担心这是App Engine中旧版语言的遗留物.由于每个模块都使用相同的Go二进制文件,因此实际上并不需要对同一代码进行多次编译.重复编译是多余的,无法绕开该锁.

I fear that this is a holdover from the legacy languages in App Engine. Since every module uses the same Go binary, it doesn't really necessitate multiple compilations of the same code. Repeated compilation is redundant, and there is no way to circumvent the lock.

我只是一个模糊的理解,一个假设的解决方案是并行编译并串行部署.我想这种方法将涉及拆解配置工具,并对其进行重新加工以在前面提到的方式-尽管我还不能确定.

One hypothetical solution, which I have only a vague understanding of, is to compile in parallel and deploy in series. I imagine that this approach would involve taking apart the configuration tool and reworking it to execute in the aforementioned manner- though I can't say for sure (yet).

这里的任何帮助都将非常有必要.谢谢!

Any help here would be much obliged. Thanks!

推荐答案

您可以部署到App Engine应用程序的另一个版本",然后在部署所有模块后,进行非常快速的版本切换吗?

You can deploy to another "version" of your App Engine app, then when all modules are deployed, do a very fast version switch?

如果您需要/想要这种东西,版本也可以实现流量分割.

Versions also allow for traffic splitting if you need/want that kind of thing.

这篇关于使用App Engine SDK并行模块部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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