Serverless
Last updated
Last updated
To be as portable as possible, even with severless, we use . It allows us to deploy our functions across multiple clouds like AWS, GCP, Azure and IBM OpenWisk.
Make sure you have your
In your repo create your serverless template for Python
To compile non-pure Python modules, install , the and . Enable dockerizePip in serverless.yml and serverless deploy
again.
To configure our serverless.yml
file to use the plugin, we'll add the following lines in our serverless.yml
:
Optional: Re-install the dependencies from the requirements.txt
:
Define the function in the serverless.yml
including the events (e.g. http) that trigger the function and the handler
Implement the unit test: what is the best serverless unit test framework for python?
Implement the handler function in handler.py
Test the function locally
Run the unit tests
The deployment takes very long. I have to see how to optimize this.
Or you can use the CLI and use:
You can use the endpoint endpoint and use Postman to make a "real world" request: