将App Engine前端版本转换为模块 [英] Converting App Engine frontend versions to modules

查看:120
本文介绍了将App Engine前端版本转换为模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在App Engine(java)中略微滥用"了前端版本"概念,以在引入模块之前实现这些模块.我有一个基于版本概念的配置,该配置包括:module1-dot-myapp.appspot.com,module2-dot-myapp.appspot.com,module3-dot-myapp.appspot.com等(通常与数字:1-dot-myapp等).

I've slightly "abused" the front-end "version" concept in App Engine (java), to implement modules before they were introduced. I have a configuration consisting of: module1-dot-myapp.appspot.com, module2-dot-myapp.appspot.com, module3-dot-myapp.appspot.com, etc., based on the version concept (more commonly used with numbers: 1-dot-myapp, etc.).

具体来说,所有版本中的代码都是相同的,但是实际上每种代码都用于不同的目的.这种分隔允许不同的客户端使用不同的api版本,单独的部署计划,登台版本,日志分隔等.

Specifically, the code in all versions is identical, but each is practically used for different purposes. This separation allows different clients to use different api versions, separate deployment schedule, staging versions, logs separation, etc.

我的问题是,在这些条件下,将我的应用程序转换为真实"模块的最佳方法是什么?这样"module1"是一个实际的模块(仍映射到相同的URL-module1-dot-appspot.com)?

My question is, under theses conditions, what is the best way to convert my application to "real" modules? such that "module1" is an actual module (still mapped to the same url - module1-dot-appspot.com)?

推荐答案

注意:我的回答来自某种程度上类似的练习,但是在 python GAE运行时中,可能存在其他特定于Java的东西看看.

Note: my answer comes from a somehow similar exercise but in the python GAE runtime, there is likely aditional Java-specific stuff to look at as well.

首先要看的是(可能的显示停止器)是应用程序级配置-这些配置需要从您不同的旧应用程序版本(如果存在)中进行合并,并且将是由所有模块共享(或仅指向默认模块),因此它们可能无法像以前一样工作,最好重新访问这些配置上的最新文档:

First things to look at (possible show stoppers) are the app-level configs - those will need to be merged in from your different old app versions (if they exist) and will be shared by all your modules (or directed to the default module only), so they might not work as before, best to revisit the latest documentation on these configs:

  • dispatch file
  • queue
  • cron
  • DB indexes

注意:在多模块python应用程序中,这些配置可能不会在应用程序上传时自动更新,它们每个需要可能需要使用相应的应用程序明确上传配置实用程序选项.

Note: in multi-module python apps these configs might not be updated automatically at app upload, each of them may need to be uploaded explicitly, using the respective app configuration utility options.

单独的部署计划几乎是免费的(每个模块都可以独立部署).但是由于应用程序级别的配置(例如多个CLI调用而不是单个CLI调用),可能会产生一些影响

The separate deployment schedule is almost free (each module can be deployed independently). But there may be some impact due to the app-level configs (multiple CLI invocations instead of a single one, for example)

日志分离是免费的.

根据您的确切意思,可能需要重新审视舞台故事.

The staging story might need to be revisited, depending on what exactly you mean by that.

除此之外-您会将应用程序的不同旧版本带到新应用程序的单独模块子目录中.检查您的版本控制系统是否更轻松地支持此功能.需要将旧的应用程序配置文件翻译"为相应模块的配置文件,并将某些信息放入新应用程序的顶级目录配置文件中.

Other than that - you'd bring the different old versions of your app in separate module sub-directories in your new app. Check if your version control system supports this easier. The old app config file(s) would need to be "translated" into the respective module's config file(s) and some of the info would go into the new app's top dir config file.

模块URL路由应该允许透明的URL映射,但请注意,这些URL实际上将是<module>-dot-<appname>.appspot.com,获取完全相同的URL的唯一方法是在删除所有旧版本的应用之前部署新代码(由于URL冲突:<module>-dot-<appname><appversion>-dot-<appname>,不确定是否可以使用旧代码或新代码,或者是否有可能部署新代码而不会出现错误).您可以首先使用一个新的应用程序名称,只是在切换之前将所有鸭子都排好了(您可能会考虑采用新的登台故事). 如果您以前没有一个文件,您可能会 找到有用的补充URL路由.

The module URL routing should allow transparent URL mapping, but note that the URLs will actually be <module>-dot-<appname>.appspot.com and the only way to get exactly the same URLs would be to delete all older app versions before deploying the new one (due to conflicting URLs: <module>-dot-<appname> vs <appversion>-dot-<appname>, not sure if you'll get the old or the new code serving or if it's even possible to deploy the new code without error). You could use a new appname at first, just to get all ducks lined up before the switchover (possibly a new staging story you might consider going forward). You might find helpful complementing URL routing with a dispatch file if you didn't have one before.

最后,如果在模块之间共享相同的文件,则可以从源代码管理的角度更轻松或更合理地考虑将文件按应用程序的单个副本链接到相应的模块中.

Finally, if you have identical files shared across modules you may consider a single per-app copy of the file, symlinked into the respective modules, if that's easier or makes sense from your source code management prospective.

这篇关于将App Engine前端版本转换为模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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