openfaas / templates

OpenFaaS Classic templates
https://www.openfaas.com
MIT License
276 stars 228 forks source link

adding python3-fastapi templates #287

Open JustinGuese opened 2 years ago

JustinGuese commented 2 years ago

Adding python3-fastapi and python3-fastapi-debian to the templates

Description

It would be awesome to have the fastapi templates in the main repo. I used https://github.com/loudsquelch/openfaas-python3-fastapi-template for my additions and created an alpine and debian version similar to the python3 ones you are providing.

Motivation and Context

The default python3 module is okayish, but with fastapi we can have the advantages of that library in openfaas. I have specified workers 1 to leave the scaling up to openfaas. The /doc route should be exposed as usual and all in all it should provide a better way of integrating APIs with OpenFAAS.

Which issue(s) this PR fixes

How Has This Been Tested?

I deployed both functions to my local OpenFAAS setup and ran the ./verify.sh script

Types of changes

Impact to existing users

Two new templates are added that do not change the existing python3 and python3-debian templates

Checklist:

derek[bot] commented 2 years ago

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

:bulb: Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name" git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force. If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".