WARNING: As this is likely to change a lot in the short term, it's not recommended for production yet.
Today there are a lot of programming languages, and some of them are pretty good for certain tasks. But generally, using them together is painful, specially if you want them to talk to each other.
It's a simple way to create a small piece of code (worker) in some programming language, and connect it to another worker, maybe in another language. So you could do something like this:
worker(js) -> worker(py) -> worker(java)
- Easily connect programming languages
- Web interface to monitor what is happening
- Supported programming languages:
- Not safe fail of workers, may lose some jobs if a worker dies.
- The solution is designed, but haven't been implemented yet
- Redis
- Python
- npm (Node package manager)
python backend/setup.py develop
cd monitor
npm install -d
bower install -d
cd ..
This example is located in examples/numbers
This workflow example uses 3 workers:
- create_random_number
- find_even
- write_numbers_to_file
CONFIG_PATH=./examples/numbers/config.json \
WORKFLOWS_PATH=./examples/numbers/workflows \
python backend/poliglo_server/__init__.py
cd monitor && grunt serve
POLIGLO_SERVER_URL=localhost:9015 \
WORKERS_PATHS=./examples/numbers/workers/ \
SUPERVISOR_LOG_PATH="/tmp/poliglo_supervisor_logs" \
deployment/scripts/start_workers.sh
If there is any problem check out the logs in $SUPERVISOR_LOG_PATH
python examples/start_a_workflow_instance.py
And take a look at the monitor to see it running (http://localhost:9000). If there is any error, press over the error column number. See the error, try to fix it, restart the server and the workers and press the retry button.
When it's done, cat the file to see the result: cat /tmp/poliglo_example_numbers.txt
Did you notice that in the file there were less numbers than the initial ones? That's because the find_even worker is filtering the numbers that are not even.
Start the containers (server, monitor & worker):
docker-compose up
python examples/start_a_workflow_instance.py
http://0.0.0.0:9000