Package: caravan
Light python framework for AWS SWFAbout this ProjectCaravan is being used atLudiafor projects
like marketing campaign system and on-demand distributed processing
systems (thanks to hundreds of Lambda functions).Feedbacks, ideas and contributions are highly welcomed. (Just open aGithub issue).Code on GithubPyPiTestsDoc:TODOFocus of this projectSimilar projects exists (like Simpleflow which seems mature).
Here is where Caravan differs from existing projects:Support of AWS Lambda tasksBoto3KISSBring your own workflow framework (standard implementations as contribs)No coupling between Decider code and Activity codePaster compatible config fileFeaturesDecider workerActivity task workerTODOCommands to start/signal/terminate an arbitrary workflow executionCommand to list open workflow executionCommand to register a domain / list domainsConfigurationCaravan uses Boto3 to connect to AWS. SeeBoto 3 configuration guidefor the complete documentation.WarningOn AWS EC2, the metadata provider only provides the credentials, the
must be provided by configuration.Environment VariablesAWS_ACCESS_KEY_IDThe access key for your AWS account.AWS_SECRET_ACCESS_KEYThe secret key for your AWS account.AWS_DEFAULT_REGIONThe default region to use, e.g.us-east-1.AWS_PROFILEThe default credential and configuration profile to use, if any.Configuration FilesThe credentials file is located at~/.aws/credentials:[default]
# The access key for your AWS account
aws_access_key_id=<YOUR ACCESS KEY ID>

# The secret key for your AWS account
aws_secret_access_key=<YOUR SECRET KEY>The settings file is located at~/.aws/config:[default]
# The default region when making requests
region=<REGION NAME>It also supports profiles:[profile dev-profile]
# The default region when using the dev-profile account
region=<REGION NAME>DemoSetup a SWF domain to run this example:$ caravan-domain-register -n CaravanDemo --retention-days 1Write a workflow type (see fulldemo)fromcaravanimportWorkflowclassDemo(Workflow):"""Noop workflow using the bare caravan API."""name='Demo'version='0.1'default_execution_start_to_close_timeout='600'default_task_start_to_close_timeout='10'defrun(self):self.task.print_events()self.task.add_decision('CompleteWorkflowExecution')Run the decider with the Demo workflow:$ caravan-decider -d CaravanDemo -m caravan.examples.demo -t default --verboseStart an execution of the Demo workflow:$ caravan-start -d CaravanDemo -n Demo -v 0.1 -i 1

(The Demo workflow will wait for 5 minutes)List the executions:$ caravan-list -d CaravanDemo
$ caravan-list -d CaravanDemo --oldest 2015-01-01Send a signal to an execution:$ caravan-signal -d CaravanDemo -i 1 -s PRINT --input 'Hello World!'
$ caravan-signal -d CaravanDemo -i 1 -s PRINT --input 'Lorem ipsum'
$ caravan-signal -d CaravanDemo -i 1 -s STOPTerminate an execution:$ caravan-terminate -d CaravanDemo -i 1Similar projectsPython:Simpleflow:https://github.com/botify-labs/simpleflowFlowy:https://github.com/severb/flowyGarcon:https://github.com/xethorn/garconRuby:AWS Flow:https://github.com/aws/aws-flow-rubyReferencesAWS Developer Guide for SWFAWS API reference for SWFDevelopmentPossibly usevirtualenvwrapperto manage your virtualenvs.$ mkvirtualenv caravanor$ virtualenv caravanClone and install development dependencies:(caravan)$ git clone git@github.com:pior/caravan.git
(caravan)$ cd caravan
(caravan)$ pip install -e .[dev]Run tests:(caravan)$ nosetestsReleaseThe release process use zest.releaser:$ fullreleaseLicenseMIT licensed. See the bundledLICENSEfile for more details