GithubHelp home page GithubHelp logo

hp4's Introduction

HP4

Requirements

hp4 makes heavy use of the splice(2) and tee(2) system calls, which are both only available on Linux kernels >= 2.6.17.

hp4 requires the following libraries:

To run tests, it additionally requires

Confirmed compatible with libjansson 2.7, libevent 2.0.21 and libcheck 0.10.0. These versions are available in xenial(ubuntu 16.04)'s apt repository.

# apt-get install libevent-dev libjansson-dev check

(libevent 2.0.22 is used in travis to avoid a bug when compiling tests.)

Installation

To install on a fresh precise image: # apt-get install git autoconf automake libtool make

autoreconf -fi
./configure
make
make check
sudo make install

Description

hp4 reads in a json description of a pipeline graph in a similar format to p4. This json file contains two arrays; nodes and edges. Currently, hp4 accepts only EXEC nodes, although the structs and functions in parser.c will parse all node types currently used in p4.

An EXEC node describes a process.

An edge describes the flow of data from one process to another. By default, data will flow from one process' stdout to another's stdin. Data can be tee'd by creating multiple edges from the same node. hp4 can create pipes to send data without using stdout and/or stdin by specifying a port on the edge. All instances of a port will use the same temporary file. Setting a port to - will use stdin/stdout. See the below example.

{
    "nodes": [
        {
            "id": "wget",
            "type": "EXEC",
            "cmd": "wget -o WGET_OUT http://example.com"
        },
        ...
    ],
    "edges": [
        {
            "id": "read-example",
            "from": "wget:WGET_OUT",
            "to": "parser"
        },
        ...
    ]
}

TODO

  • If data is being tee'd to multiple edges, the destination nodes must currently read at the same speed, otherwise the faster will be blocked by the slower.
  • DONE Need to output stats about data flow at regular intervals.

hp4's People

Watchers

 avatar  avatar  avatar

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.