All Projects → groupon → backbeat

groupon / backbeat

Licence: BSD-3-Clause license
A workflow service for processing asynchronous tasks across distributed systems

Programming Languages

ruby
36898 projects - #4 most used programming language

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 [email protected]: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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].