openfaas / python-flask-template

HTTP and Flask-based OpenFaaS templates for Python 3
MIT License
85 stars 86 forks source link

Create debian templates for the python 3 flask templates. #30

Closed alexellis closed 4 years ago

alexellis commented 4 years ago

The current python3-flask templates use the Alpine base python image. Precompiled wheels for many important python libraries are not available for Alpine, but are easily available for Debian. Using Debian makes it much simpler and easier to use python packages like Numpy or Pillow.

Updated existing Alpine Docker files to include comments. The template yaml file for the python-http-debian was modified to remove unneeded libraries.

Both docker files were changed to force python 3.7. Gevent 1.4 is incompatible with Python 3.8, and the rest of the docker files use python 3.7.

This has been tested with a bare bones basic function and builds, runs, and executes properly.

Change listening address for WSGI server.

Update the listening address for the WSGI server to use 0.0.0.0 instead of ''. This should resolve errors about Address family not supported by protocol (Python OSError Errno 97.

Closes #26

Signed-off-by: Alex Ellis (OpenFaaS Ltd) alexellis2@gmail.com Signed-off-by: Jeff Lowrey jefferson.lowrey@mantech.com

alexellis commented 4 years ago

@LucasRoesler @viveksyngh @Jeff-Lowrey FYI

This commit squashes all the WIP commits and reworking down into one concise commit and message.

alexellis commented 4 years ago

@Jeff-Lowrey can you now send a PR to the template store for the new templates?

https://github.com/openfaas/store/blob/master/templates.json

alexellis commented 4 years ago

The README also needs to be updated as per:

Screenshot 2020-04-08 at 16 28 33