Giter VIP home page Giter VIP logo

leisure's Introduction

Leisure Suit - Debug and test disco jobs without a cluster

Installation

We reccomend using pip and virtualenv to install.

$ virtualenv leisure
$ cd leisure
$ . ./bin/activate
$ pip install -e [email protected]:trivio/leisure.git#egg=leisure
$ pip install -r src/leisure/requirements.txt 

Leisure needs the python runtime for disco to work correctly. To make installation as easy as possible we've forked a copy of the current disco repo from http://github.com/discoproject.disco.git and moved it's setup.py to the root folder to make pip happy. Hopefully in the future maintaing this fork will not be neccesary.

Usage

To use leisure simply point it at python script that submits disco jobs.

For example::

Using the quintessential word counting example. Create a file called word_count.py with the following content.

from disco.core import Job, result_iterator

def map(line, params):
    for word in line.split():
        yield word, 1

def reduce(iter, params):
    from disco.util import kvgroup
    for word, counts in kvgroup(sorted(iter)):
        yield word, sum(counts)

if __name__ == '__main__':
    print "runnning job"
    job = Job().run(input=["http://discoproject.org/media/text/chekhov.txt"],
                    map=map,
                    reduce=reduce)
    for word, count in result_iterator(job.wait(show=True)):
        print(word, count)

Now execute the script using leisure

$ leisure word_count.py
...

How it works

Leisure works by first monkey patching the disco client. It intercepts all network calls and excetes them on a loccally running worker as specified by your job via the disco worker protocol.

Todo

This is a rabidly evolving work in progress. At current time mapping and reducing work on jobs that don't store their data in ddfs.

Our plans are to

  • Support worker debugging
  • Remote submission
  • Local replay of a failed disco job from a real cluster

Getting Involved

Contributions are welcome! Feel free to submit patches, bug reports and feature requests to our repo at http://github.com/trivio/leisure.

And discuss the project on https://groups.google.com/forum/?fromgroups#!forum/disco-dev

Bitdeli Badge

leisure's People

Contributors

bitdeli-chef avatar srobertson avatar

Watchers

 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.