【问题标题】:App Engine Python Flexible Environment Selecting A RuntimeApp Engine Python 柔性环境选择运行时
【发布时间】:2017-10-28 23:28:27
【问题描述】:

我可以使用本地运行我的应用程序 dev_appserver.py app.yaml

而且我的应用程序有效。但是,当我尝试部署到应用引擎时,我收到以下警告:警告:[runtime: python-compat]已弃用。请改用[runtime: python]。请参阅https://cloud.google.com/appengine/docs/flexible/python/migrating 了解更多信息。 我尝试使用运行时:python,但是当我这样做时,本地没有任何效果。另外,当我使用 python-compat 时,我无法部署到应用引擎,我只得到Updating service [default]。我正在使用 Python 2.7,我应该改变什么来解决我的运行时问题? app.yaml 下面

runtime: python-compat
env: flex
entrypoint: gunicorn -b :$PORT main:app


runtime_config:
  python_version: 2
threadsafe: true

handlers:
- url: /.*
  script: main.app

- url: /static
  static_dir: static

- url: .*
  script: main.app

【问题讨论】:

  • 你运行的是什么版本的 SDK?
  • 谷歌云 SDK [176.0.0]

标签: python-2.7 google-app-engine runtime


【解决方案1】:

FWIW,通过 dev_appserver.py 在本地运行应用程序仅适用于标准环境,您能够运行它只是幸运(可能是因为现在已弃用 python-compat 运行时?)。来自Using the Local Development Server

注意: dev_appserver.py 不能在 App Engine 柔性环境中运行。

对于您通常需要以与在 GAE 上运行应用程序相同的方式运行应用程序的灵活环境,请参阅Running locally 了解详细信息。在你的情况下是:

gunicorn -b :$PORT main:app

考虑到这一点,切换到runtime: python 应该不再是问题,您只需遵循官方建议即可。

旁注:可能感兴趣:How to tell if a Google App Engine documentation page applies to the standard or the flexible environment

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 1970-01-01
    • 2017-08-23
    • 1970-01-01
    • 1970-01-01
    • 2019-04-24
    • 2018-11-28
    相关资源
    最近更新 更多