Skip to content

epistemonikos/poliglo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poliglo

Build Status

WARNING: As this is likely to change a lot in the short term, it's not recommended for production yet.

Why poliglo?

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.

What is Poliglo?

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)

Features

  • Easily connect programming languages
  • Web interface to monitor what is happening
  • Supported programming languages:

Limitations

  • Not safe fail of workers, may lose some jobs if a worker dies.
    • The solution is designed, but haven't been implemented yet

Install Requirements

  • Redis
  • Python
  • npm (Node package manager)

Install

python backend/setup.py develop
cd monitor
npm install -d
bower install -d
cd ..

Run the example

Numbers

This example is located in examples/numbers

This workflow example uses 3 workers:

  • create_random_number
  • find_even
  • write_numbers_to_file

Start the server

CONFIG_PATH=./examples/numbers/config.json \
    WORKFLOWS_PATH=./examples/numbers/workflows \
    python backend/poliglo_server/__init__.py

Poliglo monitor

cd monitor && grunt serve

Run the workers

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

Start a workflow instance

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 42.8%
  • JavaScript 24.7%
  • ApacheConf 18.4%
  • HTML 10.2%
  • Shell 3.4%
  • Nginx 0.4%
  • CSS 0.1%