Back to Resources

Blog

Posted October 6, 2015

Cattle, Not Pets - Use Automation Software To Provision Your Servers

quote

This guest post was written by Julian Dunn, Product Manager at Chef Software (@julian_dunn)

In Greg Sypolt’s earlier post on immutable infrastructure, he outlined practices for treating your servers more like cattle and not pets. It’s better to rebuild things if you can rather than spending calories on manually debugging and fixing long-lived servers. (Of course, you will inevitably have a few pets in your infrastructure; for instance, database servers that actually hold customer data that would be inconvenient to constantly rebuild.)

Automation software like Chef can help with the provisioning and automated setup of new cattle in a consistent way without having to resort to shell scripting or other ugly, hard-to-understand tools. Chef can also help you with maintaining consistency among the few pet servers that you do have.

One trend we’ve seen in the pets-to-cattle migration is the externalization of interface testing tools from long-lived, always-on test driver clusters to ephemeral instances or containers to drive UI tests, record the results, report them to a central dashboard and then destroy themselves. These cloud-native testing systems like Sauce Labs also provide a far richer set of functionality, like video recording and playback of the UI test, than can be achieved with artisanally-crafted, on-premise solutions. In other words, why mess around with having to configure and maintain Xvfb, Selenium, Webdriver and so on, yourself, for a boatload of platforms and platform versions when you can just use Sauce Labs?

One technical challenge to using a cloud-based testing solution like Sauce Labs is that many applications are internal-only. They may reside behind a corporate firewall, unreachable from the Internet. That is why several years ago, Sauce Labs created the Sauce Connect proxy, which creates a per-customer VPN tunnel between a network with the application under test, and Sauce Labs’ testing driver machines, allowing you to test your internal applications.

You likely want this VPN tunnel to be transient, and even treat the machines running the tunnel as cattle too. This necessitates a way to install, configure, start up and destroy tunnel machines as needed. This is a perfect use case for Chef; enter the Sauce Connect Cookbook, which does exactly that. By configuring a few simple attributes like your Sauce Labs user API key, you can easily achieve this objective. Chef can also be used to set up and manage all other aspects of your testing infrastructure, like Jenkins or TeamCity servers and their build nodes, and even deploy the applications under test into container runtimes or virtual machines. Hopefully this article has whetted your appetite enough to convince you to extend the “cattle, not pets” philosophy to your testing practices, as well. You can learn more about Chef and what it does at www.chef.io.

Published:
Oct 6, 2015
Share this post
Copy Share Link
© 2023 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are registered trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.