5

我正在尝试将使用后端的 AppEngine 应用程序转换为使用模块的应用程序(如 Google 推荐的那样)。

我用 backends_conversion.py app.yaml backends.yaml 转换了 backends.yaml

在 appcfg.py 更新 producer.yaml 期间

我收到了错误,版本“生产者”已经存在,我应该更改模块名称。

我没有这样做(因为我使用模块名称作为任务队列目标)。相反,我停止并删除了正在运行的后端版本。

上传之后工作的模块。

但是排队任务(通过任务队列)不起作用(即没有启动模块的实例)。

还尝试从浏览器 (producer.appid.appspot.com) 处理模块会产生 http 503。

怎么了?

[更新]我们正在明确处理后端:

taksqueue.add(..., target='producer')

任务队列文档没有说明如何使用模块来做到这一点。

[更新] producer.yaml

admin_console:
  pages:
  - name: Initialize
    url: /init
api_version: '1'
application: lpsng2
basic_scaling:
  max_instances: '1'
builtins:
- remote_api: 'on'
default_expiration: 8d
env_variables:
  TMP: C:\temp
handlers:
- login: admin
  mime_type: image/vnd.microsoft.icon,
  secure: optional
  static_files: static/favicon.ico
  upload: static/favicon.ico
  url: /favicon.ico
- login: admin
  mime_type: image/png
  secure: optional
  static_files: static/images/lpsng_icon_os_144.png
  upload: static/images/lpsng_icon_os_144.png
  url: /apple-touch-icon-precomposed.png
- login: admin
  mime_type: application/x-chrome-extension
  secure: optional
  static_files: static/lpsng.crx
  upload: static/lpsng.crx
  url: /static/lpsng.crx
- http_headers:
    Vary: Accept-Encoding
  login: admin
  mime_type: image/png
  secure: optional
  static_files: static/\1.png
  upload: static/(.*).png
  url: /static/(.*).png
- http_headers:
    Vary: Accept-Encoding
  login: admin
  mime_type: image/jpeg
  secure: optional
  static_files: static/\1.jpg
  upload: static/(.*).jpg
  url: /static/(.*).jpg
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_dir: static
  url: /static
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/lib/\2
  upload: source/lib/ace/lib/(.*)
  url: /js/(.*)/lib/ace/lib/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/css/\2
  upload: source/lib/ace/css/(.*)
  url: /js/(.*)/lib/ace/css/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/mode/\2
  upload: source/lib/ace/mode/(.*)
  url: /js/(.*)/lib/ace/mode/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/mode/json/\2
  upload: source/lib/ace/mode/json/(.*)
  url: /js/(.*)/lib/ace/mode/json/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/mode/python/\2
  upload: source/lib/ace/mode/python/(.*)
  url: /js/(.*)/lib/ace/mode/python/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/theme/\2
  upload: source/lib/ace/theme/(.*)
  url: /js/(.*)/lib/ace/theme/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/worker/\2
  upload: source/lib/ace/worker/(.*)
  url: /js/(.*)/lib/ace/worker/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/\2
  upload: source/lib/ace/(.*)
  url: /js/(.*)/lib/ace/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/lib/ace/\2/\3/\4
  upload: source/lib/ace/(.*)/(.*) /(.*)
  url: /js/(.*)/lib/ace/(.*)/(.*)/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: buildout/\2
  upload: buildout/(.*)
  url: /js/(.*)/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: buildcss/\1
  upload: buildcss/(.*)
  url: /css/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/\2/\3
  upload: dummy/dummy.txt
  url: /source/(.*)/(.*)/(.*)
- http_headers:
    Vary: Accept-Encoding
  login: admin
  secure: optional
  static_files: source/\2
  upload: dummy/dummy.txt
  url: /source/(.*)/(.*)
- script: main.app
  secure: optional
  url: .*
inbound_services:
- xmpp_message
instance_class: B8
libraries:
- name: webapp2
  version: 2.5.2
- name: markupsafe
  version: '0.15'
- name: jinja2
  version: '2.6'
- name: PIL
  version: 1.1.7
module: producer
runtime: python27
skip_files: (?:^(.*/)?app\.yaml)|(?:^(.*/)?app\.yml)|(?:^(.*/)?index\.yaml)|(?:^(.*/)?index\.yml)|(?:^(.*/)?#.*#)|(?:^(.*/)?.*~)|(?:^(.*/)?.*\.py[co])|(?:^(.*/)?.*/RCS/.*)|(?:^(.*/)?\..*)|(?:^dev/(.*))|(?:^build/(.*))|(?:(.*/source/.*))|(?:^source1/lib/([^\/]*)$)|(?:^dist/(.*)$)|(?:^data/blob/(.*))|(?:^data/log/(.*))|(?:^data/temp/(.*))|(?:^data/db/(.*))|(?:^conf/standalone[.](.*))|(?:^conf/enterprise[.](.*))|(?:^standalone/(.*))|(?:^Output/(.*))|(?:^Microsoft.VC90.CRT/(.*))|(?:^notUsed/(.*))|(?:^(.*)\.pxd)
threadsafe: true
version: '2'
4

2 回答 2

1

一种方法:您可以设置调度文件,以便将某些任务处理程序路由到特定模块。注意:对文件进行更改后dispatch.yaml,您需要运行

appcfg.py update_dispatch <proj_dir>
于 2013-08-05T00:45:57.797 回答
0

在生产中启动额外的模块(实例)

我终于发现有必要从我的本地机器发出命令行指令。

$ appcfg.py update app.yaml worker.yaml

如果漂亮的“GoogleAppEngineLauncher”做到了,我还没有发现如何。

于 2014-10-27T23:17:42.657 回答