how to start sidekiq on engineyard

1.5k views Asked by At

i am shifting a rails3 app from heroku to engine yard. I want to know how to start(or restart) sidekiq on engine yard on each deployment? To check that sidekiq is working, i ssh to EY instance and manually start sidekiq. I want this process to be handled from EY deployment script(config/deploy.yml). I am used to mina deployment and EC2.

1

There are 1 answers

1
James P On

Engine Yard provides two ways to customize your environment. You can use custom chef recipes, and deploy hooks.

For SideKiq you will want to use both. You will use a custom chef recipe to configure and run SideKiq, and a deploy hook to restart SideKiq each time you deploy new code.

Engine Yard provides a pre-made example custom chef recipe for SideKiq at http://github.com/engineyard/ey-cloud-recipes/tree/master/cookbooks/sidekiq. The documentation on the example recipe shows exactly what to use for your deploy hook as well.

To use the custom recipe, you will first need to install the engine yard gem locally (gem install engineyard). Then you will make a copy of their example repositories using git clone [email protected]:engineyard/ey-cloud-recipes.git.

Once you've cloned the repository, you will need to add require_recipe 'sidekiq' to ./ey-cloud-recipes/cookbooks/main/recipes/default.rb, then modify the sidekiq recipe as described in the documentation.

Once everything is complete, you can run ey recipes upload, and then ey recipes apply to apply the recipes to your environment. You may need to specify some command line options, depending on if the EY gem can guess which application and environment you are attempting to apply the recipes to. The output from the ey command should provide you with the information you need to do so.

After you've applied the recipes, you will want to create they deploy hooks inside your git repository that your application resides in. Create a 'deploy' directory in the root of your repository and add the after_restart.rb deploy hook as described on the sidekiq chef recipe's documentation.

Re-deploy and you should be good to go.

If you run into any problems, please put in a ticket at Engine Yard's support and we will be happy to assist you.