Unleashing the Power of Python, Cement, Dramatiq, Apschedule and Grpc for Superior EDA Solutions!
-- Event-Driven Architecture, Backend-Automation, Event-Driven Automation --
In an an Event-Driven Architecture (EDA) world you need a fast and reliable development cycle even for small projects.
Cement is a well known python project and allows to build fast and super documented CLI apps with easyness.
The Dramatiq background task processing library in combination with RabbitMQ Message Broker runs a reliable and solid EDA environment.
An integrated Grpc service gives access to the available tasks and workflows from outside.
For timed jobs excution there is an integrated interactive Apscheduler cron service.
Kickstart your EDA projects with tokeo and experience a seamless development cycle.
Cheers
Tom
$ make virtualenv
$ source .venv/bin/activate
$ python setup.py develop # currently install will cause an error on lazy-load
$ source .venv/bin/activate
### run the dramatiq workers for the implemented tasks
$ tokeo dramatiq serve
$ source .venv/bin/activate
### run the count_words task
$ tokeo emit count-words --url https://github.com
### check result output on dramatiq serve console
$ source .venv/bin/activate
### run the grpc service for the exported methods
$ tokeo grpc serve
$ source .venv/bin/activate
### run the count_words task
$ tokeo grpc-client count-words --url https://github.com
### check result output on dramatiq serve console
$ source .venv/bin/activate
### run the scheduler
$ tokeo scheduler launch
### now you are in the interactive scheduler shell
Scheduler> list
### will print the active running tasks and their next execution time
### check result output on dramatiq serve console
The log level for the app can be set by config file (config/tokeo.yaml
) or an environment variable.
### this enables the app debug level output
$ TOKEO_LOG_COLORLOG_LEVEL=debug tokeo command
### Instead this enables also the framework debug log
$ tokeo --debug command
### At least this enables framework debug log only
$ CEMENT_LOG=1 tokeo command
This project includes a number of helpers in the Makefile
to streamline common development tasks.
The following demonstrates setting up and working with a development environment:
### create a virtualenv for development
$ make virtualenv
$ source .venv/bin/activate
$ pip install -r requirements-dev.txt
$ python setup.py develop
### check tokeo cli application
$ tokeo --help
### run pytest / coverage
$ make test
Before releasing to PyPi, you must configure your login credentials:
~/.pypirc:
[pypi]
username = YOUR_USERNAME
password = YOUR_PASSWORD
Then use the included helper function via the Makefile
:
$ make dist
$ make dist-upload
Included is a basic Dockerfile
for building and distributing The tokeo
,
and can be built with the included make
helper:
$ make docker
$ docker run -it tokeo --help