Giter Club home page Giter Club logo

lorkbong's Introduction

Lorkbong: Very stupid example for Wukong / Elastic Map Reduce integration

Lorkbong (named after the staff carried by Sun Wukong) is a very very simple example Heroku app that lets you trigger showing job status or launching a new job, either by visiting a special URL or by triggering a rake task.

Setup

  1. Create the app:
heroku create lorkbong-example
  1. Edit the obvious files in config/. You can make life much more dangerous but slightly simpler by adding your keys to the config. If you do this, ake sure you DON’T check this app into a public repo or we’ll switch all our infrastructure to run off your account.
  1. You should probably be more responsible and use environment variables for your credentials. Use the heroku commandline tool to run the following command:
heroku config:add AWS_ACCESS_KEY_ID= heroku config:add AWS_SECRET_ACCESS_KEY= heroku config:add EMR_KEYPAIR=`cat /path/to/your/keypair.pem`
  1. Now visit http://lorkbong-example.heroku.com (or whatever you called it). Follow the link for ‘list jobs’. You should see a listing of any jobs in your queue.

Debugging

  1. Right now the job info is hardcoded into the file app/helpers/emr_script.rb (sorry). Open that file and edit the block so that it runs (for the first time) with ‘alive’ set to true.
  #
  # You need to edit the following things:
  #
  EMR_OPTS = {
    # # Path to the runner.
    :emr_runner    => "#{::ROOT_DIR}/vendor/elastic-mapreduce/elastic-mapreduce",
    # # Temp storage for the keypair file (elastic-mapreduce script demands it be a static file).
    :keypair_file  => ::ROOT_DIR+'/tmp/emr_keypair.pem',
    # # If you're debugging:
    # # first run with alive set to true, and launch the job.
    :alive => true,
    # # After the job has been created and run for the first time, fill your
    # # jobflow into the following and set alive back to nil.
    # :jobflow       => "j-18OUFBXJ0Z01W",
  }
  # Path to the input files. Note the 's3n' prefix.
  EMR_INPUT  = "s3n://emr.yourdomain.com/wukong/data/examples/links-simple-sorted-10k.txt"
  # Path to the output files. This directory must not exist. Note the 's3n' prefix.
  EMR_OUTPUT = "s3n://emr.yourdomain.com/wukong/data/examples/wp-link-degree-4"
  1. Make note of the jobflow ID (or check the list jobs path at /emr/list ) and hack that into the file above for debugging.
  1. Check the AWS console for a closer look at the job progress. You can also find the public IP of the master node from the console, and log in to the machine directly:
  ssh -i /path/to/your/keypair.pem [email protected]

Credits

  • The frontend app is based on Monk / Cartilage, a skeleton for building Sinatra apps.

lorkbong's People

Contributors

tobyjoe avatar

Stargazers

Angus H. avatar Jonathan Chambers avatar Philip (flip) Kromer avatar Régis Gaidot avatar Charles Finkel avatar

Watchers

Philip (flip) Kromer 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.