我正在尝试使用 gcloud 将我的 python 应用程序部署到生产环境,但每次都会弹出这个奇怪的消息,我没有找到任何关于这个谷歌搜索的信息......
当我运行时:
gcloud preview app deploy
此消息出现:
This looks like a Python app. If so, please enter the command to run
to run the app in production (enter nothing if it's not a python app):
我尝试使用 appcfg.py 执行常规命令:
❯ appcfg.py -A <appname> update app.yaml
但它每次都会抛出超时。
有人知道在这种情况下我应该怎么做吗?
谢谢!
编辑
我的 App.yaml
runtime: python
api_version: 1
threadsafe: yes
vm: true
handlers:
- url: .*
script: main.app
- url: /_ah/queue/deferred
script: google.appengine.ext.deferred.deferred.application
login: admin
#libraries:
#- name: MySQLdb
#version: "latest"
builtins:
- remote_api: on
- deferred: on
resources:
cpu: .5
memory_gb: 2.3
disk_size_gb: 10
编辑 2
我已将我的运行时更改为自定义,现在它不再询问任何内容。现在的问题是它会引发超时:
(gcloud.preview.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying)
我找到了有关此错误的信息,如果我弄清楚了,我会回到这里。
谢谢
最佳答案
由于这个问题没有公认的答案,我会在这里为任何 future 的读者张贴一个答案。
部署提示输入入口点,因为它未在 app.yaml 中指定。该字段是在柔性环境中运行 Python 运行时应用程序所必需的。将运行时更改为“自定义”不会提示它,但应用容器仍然不知道如何运行您的应用,因此虚拟机将无法启动。
文档中提供了更多详细信息:
应用启动 https://cloud.google.com/appengine/docs/flexible/python/runtime#application_startup
关于python - GAE Python Gcloud - 在生产中运行的命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37644075/