pyros-dev / pyzmp

ZeroMQ based multiprocessing framework for python
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

PyZMP

.. start-badges

.. list-table:: :stub-columns: 1

* - docs
  - |docs|
* - tests
  - |travis| |requires| |landscape|
* - Python
  - |version| |downloads| |wheel| |supported-versions| |supported-implementations|
* - ROS
  -  **Indigo** |ros_indigo_pkg| **Jade** |ros_jade_pkg| **Kinetic** |ros_kinetic_pkg|

.. |docs| image:: https://readthedocs.org/projects/pyzmp/badge/?style=flat :target: https://readthedocs.org/projects/pyzmp :alt: Documentation Status

.. |travis| image:: https://travis-ci.org/asmodehn/pyzmp.svg?branch=master :alt: Travis-CI Build Status :target: https://travis-ci.org/asmodehn/pyzmp

.. |requires| image:: https://requires.io/github/asmodehn/pyzmp/requirements.svg?branch=master :alt: Requirements Status :target: hhttps://requires.io/github/asmodehn/pyzmp/requirements/?branch=master

.. |landscape| image:: https://landscape.io/github/asmodehn/pyzmp/master/landscape.svg?style=flat :target: hhttps://landscape.io/github/asmodehn/pyzmp/master :alt: Code Quality Status

.. |version| image:: https://img.shields.io/pypi/v/pyzmp.svg?style=flat :alt: PyPI Package latest release :target: https://pypi.python.org/pypi/pyzmp

.. |downloads| image:: https://img.shields.io/pypi/dm/pyzmp.svg?style=flat :alt: PyPI Package monthly downloads :target: https://pypi.python.org/pypi/pyzmp

.. |wheel| image:: https://img.shields.io/pypi/wheel/pyzmp.svg?style=flat :alt: PyPI Wheel :target: https://pypi.python.org/pypi/pyzmp

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pyzmp.svg?style=flat :alt: Supported versions :target: https://pypi.python.org/pypi/pyzmp

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/pyzmp.svg?style=flat :alt: Supported implementations :target: https://pypi.python.org/pypi/pyzmp

.. |ros_indigo_pkg| image:: https://travis-ci.org/asmodehn/pyzmp-rosrelease.svg?branch=release/indigo/pyzmp :alt: ROS Indigo Build :target: https://travis-ci.org/asmodehn/pyzmp-rosrelease/branches

.. |ros_jade_pkg| image:: https://travis-ci.org/asmodehn/pyzmp-rosrelease.svg?branch=release/jade/pyzmp :alt: ROS Jade Build :target: https://travis-ci.org/asmodehn/pyzmp-rosrelease/branches

.. |ros_kinetic_pkg| image:: https://travis-ci.org/asmodehn/pyzmp-rosrelease.svg?branch=release/kinetic/pyzmp :alt: ROS Kinetic Build :target: https://travis-ci.org/asmodehn/pyzmp-rosrelease/branches

.. end-badges

PyZMP is a multiprocess library based on ZeroMQ.

The aim is to make experimenting with multiprocess and distributed architecture more solid and overall easier. If at all possible, the goal is to arrive at a minimal set of concepts, that makes solid and efficient distributed system easy to build.

Distributed systems models, as per wikipedia https://en.wikipedia.org/wiki/Distributed_computing#Models, can be classified as:

We will focus on the latter first, while keeping in mind it is likely just a special case of the second (network cannot be controlled, algorithm on each node has to be the same). A good exercise here is how to keep a representation of the distribution coherent on each node, despite potential network partition that cna occur.

Doing an Analysis on existing distributed software architecture is likely a very broad task, but we can focus on just a few here, at least as a first step. These should be enough to implement any of the distributed systems models cited above:

with different views for the user, more or less transparently :

Additionally, an interesting endeavour could be to see how https://en.wikipedia.org/wiki/Control_theory applies to such distributed systems (message passing <=> charge transfer).

Note : This is currently a personal perspective that likely require more thorough analysis, so feel free to send a Pull Request.

Repository structure

This repository has a few main branches:

Apart from these we follow a feature branching workflow <https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>_

How to use

Install

pip install pyzmp

Run self tests

pyzmp

How to develop

Clone this repository

git clone http://github.com/asmodehn/pyzmp

Create you virtualenv to workon using virtualenvwrapper

mkvirtualenv pyzmpenv

Install all dependencies via dev-requirements

pip install -r dev-requirements.txt

Run self tests

pyzmp

Run all tests (with all possible configurations) with tox

tox

Note : Tox envs are recreated every time to ensure consistency. So it s better to develop while in a non-tox-managed venv.

Tutorials and examples

A good example showing use of pyzmp, simple RPC client/server example <http://pyzmp.readthedocs.io/en/latest/tutorial.html#simple-rpc-client-server-example>_

tutorials implementing multi node communication <https://github.com/dhirajdhule/pyzmp_tutorials>_ (under development)

Roadmap

Distributed software means software being executed in different "nodes" and collaboration via communication through different "channels":

This will allow us to structure our software in a network graph. PYZMP aims to be the foundation on which such a network graph can be easily, and confidently, built and used.

Implementation Priorities :

  1. Local multiprocess first (we force data partition without forcing connections/sockets management)
  2. Multiple concurrency implementation (Thread (all kinds), entity-component as a monothread implementation)
  3. Remote concurrency (managing remote connections)

Type of Distributed Architecture that can be built with pyzmp:

1) Service(RPC) based architecture http://zguide.zeromq.org/page:all#Ask-and-Ye-Shall-Receive :

2) DataFlow based architecture http://zguide.zeromq.org/page:all#Getting-the-Message-Out :

3) TBD : depending on analysis of existing system and what can be necessary to existing architecture, we will see what comes up.

Constraints: