GithubHelp home page GithubHelp logo

pumpkin's Introduction

Pumpkin

Pumpkin is a framework for distributed Data Transformation Network (DTN). It is similar to an actor model but data is dynamically routed from one actor to the next. In our model actors are seeds and these can be added to the network dynamically, transformation paths are learnt and data can automatically start flowing to the new seeds.

Download

by cloning

git clone https://github.com/recap/pumpkin.git

by archive

https://github.com/recap/pumpkin/archive/master.zip

Install

If you want to install local

python setup.py install --prefix=~/.local

If you want to install pumpkin to the system:

sudo python setup.py install

Hello World

run:

./bin/pmk --endpoint.type zmq.IPC

If all goes well you should get something like:

INFO:Node assigned UID: slimme-783d9470
INFO:Exec context: e4a460ff
INFO:Node bound to IP: 192.168.1.50
INFO:Starting broadcast listener on port 7700
INFO:Discovered new peer: extract at ipc:///tmp/slimme-783d9470
INFO:Discovered new peer: inject at ipc:///tmp/slimme-783d9470
INFO:Discovered new peer: greet at ipc:///tmp/slimme-783d9470
Greeting: Hello World

you can exit with ctrl-c

Short Explanation

What is happening is that by default Pumpkin il loading seeds from examples/helloworld. If you take a look in that directory you notice 3 files inject.py, greet.py and extract.py. These 3 seeds form a chain to produce the output "Hello World". inject.py is injecting "World" string as data, the greet.py attaches the greeting "Hello" and the extract.py prints the output. These seeds are loosely coupled so much so that they can run on different machines (more on this later).

+----------+         +----------+       +-----------+
|          |         |          |       |           |
|  inject  |-------> |  greet   |------>|  extract  |
|          |         |          |       |           |
+----------+         +----------+       +-----------+

Injecting Data

There are several ways of injecting data. The above demonstrates the use of an injector seed. Another way is through files. if we rerun the above example but first:

create a tmp directory e.x.

mkdir /tmp/rx

then run:

./bin/pmk --endpoint.type zmq.IPC --rx /tmp/rx

This will output the same as above and show "Hello World". At theis point we can inject more data into /tmp/rx directory. To do this you can copy a data packet file [examples/helloworld/data.pkt] to /tmp/rx and check the console output for pmk. If all goes well a new output should be:

Greeting: Hello Mars

Distributing Seeds

Pumpkin allows seeds to be disperesed on different computers. To try this out lets force greet to run on a different host. First install Pumpkin on a differetn host we will call host B. Our current host is host A. On A locate the file greet.py under examples/helloworld/. Edit the file and change the line

##"auto-load" : true,

to

##"auto-load" : false,

This instruct Pumpkin not to load the seed greet automatically. Now on host A run Pumpkin with:

./bin/pmk

If you notice the output only lists 2 seeds

INFO:Discovered new peer: extract at tcp://192.168.1.50:7900
INFO:Discovered new peer: inject at tcp://192.168.1.50:7900

The greet seed is missing. We will host greet on B. After installing Pumpkin on B run the following:

./bin/pmk --seed ./examples/helloworld/greet.py

This instructs Pumpkin to only load the greet seed. After a few seconds you should see "Hello World" as output on A. This is because Pumpkins on A and B discover each other given they are on a LAN and data can flow.

Data Transformation Network

Using the meta data given for each seed about its inputs and outputs, Pumpkin builds data automaton which represents the possible states data can be in the network. The DTN for the hello world example is given below.

dtn

pumpkin's People

Contributors

recap avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

pumpkin's Issues

RabbitMQ connection problems (kakai branch)

Recent changes cause problems with rabbit mq connection:

ERROR:Socket Error on fd 25: 104
Traceback (most recent call last):
  File "DRHarness.py", line 11, in <module>
    main()
  File "/home/pumpkin/pumpkin/pumpkin/Pumpkin.py", line 556, in main
    P.startContext()
  File "/home/pumpkin/pumpkin/pumpkin/Pumpkin.py", line 249, in startContext
    edispatch = ExternalDispatch(context)
  File "/home/pumpkin/pumpkin/pumpkin/PmkExternalDispatch.py", line 50, in __init__
    self.connection = self.__open_rabbitmq_connection()
  File "/home/pumpkin/pumpkin/pumpkin/PmkExternalDispatch.py", line 60, in __open_rabbitmq_connection
    connection = pika.BlockingConnection(pika.ConnectionParameters(host=host,  credentials=credentials, virtual_host=vhost))
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 107, in __init__
    super(BlockingConnection, self).__init__(parameters, None, False)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 62, in __init__
    on_close_callback)
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 590, in __init__
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 206, in connect
    if not self._adapter_connect():
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 283, in _adapter_connect
    self.process_data_events()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 218, in process_data_events
    raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed

Seeds on different VMs at DAS-4 do not find each other

When running the Pumpkin framework for the Web Services and Cloud-based Systems course and trying to deploy different seeds on different VMs, the different seeds can not really find each other. We tried to run the 'tweetinject' and 'filter' seed on one VM and the 'collector' seed on another VM. The first VM did manage to find a 'collector' seed, but on a different IP address (maybe an IP address of another group).
The image below shows the output from running ./run_pumpkin.sh on the first VM
tweetinject_filter_seeds_error
The image below shows the output from running ./run_pumpkin.sh on the second VM
collector_seed_error
After this, there is no more output, the program just keeps running

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.