background preloader

Deployment

Facebook Twitter

Rails app deployment

Modernize your deployment practices with Vagrant. A recurring problem in the world of web development is the complexity associated with setting up a suitable environment for each new project.

Modernize your deployment practices with Vagrant

If we’re lucky, we have up-to-date textual information to perform that setup. Even in that shiny world where we’re lucky, the time required to follow those textual instructions vary depending on the technical skills of the developer. Even when those instructions are up-to-date, it’s not rare at all to routinely spend many hours trying to set this new environment up. Here at SFL, we recently started integrating Vagrant to our projects in order to modernize our deployment methods and results so far are very encouraging.

What is Vagrant? Vagrant is a command line library allowing to quickly create and provision virtual environments through VirtualBox . Benefits Environment setup speed. And within minutes, the site is ready to be used locally. Setup reliability. Homogenous deployment environments. Puppet Tutorial for Linux: Powering up with Puppet. Important This tutorial is rather out of date, and I’m afraid I haven’t had time to update it, because I’ve been working on a whole book that’ll teach you Puppet!

Puppet Tutorial for Linux: Powering up with Puppet

The Puppet 3 Beginners Guide is available now. I recommend you check it out, but I’ll keep the tutorial content here for historical interest, if nothing else.

Yum repos

Puppi: A Puppet module for Deployment Automation. Puppi is a Puppet module that lets users manage and automate the deployment of applications or generally every kind of batch activity that involves the execution of a sequence of scripts and commands.Its structure provides complete flexibility on the actions required for virtually any kind of application deployment but, in order to make usable out of the box, some example defines and scripts are provided to manage common scenarios and needs.The module provides:- The puppi command and its whole working environment- A set of common usage scripts that can be used in chain - Sample defines that can be used for many common application deployment scenarios.

Puppi: A Puppet module for Deployment Automation

The whole picture in an example Before diving into details let's see a brief example.On your node or role you can use a similar define: How do you place files on a puppet master? There are a bunch of best practices that can be followed to make your life easier with Puppet. The following diagram is a visual representation of how I place files on a puppet master to follow a couple of best practices that I've found interesting. Here's a quick list of points that I follow when placing files on a puppet master: Files directly in /etc/puppet should be managed by Puppet itself. This way, you can easily bootstrap a new puppet master if/when needed.All your manifests should be placed in a Git repository, placed in a directory that will contain different environments.

The repository will help you keep a log of all changes, and will help you set up the next point. Advanced Puppet Pattern. When we left off in the Simplest Puppet Install Pattern, we had two files, our site manifest and a class configuring the sudo tool.

Advanced Puppet Pattern

The site manifest, /etc/puppet/manifests/site.pp, contained: # /etc/puppet/manifests/site.pp node default { include sudo } In this case the default node only contains a single class: sudo. The sudo class contained: This simple class performs only one function: managing the /etc/sudoers file. This is a good start but Puppet is capable of a whole lot more so let’s expand on this initial example.

Before we get too far along though, you’ll notice we’ve got a couple of configuration, .pp, files. We’ve already got the core of our new sudo module from the Simplest Puppet Install Pattern so let’s expand on the functions it performs for us. First, we’ve added a new resource type, package, and told it to install the sudo package and always ensure the package installed is the latest version. Automating a Puppet Agent Installation.

Puppet is a very popular configuration management system.

Automating a Puppet Agent Installation

It allows users to deploy new infrastructure in a cloud or traditional enterprise environment quickly and efficiently. When an organization utilizes a configuration management system, it allows IT and DevOps groups to effectively replicate environments on the fly with little to no interaction with the new instance or system. The basic building block for using puppet in the cloud is through the puppet agent. Scaling Puppet with Git. Scaling Puppet with Git More and more people are turning to systems automation tools like Puppet and Chef to get the most out of their environments, and to create time to focus on delivering business benefits.

Scaling Puppet with Git

Scaling Puppet is most commonly done using client/server mode, in which every client is issued with an SSL certificate, and conversations take place between clients and a server, over HTTP, and manifests and assets are served over the network, and applied by a locally running Puppet daemon. Python Deployment Anti-Patterns — Hynek Schlawack. Deploying web applications is hard.

Python Deployment Anti-Patterns — Hynek Schlawack

No shiny continuous deployment talk and no DevOps coolness can change that. Or to use DevOp Borat’s words: “Is all fun and game until you are need of put it in production.“ There are some mistakes I see people doing again and again so I’d like to address them here. This article is also laying ground for the second part where I’ll describe the way we deploy Python applications. My background. Python Application Deployment with Native Packages — Hynek Schlawack. Speed, reproducibility, easy rollbacks, and predictability is what we strive for when deploying our diverse Python applications.

Python Application Deployment with Native Packages — Hynek Schlawack

And that’s what we achieved by leveraging virtual environments and Linux system packages. Preamble & Disclaimer To avoid excessive length, I’ll assume you’re somewhat experienced in DevOps/deployment matters and at least loosely familiar with Fabric to follow the examples. I also won’t be explaining configuration management like Ansible, Puppet, Chef or Salt.

To reap all of the benefits, you’ll need to run a private debian repository server for your packages. If you want to go really light (or don’t have sufficient privileges on the production servers to install packages), you can employ most of the guidelines here except using vanilla tar balls instead of system packages and do the work of the package manager using custom tooling.