[chef] Re: Rails Recommendations


Chronological Thread 
  • From: Vladimir Skubriev < >
  • To:
  • Subject: [chef] Re: Rails Recommendations
  • Date: Mon, 1 Sep 2014 14:16:36 +0400



2014-09-01 10:12 GMT+04:00 Angus Buchanan < " target="_blank"> >:
I'm a sysadmin that comes from a Windows background, although I'm fairly comfortable with Linux, and LAMP stuff.  Now I need to deploy a simple rails application into a dev/test env and also into production.  It's  a very low load site, and it only needs to be available during office hours.  I'm imagining initially that it could run on a single machine, but splitting it out isn't a big deal later I guess.  I should point out that I'm ok at Ruby beyond Chef, but I'm not a web developer - I don't know much about Rails yet, and I've never written an Rails app before, so I'm new to the ecosystem.  The app in question was written by a friend, and is for a charity, and I'm helping them out.  I'm not in any rush, but I'd like to know the best approach.

What I'd like to know is what the current recommended approach is to building a server to run and deploy Rails in production, on Linux.  Specifically:

1) I have seen the application and application_rails cookbooks used - this seems to take a capistrano-like approach and implement it in Chef.  I'm ok with this, but I think that I might prefer to deploy it with capistrano or mina instead.  Is the application cookbook approach recommended?

You can use them. But you need to remember that you will spend a decent amount of time with testing and learning this cookbooks. Other case - use chef and write you own recipe based on default HOW_TO to setup rails application and what you need. Everywhere when you use chef cookbook's - add time to their study and testing. Automating needed in those places where it is absolutely necessary and can save a time.

2) An alternative approach that I'm interested in is using Omnibus to build a package that contains everything I need for the application to run, and the application itself.  If this were the case would I deploy the app using Chef's file or package resource, as cap or mina wouldn't be used? I think this might solve the following question...
 
That's good approach, but you should learn packaging system policy's documents. This is not easy way. But it's is you right.


3) What's the recommended way to get Ruby on the system?  I am not very keen on the idea of using rvm on servers, but system packages tend to lag too.  What is recommended?
 
You don't have a another way except using rvm or rbenv. Better to use rvm and install them for the user. Why better - because rvm more elegant way to use ruby on the system. There are a good cookbook chef-rvm to do it.


4) What's the recommended way to actually serve the app?  I've read about Apache and Passenger - this seems like a straightforward approach, and simpler than unicorn or puma and so on.  Are there good community cookbooks that can help here?

Passenger is a default app server (Should be enough).
See passenger cookbook if you wish to install them with chef. But in simple approach I recommend to install them manually with chef bash scripts. You can see a redmine cookbook for example.

5) What about database stuff?  I see there's a database cookbook with some powerful tools, and a mysql cookbook, but should I try to seed the database with Chef or do that manually?

You can use database cookbook, but you pay for that you time. In a simple production  case just create a db manually and connect to it from you application. If you need to create a test environment then use database cookbook (recipe) for complete deploy test environment in vagrant machine with kitchen.ci for example. I think this is a very simple use case.

I think that's all my questions for now... thanks in advance for your guidance.

-aob



--
Faithfully yours,

CVision Lab System Administrator
Vladimir Skubriev




Archive powered by MHonArc 2.6.16.

§