16 Oct
2009
I’m still loving the EngineYard Cloud for my client deployments. I encountered one snag today, though, when cloning an environment for staging: Custom chef recipes do not get cloned along with the rest of the environment.
This means that if you have uplaoded/deployed custom chef recipes for, say, a production environment, and then you clone that environment to one called, say, staging, your custom recipes will not be automagically available in the staging environment. This could be bad if your application depends on something like MongoDB being installed by your chef recipes. :)
The fix is simple. Just upload your recipes using the ey-recipes tool to the new environment once you create it from scratch or via a clone. I would argue that it makes sense to clone the recipes along with the rest of the environment, but at least the workaround is easy.
Comments : 2 Comments »
Categories : Chef, EngineYard
13 Oct
2009
I needed to deploy an anonymous FTP server, and of course I wanted to do it using Chef, so I went looking for a Chef recipe to install ProFTPD. Sadly, the lazyweb failed me. So, I did some actual work so the lazyweb won’t fail you. :)
Here is the commit that adds a ProFTPD Chef recipe to my fork of the ey-cloud-recipes repo. Enjoy!
Comments : No Comments »
Categories : Chef
8 Oct
2009
I’m getting a client up and running on EngineYard’s Cloud offering, and it has been a pleasure. One of the things I’ve appreciated about using it is that I’m forced (in a good way) to use Chef, which is awesome.
Today I was ready to deploy a new version of the app with search using Sphinx, so I added the thinking_sphinx recipe to the default recipes that EngineYard provides, deployed my recipes, and I was done. Well, almost. This app also needs a regular update to the sphinx index, so I need a cron job to run the indexer.
After a quick scan of the Chef docs regarding cron, I added this snippet to my copy of the thinking_sphinx recipe:
cron "indexer" do
minute "22"
command "cd /data/#{app_name}/current && RAILS_ENV=#{node[:environment][:framework_env]} rake ts:index"
user node[:owner_name]
only_if do File.exist?("/var/log/engineyard/sphinx/#{app_name}") end
end
After a simple deploy of the updated recipe, I now have a cron job that runs as my deploy user and runs the re-index rake task. Fun stuff.
P.S. Yes, I could have used EY’s lovely web UI for adding the cron job rather than fiddling with the recipe, but I like having as much as possible living in text files under version control. :)
Comments : 2 Comments »
Categories : EC2, Ruby on Rails, Sphinx
Recent Comments