在Heroku上部署具有Gdal依赖项的Dash应用程序失败

时间:2018-12-04 05:44:32

标签: heroku gunicorn gdal plotly-dash

我正在使用conda进行程序包管理,并包含一个environment.yml文件和requirements.txt文件,以便在this post的帮助下进行部署。我已经用这种方式部署了简单的破折号应用程序,但是对于需要GDAL的更复杂的任务,构建“成功”,但是应用程序崩溃并显示以下日志:

Starting process with command `gunicorn app:server --log-file=-  
heroku[web.1]: Process exited with status 127    
app[web.1]: bash: gunicorn: command not found  
app[api]: Build succeeded

我的environment.yml文件要求:

name: dashpilot
channels:
  - conda-forge
  - anaconda-fusion
  - defaults
dependencies:
  - asn1crypto=0.24.0=py36_1003
  - attrs=18.2.0=py_0
  - bzip2=1.0.6=1
  - ca-certificates=2018.10.15=ha4d7672_0
  - certifi=2018.10.15=py36_1000
  - cffi=1.11.5=py36h5e8e0c9_1
  - chardet=3.0.4=py36_1003
  - click=7.0=py_0
  - cryptography-vectors=2.3.1=py36_1000
  - dash=0.30.0=py_0
  - dash-core-components=0.38.0=py_0
  - dash-html-components=0.13.2=py_0
  - dash-renderer=0.15.0=py_0
  - decorator=4.3.0=py_0
  - flask=1.0.2=py_2
  - flask-compress=1.4.0=py_0
  - geojson=2.4.1=py_0
  - idna=2.7=py36_1002
  - ipython_genutils=0.2.0=py_1
  - itsdangerous=1.1.0=py_0
  - jinja2=2.10=py_1
  - jsonschema=3.0.0a3=py36_1000
  - jupyter_core=4.4.0=py_0
  - markupsafe=1.1.0=py36h470a237_0
  - nbformat=4.4.0=py_1
  - openssl=1.0.2p=h470a237_1
  - plotly=3.4.1=py_0
  - pycparser=2.19=py_0
  - pyopenssl=18.0.0=py36_1000
  - pyrsistent=0.14.7=py36h470a237_0
  - pysocks=1.6.8=py36_1002
  - pytz=2018.7=py_0
  - requests=2.20.1=py36_1000
  - retrying=1.3.3=py_2
  - six=1.11.0=py36_1001
  - traitlets=4.3.2=py36_1000
  - urllib3=1.23=py36_1001
  - werkzeug=0.14.1=py_0
  - blas=1.0=mkl
  - cairo=1.14.12=hc4e6be7_4
  - click-plugins=1.0.4=py36_0
  - cligj=0.5.0=py36_0
  - cryptography=2.3.1=py36hdbc3d79_0
  - curl=7.61.1=ha441bb4_0
  - cycler=0.10.0=py36hfc81398_0
  - descartes=1.1.0=py36_0
  - expat=2.2.6=h0a44026_0
  - fiona=1.7.12=py36h0dff353_0
  - fontconfig=2.13.0=h5d5b041_1
  - freetype=2.9.1=hb4e5f40_0
  - freexl=1.0.5=h1de35cc_0
  - gdal=2.2.4=py36h6440ff4_1
  - geopandas=0.3.0=py36_0
  - geos=3.6.2=h5470d99_2
  - gettext=0.19.8.1=h15daf44_3
  - giflib=5.1.4=h1de35cc_1
  - glib=2.56.2=hd9629dc_0
  - gunicorn=19.9.0=py36_0
  - hdf4=4.2.13=h39711bb_2
  - hdf5=1.10.2=hfa1e0ec_1
  - icu=58.2=h4b95b61_1
  - intel-openmp=2019.1=144
  - jpeg=9b=he5867d9_2
  - json-c=0.13.1=h3efe00b_0
  - kealib=1.4.7=h40e48e4_6
  - kiwisolver=1.0.1=py36h0a44026_0
  - krb5=1.16.1=h24a3359_6
  - libboost=1.67.0=hebc422b_4
  - libcurl=7.61.1=hf30b1f0_0
  - libcxx=4.0.1=hcfea43d_1
  - libcxxabi=4.0.1=hcfea43d_1
  - libdap4=3.19.1=h3d3e54a_0
  - libedit=3.1.20170329=hb402a30_2
  - libffi=3.2.1=h475c297_4
  - libgdal=2.2.4=h7b1ea53_1
  - libgfortran=3.0.1=h93005f0_2
  - libiconv=1.15=hdd342a3_7
  - libkml=1.3.0=hbe12b63_4
  - libnetcdf=4.6.1=h4e6abe9_2
  - libpng=1.6.35=ha441bb4_0
  - libpq=10.5=hf30b1f0_0
  - libspatialindex=1.8.5=h2c08c6b_2
  - libspatialite=4.3.0a=ha12ebda_19
  - libssh2=1.8.0=h322a93b_4
  - libtiff=4.0.9=hcb84e12_2
  - libuuid=1.0.3=h6bb4b03_2
  - libxml2=2.9.8=hab757c2_1
  - matplotlib=3.0.1=py36h54f8f79_0
  - mkl=2018.0.3=1
  - mkl_fft=1.0.6=py36hb8a8100_0
  - mkl_random=1.0.1=py36h5d10147_1
  - munch=2.3.2=py36_0
  - ncurses=6.1=h0a44026_0
  - numpy=1.15.4=py36h6a91979_0
  - numpy-base=1.15.4=py36h8a80b8c_0
  - openjpeg=2.3.0=hb95cd4c_1
  - pandas=0.23.4=py36h6440ff4_0
  - pcre=8.42=h378b8a2_0
  - pip=18.1=py36_0
  - pixman=0.34.0=hca0a616_3
  - poppler=0.65.0=ha097c24_1
  - poppler-data=0.4.9=0
  - proj4=5.0.1=h1de35cc_0
  - psycopg2=2.7.5=py36hdbc3d79_0
  - pyparsing=2.3.0=py36_0
  - pyproj=1.9.5.1=py36h833a5d7_1
  - pysal=1.14.4.post1=py36_1
  - python=3.6.6=hc167b69_0
  - python-dateutil=2.7.5=py36_0
  - readline=7.0=h1de35cc_5
  - rtree=0.8.3=py36_0
  - scipy=1.1.0=py36h28f7352_1
  - setuptools=40.6.2=py36_0
  - shapely=1.6.4=py36h20de77a_0
  - sqlalchemy=1.2.14=py36h1de35cc_0
  - sqlite=3.25.3=ha441bb4_0
  - tk=8.6.8=ha441bb4_0
  - tornado=5.1.1=py36h1de35cc_0
  - wheel=0.32.3=py36_0
  - xerces-c=3.2.2=h44e365a_0
  - xz=5.2.4=h1de35cc_4
  - zlib=1.2.11=h1de35cc_3
  - pip:
    - dash-table==3.1.6
prefix: /Applications/anaconda3/envs/dashpilot

我的requirements.txt文件要求:

asn1crypto==0.24.0
attrs==18.2.0
certifi==2018.10.15
cffi==1.11.5
chardet==3.0.4
Click==7.0
click-plugins==1.0.4
cligj==0.5.0
cryptography==2.3.1
cryptography-vectors==2.3.1
cycler==0.10.0
dash==0.30.0
dash-core-components==0.38.0
dash-html-components==0.13.2
dash-renderer==0.15.0
dash-table==3.1.6
decorator==4.3.0
descartes==1.1.0
Fiona==1.7.12
Flask==1.0.2
Flask-Compress==1.4.0
GDAL==2.2.4
geojson==2.4.1
geopandas==0.3.0
gunicorn==19.7.1
idna==2.7
ipython-genutils==0.2.0
itsdangerous==1.1.0
Jinja2==2.10
jsonschema==3.0.0a3
jupyter-core==4.4.0
kiwisolver==1.0.1
MarkupSafe==1.1.0
matplotlib==3.0.1
mkl-fft==1.0.6
mkl-random==1.0.1
munch==2.3.2
nbformat==4.4.0
numpy==1.15.4
pandas==0.23.4
plotly==3.4.1
psycopg2==2.7.5
pycparser==2.19
pyOpenSSL==18.0.0
pyparsing==2.3.0
pyproj==1.9.5.1
pyrsistent==0.14.7
PySAL==1.14.4.post1
PySocks==1.6.8
python-dateutil==2.7.5
pytz==2018.7
requests==2.20.1
retrying==1.3.3
Rtree==0.8.3
scipy==1.1.0
Shapely==1.6.4.post1
six==1.11.0
SQLAlchemy==1.2.14
tornado==5.1.1
traitlets==4.3.2
urllib3==1.23
Werkzeug==0.14.1

我尝试了各种buildpack组合(heroku的python build pack和heroku的docs中推荐的gdal buildpack)。仅在使用推荐的gdal buildpack时在Mac上运行“ heroku local”时,该应用程序才能运行。我是部署过程的新手,所以不清楚我可能会误入歧途。

将添加我的配置变量当前为这些:

BUILD_WITH_GEO_LIBRARIES=1
GDAL_LIBRARY_PATH=os.environ.get('GDAL_LIBRARY_PATH')
GEOS_LIBRARY_PATH=os.environ.get('GEOS_LIBRARY_PATH')
WEB_CONCURRENCY=3

0 个答案:

没有答案