Fabric Presentation

Fabric Presentation

This past Thursday I gave a presentation on Fabric for TriZPUG. I want to thank everyone for their comments and appreciation. We had a great attendance and good discussions.


I presented Fabric as a tool that I use for automated deployment and maintenance of servers. I can publish and update multiple servers with differential instructions based on their defined roles (e.g. Apache web server, MySQL database server, Nginx server, etc.). We briefly touched on some other cool things you can do like database maintenance, database dumps, backups, Django contribs for remotely working with Model objects, and even toggling maintenance modes for your website.

The next part of the presentation dealt with another use I’ve found for Fabric: bootstrapping a server. The ease of automating distributed systems made Fabric an ideal tool for lightweight configuration of a newly installed OS. Go ahead and have it apt-get/yum/emerge whatever packages are going to be required–again as specified by its defined role. For instance, I have a few fabfiles that will prep an Ubuntu or a RHEL servers for serving Django apps with Nginx, Apache+mod_wsgi, and MySQL.

So, the most common questions and comments I’ve received have been along the lines of “Why not just build packages and meta packages for each server configuration?” This is absolutely an approach that one could take and a powerful one at that. I’ll be the first to admit I am not a packaging whiz so the thought of building a slew of .debs and then maybe parallel .rpms if we have to migrate to a new platform based on the client or project is not super appealing, but luckily I work with people smarter than myself who enjoy that sort of thing.

The sweet spot I’ve found for bootstrapping servers with Fabric is where your server configuration may not be final, the project maybe short term, you may still have to switch between distros, and you do not have access to VMs that can be cloned. Fabric is lightweight and available for your more ephemeral projects that may not necessitate the effort required to build custom packages.

For instance, one place Fabric is handy is prepping Amazon EC2 servers for quick compute jobs. Now I could go ahead and create custom AMIs for every one-off project, but Fabric makes it easy to spin a server up and then bootstrap it with the required packages for a particular project. Nice and lightweight.

I would love to hear about other tools people are using out there. It was nice that after my presentation a bunch of people shared their tools and methods for bootstrapping servers. Og Maciel and other rPathers demonstrated rPath’s rBuilder Online and how it can be used to easily build packages and entire system images or VMs based on sets of packages and a few clicks. Tobias McNulty of the Caktus Consulting Group also demonstrated his work on Mallet, which can be used to quickly build and configure Debian-based servers. Mallet is also available through PyPI.

Overall a great turn out and I learned a lot. Thanks folks!