chili-pepper
Asynchronous Serverless Task Execution
Chili-Pepper is a simple framework that makes it easy to execute tasks without interrupting the main flow of your application. It handles serverless deployment and task execution. It allows you to run important functions in parallel with your main application with zero downtime, zero maintenance and infinite scaling.
Command
usage: chili [-h] [--app APP] {deploy} ...
Serverless asynchronous tasks
positional arguments:
{deploy} Chili-Pepper commands
deploy Deploy functions to serverless provider
optional arguments:
-h, --help show this help message and exit
--app APP, -A APP The Chili-Pepper application location
Getting Started
Installing Chili-Pepper
pip install chili-pepper
Serverless Provider
Next, you need to configure your serverless provider credentials.
Amazon Web Services (AWS)
You can provide AWS credentials in many ways, including environment variables, your aws credentials file, or a server role. See the boto3 documentation about credential configuration for details.
These credentials need to be allowed to create, execute and delete AWS Lambda functions and IAM roles.
You will also need an S3 bucket (with versioning enabled).
Azure
Microsoft Azure Cloud is not supported at this time, but there are plans to support it in the future.
Google Cloud
Google Cloud is not supported at this time, but there are plans to support it in the future.
Creating the Chili-Pepper App
The Chili-Pepper app will be used to identify and deploy your functions to the serverless cloud provider.
app = ChiliPepper(app_name="demo")
Of course, the app variable can have any name - we’ll be calling it app in these examples.
AWS Configuration
You need to pass these required AWS specific configs to the app. For a full list of AWS configuration options, see Aws Configuration.
Bucket
app.conf["aws"]["bucket_name"] = "my-chili-pepper-bucket"
This bucket will be used for storing AWS Lambda deployment packages. You should enable versioning on the bucket.
Runtime
app.conf["aws"]["runtime"] = "python3.7"
AWS Lambda supports several python runtimes. See the lambda runtime documentation for a full list. You must pass the “Identifier” for the runtime of your choice to the Chili-Pepper app config.
Creating a Task
You can use the Chili-Pepper app to identify tasks that should be run.
@app.task()
def my_task(event, context):
return f"Hello {event['name']}!"
Deploying
Before you can asynchronously call your task, you must deploy it to your cloud provider.
chili deploy --app my_module.tasks.app
AWS Deployment
Calling deploy will create a zipfile containing your code as well as any python dependencies. Chili-Pepper will then use upload that zipfile to your S3 bucket, and use Cloudformation to create an AWS Lambda function for each of the tasks you identified with the app.task() decorator.
Calling your task
Now that you’ve deployed your tasks to the cloud, you can call them asynchronously.
task_result = my_task.delay({"name": "Jalapeno"})
print(task_result.get())
This will print Hello Jalapeno!, after executing my_task in a serverless function.
Support
Chili-Pepper is built by a 1 person team supported by these awesome backers, supporters and sponsors. If you use Chili-Pepper, I would love to hear from you! And, if I have earned your support, please consider backing me on Patreon.
Metadata
Release files for chili-pepper 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chili_pepper-0.0.3.tar.gz | 23.3 kB | Without provenance | Details for chili_pepper-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chili_pepper-0.0.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for chili_pepper-0.0.3-py2.py3-none-any.whl |
Total release size: 42.0 kB
Release files / chili_pepper-0.0.3.tar.gz
| Download URL | chili_pepper-0.0.3.tar.gz |
|---|---|
| Size | 23.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24743aeb7cecd814d4f9c07f7ed57226826221d1a57dc49d55018df570107bb4
|
|
BLAKE2b-256 checksum How to use checksums |
7036c886076dba1498d0cded581aee92d2bce60b149c7ec9e212732841cc8540
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / chili_pepper-0.0.3-py2.py3-none-any.whl
| Download URL | chili_pepper-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5b994c14ed3ba75d08f0e951ffe654d043d1b9793165599bdfb75f6ddc43daa5
|
|
BLAKE2b-256 checksum How to use checksums |
b5456a3d39efc24f9f1e5161a9882deab5e8dbbf3d951d39868311356ef65254
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for chili-pepper 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.