General EB Settings
Use t2.small, otherwise the memory will not enough.
|
|
|
|
|
|
wsgi
Make sure place packages in the requirements.txt in the correct order (dependency). Place Scipy before scikit-learn.
Geopandas
requirements.txt Shapely==1.5.17.post1 => Shapely==1.5.17
eb deploy --timout 3600
. Otherwise it will timeout to build gdal.
In AWS EB Web interface => configuration –> software configuration and edited the Environment Properties by adding the property LD_LIBRARY_PATH set as /usr/local/lib/:$LD_LIBRARY_PATH.
UTF-8
And if encounter the utf-8 encoding problems in EB.
- You can add
.encode('utf-8')
if there are non-ascii char in the string. - Change wsgi.conf which in the /etc/httpd/conf.d/wsgi.conf
WSGIDaemonProcess wsgi processes=1 threads=15 display-name=%{GROUP} \
python-path=/opt/python/current/app:/opt/python/run/venv/lib64/python3.4/site-packages:/opt/python/run/venv/lib/python3.4/site-packages user=wsgi group=wsgi \
home=/opt/python/current/app lang=en_US.UTF-8 locale=en_US.UTF-8
WSGIProcessGroup wsgi
export LC_ALL=en_US.UTF-8 && export LANG=en_US.UTF-8 && command
by using subprocess.call([“”], shell=True)
Reference:
http://stackoverflow.com/questions/25477268/script-timed-out-before-returning-headers-wsgi-py-on-elastic-beanstalk
https://code.google.com/archive/p/modwsgi/wikis/ApplicationIssues.wiki#Python_Simplified_GIL_State_API
http://stackoverflow.com/questions/30634777/unicodeencodeerror-when-running-in-mod-wsgi-even-after-setting-lang-and-lc-all
http://stackoverflow.com/questions/17326294/configuring-amazon-elastic-beanstalk-with-postgis
http://stackoverflow.com/questions/21715423/installing-postgis-on-amazon-elastic-beanstalk-using-config-file