我正在尝试转换AppEngine应用程序,该应用程序使用模块(使用Google推荐)将后端用于后端。
我使用backends_conversion.py app.yaml backends.yaml转换了backends.yaml
在 appcfg.py update producer.yaml
我没有收到错误,版本“生产者”已经存在,我应该更改模块名称。
我没有这样做(因为我使用模块名称作为任务队列目标)。相反,我停下来并删除了正在运行的后端版本。
上传后续工作的模块。
但是排队任务(通过taskqueue)不起作用(即没有启动模块的实例)。
同时尝试从浏览器(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'
答案 0 :(得分:1)
一种方法:您可以设置dispatch file,以便将某些任务处理程序路由到特定模块。
注意:更改dispatch.yaml
文件后,您需要运行
appcfg.py update_dispatch <proj_dir>
答案 1 :(得分:0)
在生产
上启动额外的模块(实例)我终于发现有必要从我的本地机器发出命令行指令。
$ appcfg.py update app.yaml worker.yaml
如果漂亮的“GoogleAppEngineLauncher”做到了,我还没有发现。