Coder Social home page Coder Social logo

flask-hbase-todos's Introduction

Todo Application##

A simple todo list application built on Python 2.7, Flask, and Twitter Bootstrap. HappyBase is used to provide easy hbase access to a remote Hortonworks cluster.

In order to follow along, you'll need:

  • The HortonWorks Sanbox, or an Amazon account for hosting a HortonWorks Hadoop AMI.
  • VirtualBox
  • git
  • ssh
  • RubyGems
  • Python (with easy_install or pip)
  • a Free OpenShift Online account
  • and, the RHC command-line tool

The rhc command-line tool can be installed via RubyGems with:

gem install rhc

After signing up for an OpenShift account, and installing rhc, you'll be able to configure your local machine to work with your new cloud applications:

rhc setup

Now that your development environment is ready, spin up a fresh copy of this app in a single command:

$ rhc app create todo python-2.7 --from-code=https://github.com/ryanj/flask-hbase-todos HBASE_HOST=MY_REMOTE_HBASE_HOST HBASE_PORT=9090

If you already have a Hadoop cluster available, enter it's host URL or IP address as the value to your application's HBASE_HOST key.

For this application, we'll use the HBASE_HOST environment variable to help keep our source clean, and to help enhance the project's portability and reusablility.

If you choose to create your application using OpenShift's web workflow, or if you would like to make changes to your app's current "HBASE_HOST" setting, run the following (assuming "todo" is your app name):

$ rhc env set HBASE_HOST=MY_REMOTE_HBASE_HOST -a todo
$ rhc env set HBASE_PORT=MY_REMOTE_HBASE_PORT -a todo

OpenShift operators can also make hbase service connection strings available to developers as a cartridge, by installing a modified copy of this hbase-external cart into their OpenShift Enterprise or Origin environments.

AMIs from HortonWorks

Hosting your own Hadoop in the cloud is a breeze with the HDP2_REDSHIFT_DEMO_AMI image, available in Amazon's US East Region.

Just click 'Launch', then open up port 9090 for outside access, allowing your OpenShift environment to connect directly to your new datastore.

Then, make sure to pass your HBASE_HOST, and HBASE_PORT to your application through the system environment, as documented in the previous section.

HortonWorks Sandbox

The HortonWorks Sandbox is an excellent choice for local development scenarios.

After firing up the Sandbox virtual environement, you'll be presented with instructions on how to connect to the Hortonworks Hadoop web dashboard.

Support for Hbase can be enabled in just a click or two.

Local Developmet

Flask, happybase, and a HoronWorks Sandbox are all required for setting up your local development environment.

When you create an application using the rhc command-line tool, a local copy of your project source code will automatically be created for you to work with.

If you created your application using a web-based workflow, you can always retrieve your project source with:

rhc git-clone todo

Then, run the following to start your local server:

python app.py

Enjoy!

License

This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to CC0 (http://creativecommons.org/publicdomain/zero/1.0/)

flask-hbase-todos's People

Contributors

shekhargulati avatar ryanj avatar

Stargazers

webon avatar

Watchers

James Cloos avatar webon avatar

Forkers

realmichaelzyy

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.