A workflow service for processing asynchronous tasks across distributed systems
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Initial Commit Mar 31, 2016
config add configurable wait time to recover from ECONNRESET error Aug 31, 2017
db Add missing licenses Mar 31, 2016
docker
documentation added image used in blog post and wiki, remove unused images Mar 31, 2016
lib add network error handling to Events::StartNode Sep 25, 2017
log Add log directory to gitkeep Mar 31, 2016
public Initial Commit Mar 31, 2016
script Add missing licenses Mar 31, 2016
spec
.ci.yml Initial Commit Mar 31, 2016
.ghe-bot.yml Initial Commit Oct 7, 2015
.gitignore Update readme, provide procfile for app startup ease Mar 31, 2016
.ruby-version Initial Commit Mar 31, 2016
.travis.yml Support MRI 2.2 and 2.3 Apr 19, 2016
Dockerfile
Gemfile Enables specifying multiple cron Jun 14, 2016
Gemfile.lock Enables specifying multiple cron Jun 14, 2016
LICENSE Initial Commit Mar 31, 2016
Procfile Update readme, provide procfile for app startup ease Mar 31, 2016
README.md Merge pull request #8 from groupon/support_more_ruby_versions_in_travis Apr 19, 2016
Rakefile
config.ru Add the sidekiq ui to the app Mar 31, 2016
docker-compose.yml
torquebox_init.rb Add missing licenses Mar 31, 2016

README.md

Backbeat

Backbeat Build Status

This is the server application for Backbeat, the open-source workflow service by Groupon. For more information on what Backbeat is, and documentation for using Backbeat, see the wiki.

Quick Start With Docker (Not recommended for production environments)

The docker build will create a user based on the BACKBEAT_USER_ID and BACKBEAT_CLIENT_URL environment variables set in the backbeat_user.env file. Change these as necessary.

Move the backbeat_user.env.example file into place:

$ mv docker/backbeat_user.env.example docker/backbeat_user.env

Start the server(starts web workers and sidekiq workers):

$ docker-compose build
$ docker-compose -f docker/docker-compose.local.yml up

Run a backbeat console:

$ bin/docker_console

Setting up the Server Application

  1. Clone the repo:
$ git clone git@github.com:groupon/backbeat.git
  1. Install a Ruby version manager if necessary:
  1. Install any of the supported Ruby versions:
  • JRuby 1.7.3 - 1.7.20
  • MRI 2.0.0 - 2.3.0
  1. Install Bundler if necessary:
$ gem install bundler
  1. Open up the project:
$ cd backbeat
  1. Install the necessary gems:
$ bundle install
  1. Install Postgres or use an existing Postgres db

    • We recommend postgresql-9.4 but Backbeat currently supports any postgres version that allows the uuid-ossp extension

    • Install on Mac OS

      $ brew install postgres
    • Install on Linux

  2. Create backbeat role in postgres DB with your postgres user (postgres in this example)

$ sudo su postgres -c "psql -c \"CREATE ROLE backbeat with SUPERUSER LOGIN PASSWORD 'backbeat'\";"
$ psql -d postgres
# CREATE ROLE backbeat with SUPERUSER LOGIN PASSWORD 'backbeat';
> CREATE ROLE
  • Note you can change your db configs to what ever you'd like in config/database.yml. The above command allows for the default values in the .yml
  • Note, on Lion+ you may already have a postgres user, _postgres.
  • Note, you might not be able to get this working, so try Postgres.app.
  1. Create the database
$ bundle exec rake db:create
  1. Run the database migrations using the following
$ bundle exec rake db:migrate
  1. Open backbeat server console and you have access to the db
$ bundle exec rake console
Workflow.last # should return nil
  1. Install Redis or use an existing Redis instance
  • Redis is used for processing of asynchronous and scheduled jobs with Sidekiq

  • Install on Mac OS

    $ brew install redis
  • Install on Linux

  1. Start Web Server and Workers
  • For testing you can run these as daemons or in different terminal windows
  • For production you will want to use some sort of monitoring on these processes.
  • See the Procfile for a summary of the processes
$ foreman start

Commands

Running the tests:

$ RACK_ENV=test rake db:create db:migrate
$ rspec

Run the migrations:

$ rake db:create db:migrate

Open a console:

$ rake console

Start the server:

$ rackup

Start the sidekiq workers:

$ bin/sidekiq