chili_pepper package¶
Submodules¶
chili_pepper.app module¶
-
class
chili_pepper.app.App(app_name, config=None)[source]¶ Bases:
objectCloud-agnostic App class
App is the main class for applications that use Chili-Pepper.
-
app_name¶ The application name.
-
task(environment_variables=None)[source]¶ The decorator to denote tasks. It must be implemented by cloud-specific App child classes.
- Parameters
environment_variables – Environment variables to apply to the task
-
task_functions¶ The task functions identified with the
@app.taskdecorator
-
-
class
chili_pepper.app.AppProvider[source]¶ Bases:
enum.EnumEnum to identify the serverless provider.
Currently unused.
-
AWS= 1¶
-
-
class
chili_pepper.app.AwsApp(app_name, config=None)[source]¶ Bases:
chili_pepper.app.App-
bucket_name¶ The AWS S3 bucket name that holds the lambda deployment packages
-
runtime¶ The AWS lambda runtime identifier.
-
-
class
chili_pepper.app.ChiliPepper[source]¶ Bases:
object-
create_app(app_name, app_provider=<AppProvider.AWS: 1>, config=None)[source]¶ [summary]
- Parameters
app_name ([type]) – [description]
app_provider ([type], optional) – [description]. Defaults to AppProvider.AWS.
config ([type], optional) – [description]. Defaults to None.
- Raises
ChiliPepperException – [description]
- Returns
[description]
- Return type
[type]
-
-
exception
chili_pepper.app.InvalidFunctionSignature[source]¶ Bases:
chili_pepper.exception.ChiliPepperExceptionFunction Signature does not match required specifications
Cloud providers require that functions have a specific signature. This exception is raised when a task does not match the required signature.
-
exception
chili_pepper.app.InvocationError[source]¶ Bases:
chili_pepper.exception.ChiliPepperExceptionRaised when there was a problem invoking the serverless function
-
class
chili_pepper.app.Result(lambda_function_name, event)[source]¶ Bases:
objectTask result object
Result wraps the information returned when the serverless function is invoked.
-
get()[source]¶ Get the response from the serverless execution.
This is a potentially blocking call.
It will retrieve the return payload from the serverless function. If it is called before the serverless function has finished,
getwill block until the serverless function returns.- Raises
InvocationError – Raises if something goes retrieving the return payload of the serverless function.
- Returns
The return payload of the serverless function
- Return type
dict
-
start()[source]¶ Start executing the serverless function
Invokes the serverless function.
For AWS, this invokes the Lambda in a thread, since the only way to get results is to call syncronously. By putting the invoke call in a therad, it will not block the main application thread.
- Returns
The thread running the lambda
- Return type
Thread
-
-
class
chili_pepper.app.TaskFunction(func, environment_variables=None)[source]¶ Bases:
objectA wrapper around python functions that can be serverlessly deployed and executed by chili-pepper
-
environment_variables¶ Returns: dict: The environment variable overrides for this function
-
func¶ Returns: builtins.function: The python function
-
chili_pepper.config module¶
chili_pepper.deployer module¶
-
class
chili_pepper.deployer.Deployer(app)[source]¶ Bases:
object