简体   繁体   English

您如何在同一个 Google App Engine 项目中同时运行灵活环境和标准环境?

[英]How do you run both Flexible Environment and Standard Environment in the same Google App Engine project?

This answer, https://stackoverflow.com/a/46656486/2016196 , suggests that you can run both Flexible Environment and Standard Environment.这个答案https://stackoverflow.com/a/46656486/2016196表明您可以同时运行灵活环境和标准环境。 This page, https://cloud.google.com/appengine/docs/the-appengine-environments , says "You can also choose to simultaneously use both environments for your application and allow your services to take advantage of each environment's individual benefits."此页面https://cloud.google.com/appengine/docs/the-appengine-environments说:“您还可以选择同时为您的应用程序使用两种环境,并允许您的服务利用每种环境的各自优势。 ”

I assume that means you can run both types of environments in the same project.我认为这意味着您可以在同一个项目中运行两种类型的环境。 Am I wrong to assume that?我这样假设有错吗? I would like to keep everything that's of the same project in the same project and it makes sense that they would be suggesting that you don't need to create an entirely different project to use both environments, but I can't find any instructions on how to do that.我想将同一个项目中的所有内容都保留在同一个项目中,他们会建议您不需要创建一个完全不同的项目来使用这两种环境,这是有道理的,但我找不到任何说明怎么做。 I checked the app.yaml reference, https://cloud.google.com/appengine/docs/standard/python/config/appref , and I didn't see anything that suggests you can state the environment you'd like to use, making them different for different services.我检查了 app.yaml 参考https://cloud.google.com/appengine/docs/standard/python/config/appref ,我没有看到任何表明您可以说明您想要使用的环境的内容,使它们因不同的服务而不同。 I also don't see anything in the Google Cloud Console for App Engine that suggests creating a new service with a different environment.我也没有在 App Engine 的 Google Cloud Console 中看到任何建议使用不同环境创建新服务的内容。

So, is there a way to use both types of environments, ie flexible and standard, in the same project?那么,有没有办法在同一个项目中同时使用两种类型的环境,即灵活的和标准的? Or does it require one to create an entirely new project to add another type of environment.或者是否需要创建一个全新的项目来添加另一种类型的环境。

The reason for this is most of my services work with standard environment but I would like to use websockets for a couple things, which would require me to use the flexible environment.这样做的原因是我的大部分服务都在标准环境下工作,但我想将 websockets 用于一些事情,这需要我使用灵活的环境。

You can indeed have some Services that use Standard environment and others that use Flexible environment within the same project.您确实可以在同一项目中拥有一些使用标准环境的服务和其他使用灵活环境的服务。

When you deploy your an app to App Engine, by default, it's deployed to the default service.当您将应用程序部署到 App Engine 时,默认情况下,它会部署到默认服务。 You can then deploy other services by specifying the service property in the app.yaml file.然后,您可以通过在app.yaml文件中指定service属性来部署其他服务。 If left blank, the service will be deployed to the default App Engine service.如果留空,则该服务将部署到默认的 App Engine 服务。 You can find more info about the service porperty here您可以在此处找到有关service属性的更多信息

You can also set the environment you want your service to run at specifying the env porperty in the app.yaml (eg: env: flex )您还可以在app.yaml中指定env属性时设置您希望服务运行的环境(例如: env: flex

More info about App Engine Services can be found in the docs here and here可以在此处此处的文档中找到有关 App Engine 服务的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google App Engine 如何从灵活环境转变为标准环境 - How do change from Google App Engine from Flexible Environment to Standard environment Google App Engine标准版或灵活环境? - Google App Engine Standard or Flexible environment? 将Google App Engine应用程序升级到灵活环境时,如何运行Google的aefix工具? - How do I run Google's aefix tool when upgrading a Google App Engine app to the flexible environment? 如何判断Google App Engine文档页面是否适用于第1代/第2代标准或灵活环境 - How to tell if a Google App Engine documentation page applies to the 1st/2nd generation standard or the flexible environment 是否可以在Google App Engine ** Flexible **环境中运行Windows可执行文件? - Is it possible to run a Windows executable in Google App Engine **Flexible** environment? 将 App Engine flexible 降级到 App Engine 标准环境 - Downgrade App engine flexible to app engine standard environment 如何在App Engine灵活环境中运行长时间的cron作业? - How to run long cron jobs on App Engine flexible environment? Google App Engine灵活 - 环境变量 - Google App Engine Flexible - environment variables 在Google App Engine灵活环境中启用CORS - Enabling CORS in Google App Engine Flexible Environment Google App Engine:如何在灵活的环境中创建HTTPS端点? - Google App Engine: How to create HTTPS endpoints with flexible environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM