GithubHelp home page GithubHelp logo

brainyatom / opsworks-sidekiq Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 19.0 12 KB

Opsworks sidekiq cookbook for Ubuntu and Rails or non-rails sidekiq deploys

License: MIT License

Ruby 56.37% HTML 43.63%

opsworks-sidekiq's Introduction

opsworks-sidekiq

Opsworks sidekiq cookbook for Ubuntu and Rails or non-rails sidekiq deploys

Installation instructions

  1. Make sure you have Redis installed. This cookbook seems decent: https://github.com/brianbianco/redisio

  2. Add this cookbook to your list of Custom Cookbooks

  3. Add the deploy recipe in this cookbook to your Application's Deploy custom recipe. This should be place AFTER your application is deployed to ensure Sidekiq uses the new code checked out.

  4. Configure your sidekiq custom JSON to specify Sidekiq should be deployed with this app:

Supported Options

Currently supported options for the Sidekiq deploy recipe are:

  • start_command

The command to start sidekiq. This will run relative to the root of the current release path.

Defaults to:

bundle exec sidekiq -e production -C config/sidekiq.yml -r ./config/boot.rb 2>&1 >> log/sidekiq.log

Sample Chef JSON configuration

Here is an example Custom JSON which overrides overrides the start_command to set the sidekiq environment to staging:

{
  "deploy": {
    "YOURAPPNAME": {
      "sidekiq": {
        "start_command": "bundle exec sidekiq -e staging -C config/sidekiq.yml -r ./config/boot.rb 2>&1 >> log/sidekiq.log"
      }
    }
  }
}

Here is the minimum deploy config required:

{
  "deploy": {
    "YOURAPPNAME": {
      "sidekiq": {}
    }
  }
}

Environment variables

All Opsworks environment_variables defined within your application will be exposed to the Sidekiq process via the upstart script.

opsworks-sidekiq's People

Contributors

atomgiant avatar benlangfeld avatar kazjote avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

opsworks-sidekiq's Issues

Sidekiq should use the RAILS_ENV variable if available

Right now it defaults to -e production. If this is left out it will default to RAILS_ENV. The actual code is:

    def set_environment(cli_env)
      @environment = cli_env || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
    end

This behaviour makes a lot more sense for OpsWorks since the RAILS_ENV and RACK_ENV variables are set.

Sidekiq is not processing jobs

I have a Rails App running on Opsworks and I used this custom cookbook to set up sidekiq.

It is working properly and after start/deploy my instance Sidekiq is running as I can see when I run ps aux | grep sidekiq, but if I go to my application and create some actions that generate a Sidekiq Job (send email, generate notification) the jobs are not processing and the email/notifications are not generated. Why if Sidekiq is running is not processing the jobs?

Redis is also running when I check it using ps aux | grep redis

sidekiq.yml content:

:pidfile: tmp/pids/sidekiq.pid
development:
:concurrency: 2
production:
:concurrency: 5
:logfile: ./log/sidekiq.log
:queues:
- default

Restart command does not reload /etc/init/sidekiq configuration file

I don't have much experience with upstart, but it seems like the /etc/init/sidekiq-appname.conf file only gets reloaded by running stop sidekiq-appname and then start sidekiq-appname. The major use case here is when environment variables change. An alternate way to fix this would be to not capture environment variables in the configuration file, and expect them to be present on the deploy machine (via /etc/environment or whatever).

Thanks for this great cookbook! It's by far the easiest to use!

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.