将运行时从Python更改为在App Engine标准环境中运行 [英] Change runtime from Python to Go in App Engine standard environment

查看:100
本文介绍了将运行时从Python更改为在App Engine标准环境中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AppEngine上有一个99%静态的网站.它在Python 2.7运行时上运行.现在该Web应用程序已经发展了,由于我几乎没有Python代码,因此我宁愿用Go编写它.

I have a website on AppEngine that is 99% static. It is running on Python 2.7 runtime. Now the time has come to evolve this webapp, and since I have almost none Python code in it, I'd prefer to write it in Go instead.

我可以在保持项目完好无损的同时将运行时从Python 2.7更改为Go吗?具体来说,我想保留相同的应用程序ID,附加的自定义域,相同的SSL证书, 等等.

Can I change runtime from Python 2.7 to Go, while keeping the project intact? Specifically, I want to keep the same app-ID, the same custom domain attached to it, the same SSL certificate, and so on.

要执行此操作必须做什么?我肯定必须在app.yaml中更改runtime.还有什么吗?

What do I have to do in order to do that? I surely have to change runtime in the app.yaml. Is there anything else?

奖金问题:这样的变化会在没有停机的情况下发生吗?

Bonus question: will such change happen without a downtime?

对于任何与此文档相关的链接(在实时应用程序上交换运行时),我将不胜感激.我找不到任何东西.

I'd be grateful for any links to documentation on exactly that (swapping runtime on a live app). I can't find any.

推荐答案

GAE服务提供完整的

The GAE services offer complete code isolation. So it should be possible to simply deploy a new version of the service, which can be written in a different language or even use a different GAE (standard/flex) environment. Personally I didn't go through a language change, but I did go through a split of a single-service app into a multi-service one, I see no reason for which the same principles wouldn't apply.

也许首先要将新版本开发为单独的应用程序,以便能够正确测试它而又不会对旧版本造成意外影响,并且只有在此之后才能将代码作为新版本引入旧应用程序中.那将使用GAE 项目隔离.实际上,如果您愿意,甚至可以不使用现有应用程序,就可以将整个版本迁移作为一个单独的应用程序进行测试.我正在使用这项技术-一个单独的应用程序ID-为我的应用程序实现一个临时环境,该环境与我的生产应用程序完全隔离,请参见

Maybe develop the new version as a separate app first, to be able to test it properly without risking an accidental impact on the old version and only after that bring the code as a new version in the old app. That'd be using the GAE project isolation. You can, in fact, test the entire version migration as a separate app if you so desire without even touching the existing app. I am using this technique - a separate app ID - to implement a staging environment for my app, completely isolated from my production app, see How to copy / clone entire Google App Engine Project

确保在部署时不要将流量切换到新版本.这样可以使该应用程序与旧版本一起使用.首先使用测试新版本是否按预期工作有针对性的路由.然后,可以使用在多个版本之间拆分流量来执行A/B测试,只有很少一部分流量进入新版本.最后,对结果满意后,将所有流量切换到新版本.

Make sure to not switch traffic to the new version at deployment time. This keeps the app working with the old version. Test first that the new version works as expected using Targeted routing. Then maybe use Splitting traffic across multiple versions to perform A/B testing with just a small percentage of the traffic going to the new version. Finally, when happy with the results, switch all traffic to the new version.

您需要特别注意所有服务/版本共享的应用程序级配置(调度,cron,队列,数据存储索引).它们在2个版本中必须在功能上等效.服务隔离不适用于它们,只有项目隔离才能确保不影响旧版本.

You need to pay special attention to the app-level configs (dispatch, cron, queue, datastore indexes), shared by all services/versions. They need to be functionally equivalent in the 2 versions. The service isolation doesn't apply to them, only project isolation can ensure no impact to the old version.

应该无需更改应用ID,自定义域映射或SSL配置.以上测试应证实这一点.

There should be no need to make any change to the app ID, custom domain mapping or SSL config. The above mentioned tests should confirm that.

一些与重做服务/模块有关的潜在有趣帖子:

A few potentially interesting posts related to re-working services/modules:

  • Converting App Engine frontend versions to modules
  • Google App Engine upgrading part by part
  • Migrating to app engine modules, test versions first?
  • Advantages of implementing CI/CD environments at GAE project/app level vs service/module level?

这篇关于将运行时从Python更改为在App Engine标准环境中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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