A simple intro Garcon workflow.
- python 3.4
$ pyvenv ./env
$ source ./env/bin/activate
$ pip install -r requirements.txt
.env.shadow is a template environment variable script that exports keys and values necessary for the app. You will need to copy this file to .env
and populate the necessary keys.
$ cp .env.shadow .env
$ vim .env
$ source .env
In seperate terminals run a Decider & a Worker
(don't forget to activate the virtualenv and set the required .env variables first in each terminal)
$ source env/bin/activate
$ source .env
$ python ./run_worker.py
$ source env/bin/activate
$ source .env
$ python ./run_decider.py
Once a Decider & Worker are running, open another terminal & execute a workflow.
$ source env/bin/activate
$ source .env
$ python ./execute_workflow.py
After executing python ./execute_workflow.py
, a SWF flow will be visible in the AWS console. Once the Decider & Worker pick up the workflow request from AWS, they will begin printing to standard output in their terminals.
- When a Decider / Worker is killed and restarted in the middle of the polling AWS, there is a risk for the next 70 seconds that AWS will mistakenly send a Decider/Worker action to the old, dead daemon see here. If it takes longer than a minute for a workflow to begin executing, kill the work flow via the AWS console.