将Dash部署到Google App Engine python3运行时的问题


1

我正在尝试使用Python 3灵活运行时将一个非常基本的Dash应用程序部署到GAE,但部署始终失败:“错误:(gcloud.app.deploy)错误响应:[13]部署期间发生内部错误”。我的app在本地运行正常,我怀疑这个问题与GAE的python3运行时和Dash的依赖关系有关

我的app.yaml文件如下:

env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 3

manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 1
  disk_size_gb: 10

我已经尝试将memory_gb增加到5,但我仍然得到错误。

我的main.py文件如下:

import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objs as go
from dash.dependencies import Input, Output, State, Event
from flask import Flask

# Initialize dash app
server = Flask(__name__)
app = dash.Dash(__name__, server = server)
app.config['suppress_callback_exceptions'] = True
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True
s
app.layout = html.Div([
    dcc.Input(id='my-id', value='initial value', type='text'),
    html.Div(id='my-div'),
    dcc.Graph(id = 'go')
])

@app.callback(
    Output(component_id='my-div', component_property='children'),
    [Input(component_id='my-id', component_property='value')]
)
def update_output_div(input_value):
    return 'You\'ve entered "{}"'.format(input_value)


if __name__ == '__main__':

    app.run_server(debug = True)

我也尝试过指定:

app.run_server(debug = True, port = 8080)

我的requirements.txt文件如下:

dash==0.30.0
dash-core-components==0.38.1
dash-html-components==0.13.2
dash-renderer==0.15.1
Flask==1.0.2
Flask-Compress==1.4.0
gunicorn==19.9.0
plotly==3.4.2

这与可能的部署基本相同(尝试查看导致部署失败的原因)。 Dash的依赖项和GAE python3运行时是否存在已知问题?我应该使用python2吗?

谢谢!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.