<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[kief.com]]></title>
  <link href="http://kief.com/atom.xml" rel="self"/>
  <link href="http://kief.com/"/>
  <updated>2012-02-20T09:08:20+00:00</updated>
  <id>http://kief.com/</id>
  <author>
    <name><![CDATA[Kief Morris]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[The conflict between Continuous Delivery and traditional Agile]]></title>
    <link href="http://kief.com/the-conflict-between-continuous-delivery-and-traditional-agile.html"/>
    <updated>2012-01-22T00:00:00+00:00</updated>
    <id>http://kief.com/the-conflict-between-continuous-delivery-and-traditional-agile</id>
    <content type="html"><![CDATA[<p>In working with development teams at organizations which are adopting <a href="http://en.wikipedia.org/wiki/Continuous_Delivery">Continuous Delivery</a>, I have found there can be friction over practices that many developers have come to consider as the right way for Agile teams to work. I believe the root of conflicts between what I&#8217;ve come to think of as traditional agile and CD is the approach to making software &#8220;ready for release&#8221;.</p>

<h4>Evolution of software delivery</h4>


<p><img src="http://kief.com/images/waterfall.jpg" align="right" alt="Waterfall" />
A usefully simplistic view of the evolution of ideas about making software ready for release is this:</p>

<ul>
<li><strong>Waterfall</strong> believes a team should only start making its software ready for release when all of the functionality for the release has been developed (i.e. when it is &#8220;feature complete&#8221;).</li>
<li><strong>Agile</strong> introduces the idea that the team should get their software ready for release throughout development. Many variations of agile (which I refer to as &#8220;traditional agile&#8221; in this post) believe this should be done at periodic intervals.</li>
<li><strong>Continuous Delivery</strong> is another subset of agile which in which the team keeps its software ready for release at all times during development. It is different from &#8220;traditional&#8221; agile in that it does not involve stopping and making a special effort to create a releasable build.</li>
</ul>




<h4>Continuous Delivery is not about shorter cycles</h4>


<p>Going from traditional Agile development to Continuous Delivery is not about adopting a shorter cycle for making the software ready for release. Making releasable builds every night is still not Continuous Delivery. CD is about moving away from making the software ready as a separate activity, and instead developing in a way that means the software is <em>always</em> ready for release.</p>

<h4>Ready for release does not mean actually releasing</h4>


<p>A common misunderstanding is that Continuous Delivery means releasing into production very frequently. This confusion is made worse by the use of organizations that release software multiple times every day as poster children for CD. Continuous Delivery doesn&#8217;t require frequent releases, it only requires ensuring software <em>could</em> be released with very little effort at any point during development. (See Jez Humble&#8217;s article on <a href="http://continuousdelivery.com/2010/08/continuous-delivery-vs-continuous-deployment/">Continuous Delivery vs. Continuous Deployment</a>.) Although developing this capability opens opportunities which may encourage the organization to release more often, many teams find more than enough benefit from CD practices to justify using it even when releases are fairly infrequent.</p>

<h4>Friction points between Continuous Delivery and traditional Agile</h4>


<p>As I mentioned, there are sometimes conflicts between Continuous Delivery and practices that development teams take for granted as being &#8220;proper&#8221; Agile.</p>

<h4>Friction point: software with unfinished work can still be releasable</h4>


<p>One of these points of friction is the requirement that the codebase not include incomplete stories or bugfixes at the end of the iteration. I explored this in <a href="http://kief.com/continuous-development/iterations-considered-harmful.html">my previous post on iterations</a>. This requirement comes from the idea that the end of the iteration is the point where the team stops and does the extra work needed to prepare the software for release. But when a team adopts Continuous Delivery, there is no additional work needed to make the software releasable.</p>

<p>More to the point, the CD team ensures that their code could be released to production even when they have work in progress, using techniques such as <a href="http://martinfowler.com/bliki/FeatureToggle.html">feature toggles</a>. This in turn means that the team can meet the requirement that they be ready for release at the end of the iteration even with unfinished stories.</p>

<p>This can be a bit difficult for people to swallow. The team can certainly still require all work to be complete at the iteration boundary, but this starts to feel like an arbitrary constraint that breaks the team&#8217;s flow. Continuous Delivery doesn&#8217;t require non-timeboxed iterations, but the two practices are complementary.</p>

<h4>Friction point: snapshot/release builds</h4>


<p>Many development teams divide software builds into two types, &#8220;snapshot&#8221; builds and &#8220;release&#8221; builds. This is not specific to Agile, but has become strongly embedded in the Java world due to the rise of Maven, which puts the snapshot/build concept at the core of its design. This approach divides the development cycle into two phases, with snapshots being used while software is in development, and a release build being created only when the software is deemed ready for release.</p>

<p>This division of the release cycle clearly conflicts with the Continuous Delivery philosophy that software should always be ready for release. The way CD is typically implemented involves only creating a build once, and then promoting it through multiple stages of a pipeline for testing and validation activities, which doesn&#8217;t work if software is built in two different ways as with Maven.</p>

<p>It&#8217;s entirely possible to use Maven with Continuous Delivery, for example by creating a release build for every build in the pipeline. However this leads to friction with Maven tools and infrastructure that assume release builds are infrequent and intended for production deployment. For example, artefact repositories such as Nexus and Artefactory have housekeeping features to delete old snapshot builds, but don&#8217;t allow release builds to be deleted. So an active CD team, which may produce dozens of builds a day, can easily chew through gigabytes and terabytes of disk space on the repository.</p>

<h4>Friction point: heavier focus on testing deployability</h4>


<p><img src="http://kief.com/images/burning_oil_rig.jpg" align="left" alt="Nobody likes cleaning up broken builds" /> A standard practice with Continuous Delivery is automatically deploying every build that passes basic Continuous Integration to an environment that emulates production as closely as possible, using the same deployment process and tooling. This is essential to proving whether the code is ready for release on every commit, but this is more rigorous than many development teams are used to having in their CI.</p>

<p>For example, pre-CD Continuous Integration might run automated functional tests against the application by deploying it to an embedded application server using a build tool like Ant or Maven. This is easier for developers to use and maintain, but is probably not how the application will be deployed in production.</p>

<p>So a CD team will typically add an automated deployment to an environment will more fully replicates production, including separated web/app/data tiers, and deployment tooling that will be used in production. However this more production-like deployment stage is more likely to fail due to its added complexity, and may be may be more difficult for developers to maintain and fix since it uses tooling more familiar to system administrators than to developers.</p>

<p>This can be an opportunity to work more closely with the operations team to create a more reliable, easily supported deployment process. But it is likely to be a steep curve to implement and stabilize this process, which may impact development productivity.</p>

<h4>Is CD worth it?</h4>


<p>Given these friction points, what benefit is there to moving from traditional Agile to Continuous Delivery worthwhile, especially for a team that is unlikely to actually release into production more often than every iteration?</p>

<ul>
<li>Decrease risk by uncovering deployment issues earlier,</li>
<li>increase flexibility by giving the organization the option to release at any point with minimal added cost or risk,</li>
<li>Involves everyone involved in production releases - such as QA, operations, etc. - in making the full process more efficient. The entire organization must identify difficult areas of the process and find ways to fix them, through automation, better collaboration, and improved working practices,</li>
<li>
<span class='pullquote-right' data-pullquote='releasing becomes autonomic, like breathing, rather than traumatic, like giving birth '>
By continuously rehearsing the release process, the organization becomes more competent at doing it, so that releasing becomes autonomic, like breathing, rather than traumatic, like giving birth,
</span>
</li>
<li>Improves the quality of the software, by forcing the team to fix problems as they are found rather than being able to leave things for later.</li>
</ul>




<h4>Dealing with the friction</h4>


<p>The friction points I&#8217;ve described seem to come up fairly often when Continuous Delivery is being introduced. My hope is that understanding the source of this friction will be helpful in discussing it when it comes up, and working through the issues. If developers who are initially uncomfortable with breaking with the &#8220;proper&#8221; way of doing things, or find a CD pipeline overly complex or difficult understand the aims and value of these practices, hopefully they will be more open to giving them a chance. Once these practices become embedded and mature in an organization, team members often find it&#8217;s difficult to go back to the old ways of doing them.</p>

<p><strong>Edit:</strong> I&#8217;ve rephrased the definition of the &#8220;traditional agile&#8221; approach to making software ready for release. This definition is not meant to apply to all agile practices, but rather applies to what seems to me to be a fairly mainstream belief that agile means stopping work to make the software releasable.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Iterations considered harmful]]></title>
    <link href="http://kief.com/iterations-considered-harmful.html"/>
    <updated>2012-01-04T00:00:00+00:00</updated>
    <id>http://kief.com/iterations-considered-harmful</id>
    <content type="html"><![CDATA[<p>The iteration is a cornerstone of agile development. It provides a heartbeat for the team and its stakeholders, and a structure for various routine activities that help keep development work aligned with what the customer needs. However, the way many teams run their iterations creates serious pitfalls which can keep them from delivering software as effectively as they could.</p>

<p>The orthodox approach to the iteration is to treat it as a timebox for delivering a batch of stories, which is the approach most <a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a> teams take with sprints (the Scrum term for an iteration). In recent years many teams have scrapped this approach, either using iterations more as a checkpoint, as many ThoughtWorks teams do, or scrapping them entirely with <a href="http://en.wikipedia.org/wiki/Kanban_(development)">Kanban</a> and <a href="http://en.wikipedia.org/wiki/Lean_software_development">Lean software development</a>.</p>

<p>For the purpose of this post, I will refer to these two general approaches to running iterations as the &#8220;orthodox&#8221; or &#8220;timeboxed-batch&#8221; iteration model on the one hand, and the &#8220;continuous development&#8221; model on the other hand. Although orthodox iterations have value, certainly over more old-school waterfall project management approaches, continuous development approaches which do away with timeboxing and avoid managing stories in batches allow teams to more effectively deliver higher quality software.</p>

<blockquote>
<strong>Orthodox iteration model:</strong> (or &#8220;timeboxed-batch&#8221; model). Each iteration works on a fixed batch of stories, all of which must be started and finished within a single iteration.
<strong>Continuous development model:</strong> Stories are developed in a continuous flow, avoiding the need to stop development in order to consolidate a build containing only fully complete stories.
</blockquote>




<h4>The anatomy of the orthodox iteration</h4>


<p>In the classically run iteration or sprint, the Product Owner (PO) and team choose a set of stories that it commits to deliver at the end of the iteration. All of the stories in this batch should be sufficiently prepared before the iteration begins. The level and type of preparation varies between teams, but usually includes a level of analysis including the definition of acceptance criteria. This analysis should have been reviewed by the PO and developers to ensure there is a common understanding of the story. The PO should understand what they can expect to have when the story is implemented, and the technical team should have enough of an understanding of the story to estimate it and identify potential risks.</p>

<p>The iteration begins with an iteration kickoff meeting (IKO) where the team reviews the stories and confirms their confidence that they can deliver the stories within the iteration. The developers then choose stories to work on, discussing each story with the PO, Business Analyst (BA), and/or Quality Analyst (QA) as appropriate, then breaking it down into implementation tasks. Implementation takes place with continual reviews, or even pairing with these other non-developers, helping to keep implementation on track, and minimizing the amount of rework needed when the story is provisionally finished and goes into testing.</p>

<p>The QA and BA/PO then test and review each story as its implementation is completed. This is in addition to the automated testing which has been written and repeatedly running following TDD and CI practices. Only once the story is signed off do the developers move on to another one of the stories in the iteration&#8217;s committed batch.</p>

<p>As the end of the iteration approaches, developers and QAs should be wrapping up the last stories and preparing a releasable build for the showcase, which is typically held on the final day of the iteration. In the showcase, the team demonstrates the functionality of the completed stories to the PO and other stakeholders, the stories are signed off. The team holds a retrospective to consider how they can work better, then on the next working day they hold the IKO to start the following iteration.</p>

<p>When the iteration ends the team has a complete, fully tested and releasable build of the application, regardless of whether the software actually will go into production at this point.</p>

<p>The start and end dates of the iteration are firmly fixed. If there are stories (or defect fixes) which aren&#8217;t quite ready at the end of the iteration, the iteration end date is never slipped. Instead, the story is not counted as completed, so must be carried over to the next iteration.</p>

<h4>The benefits of the orthodox iteration</h4>


<p>This style of iteration offers many benefits over traditional waterfall methodologies. A short, rigid cycle for producing completely tested and releasable code forces discipline on the team, keeping the code in a near-releasable state throughout the project, and avoiding the temptation to leave work (e.g. testing) for &#8220;later&#8221;, building up unmanageable burdens of work, stress, and defects to be dealt with under the pressure of the final release phase.</p>

<p>The timeboxed iteration also forces the team to learn how to define stories of a manageable size. If stories are routinely too big to complete in one iteration this is a clear sign that the team needs improve the way it defines and prepares stories.</p>

<p>This demonstrates another benefit of the iteration, which is frequent feedback. The team is able to evaluate not only the quality of their code and its relevance to the business by getting feedback quickly, they are also able to evaluate how effectively they are working, and try out ideas for improving continually throughout the project.</p>

<h4>Fundamental problems with the orthodox itertation</h4>


<p>The timeboxed-batch approach to iterations has value, particularly for teams inexperienced with agile. However, it has fundamental problems. At core, this approach is waterfall written small, with many of the same flaws, albeit with a small enough cycle that issues can be dealt with more quickly than with a full waterfall project.</p>

<p>To understand why this is so, let&#8217;s flesh out the idealized anatomy of the iteration from above with some of the things which often happen in practice.</p>

<ul>
<li>At the start of the iteration, no development is taking place, because everyone is working on preparing the new batch of stories. The BA&#8217;s are extremely busy now, because they have a full working set of stories to hand over to developers (i.e. however many stories the team can work on at once, that&#8217;s how many stories the BA&#8217;s must hand over all at the same time). The QA&#8217;s are less busy now, although they may be helping the BA&#8217;s out, and planning their testing for the iteration&#8217;s stories.</li>
<li>Actually, I lied. Development is taking place, and QA&#8217;s are extremely busy. Testing and bugfixing stories left over from the previous iteration is still going on. See points below to understand why. As a result, preparation and starting of the stories for this iteration is sluggish because of work carried over from the previous iteration. This actually isn&#8217;t necessarily bad, since it helps to stagger the story preparation work, preventing the BA&#8217;s from becoming a bottleneck. However, depending on whether carryover work was factored into the number of stories chosen for the current iteration (business pressures often make this difficult), this may mean the team is already at risk of failing to meet its commitment.</li>
<li>Once the previous iteration&#8217;s work has settled down, QA&#8217;s have little to do until the end of the iteration approaches, at which point they come under enormous pressure. Developers are humping to get their stories done in time, leaving QA&#8217;s with a pile of stories to be tested in time for the showcase. Any defects they find increase this pressure even more, with very little time to get the fixes in and then re-tested (maybe needing even more fixing and re-testing!)</li>
<li>If developers complete a story with a bit of time left in the iteration, they aren&#8217;t able to start new stories because the stories for the following iteration won&#8217;t be ready to work on until the IKO.</li>
<li>In the end, some stories don&#8217;t get fully tested during the iteration. They may be tested in the following iteration, after having already been signed off as &#8220;complete&#8221; by the unsuspecting Product Owner. If so, developers need to be pulled away to fix the defects found, or else the defects are added to a backlog to be fixed &#8220;later&#8221; (also known as &#8220;probably never&#8221;). Other developed code is left completely untested or under-tested, with the vague hope that any defects will be found in later testing phases, or that maybe there aren&#8217;t any important bugs anyway. In fact, these defects <em>will</em> be found, but not at a time more convenient to the team.</li>
<li>If any serious issues are raised by stakeholders during the showcase there is not time to fix them until the next iteration, which means it will take the full length of an iteration before a truly releasable build is created.</li>
</ul>




<h4>The root problem of the orthodox iteration</h4>


<p>At the end of the day, the orthodox iteration suffers from two problems which are inherent in its very definition: it organizes work into batches, and it enforces a timebox.</p>

<p>Batching work is the antithesis to flow. The Lean approach to working aims to maximize the flow of work for the members of a team, which in software development translates  to getting stories flowing easily through creation, analysis, implementation, validation, and release. When a developer finishes one story and it is signed off, she should have another story ready for her to pick up and start on. This shouldn&#8217;t need to wait on an arbitrary ceremony, and certainly shouldn&#8217;t have to wait for everyone else on the team to finish their stories and get them all signed off.</p>

<p>The batching focus of orthodox iterations doesn&#8217;t only cause developers to block, it also turns BA&#8217;s, QA&#8217;s, and the PO into bottlenecks. As described above, the start and end of the iteration each put a full working set of stories in the same state at once, all needing the same activity carried out on them at once.</p>

<blockquote>
Imagine an assembly line which starts up to assemble twenty cars, then stops while they are all inspected at once. Only once all of the cars are inspected and their defects fixed does the line start up again to begin assembling another twenty cars. 
</blockquote>


<p>Timeboxing is also a source of problems for iterations. The main problem is the arbitrary deadline creates pressure to get stories &#8220;over the line&#8221; so they can count towards the velocity for the iteration. Unless management is enlightened (or uninterested) enough to avoid focusing on fluctuations of velocity from iteration to iteration (and even the most enlightened managers I&#8217;ve worked with do get worked up over velocity) this leads to the temptation to rush and cut corners, or to play games with stories.</p>

<p>Rushing obviously endangers the quality of the code, which almost certainly leads to delays down the line when the defects surface. Playing games, such as closing unfinished stories and opening defects to complete the work, or counting some points towards an unfinished story, undermines the team&#8217;s ability to measure and predict its work honestly. These bad habits will catch up one way or another.</p>

<p>Expecting code to be complete at the end of the iteration, fully tested, fixed, and ready for deployment, is unrealistic unless the iteration is structured with significant padding at the end. This padding must come after all reviews, including the stakeholder showcase, to allow time to make corrections, unless those reviews are mere rubber stamp sessions, with no genuine feedback permitted. This then means the team will be underutilized during the padding time. Otherwise, if there is so much rework done during this period that the entire team is fully engaged, then the risk of introducing new defects is too high to be confident in stable code by the end.</p>

<p>The alternative is to break the strict timeboxed-batched iteration model by interleaving work on the next iteration with the cleanup work from the previous iteration. This turns out to not be such a bad idea, and leads to evolving away from the timeboxed-batch iteration model towards the continuous development model.</p>

<h4>The continuous development model</h4>


<p>The continuous development model may be purely iteration-less, e.g. Kanban, or it may still retain the iteration as a period for measuring progress and for scheduling activities such as showcases. Once development is underway stories are prepared, developed, and tested using a &#8220;pull&#8221; approach, being worked on as team members become available, so that stories are constantly flowing, and everyone is constantly working on the highest value work available at the moment. This requires some different approaches to managing work flow than are used with other approaches. For more information, look into <a href="http://www.google.co.uk/search?q=kanban+software+development">Kanban</a> and <a href="http://www.google.co.uk/search?q=lean+software+development">Lean software development</a>.</p>

<p>Since joining a year or so ago I&#8217;ve found that although no two ThoughtWorks projects run in exactly the same way, there is a strong tendency to use iterations which look a lot like Kanban, but retaining a one or two week iteration. Iterations are used to report progress (including velocity), and to schedule showcases and other regular meetings, but stories are not moved through the process in batches. Teams don&#8217;t start and stop work as a whole other than the start and end of a release. If the showcase is two days away, nothing stops a developer pair from starting on a new story knowing full well it will be incomplete when the codebase is demoed to the stakeholders, and possibly even deployed to later stage environments.</p>

<p>Although we do make projections and aim to have certain stories done by the next showcase, the team doesn&#8217;t promise to deliver a specific batch of stories. If it makes sense, stories can be dropped, added, or swapped as needed. This gives the business more flexibility to adapt their vision of the software as it is developed. It also reduces the pressure to mark a given story as &#8220;done&#8221; by a hard deadline, since there is no disruption from letting work carry on over the end of an iteration.</p>

<blockquote>
I&#8217;ve seen a Scrum team become ornery and rebellious when a PO made a habit of asking to swap stories after a sprint had started, even though work hadn&#8217;t been started on the particular stories involved. This was made worse because bugfixes were scheduled into sprints alongside stories, meaning that any serious defect found in production completely disrupted the team. 

Another factor that aggravated the situation was that the stories for each sprint were agreed before the end of the previous iteration. So if the showcase raised ideas for improvements to the functionality completed in iteration N, new stories could only be started in iteration N + 2 at the soonest. This hardly created a situation where the PO or the business felt the development team was responsive to business needs.
</blockquote>


<p>Also see Oren Teich&#8217;s post <a href="http://onticoren.com/go-slow-to-go-fast">Go slow to go fast</a>, which points out the problems with deadlines, and that iterations are simply a shorter deadline.</p>

<h4>Challenges and rewards of continuous development</h4>


<p>There are certainly challenges in moving to continuous development over the timeboxed-batch model. There is more risk of stories dragging on across multiple iterations. This can be mitigated by monitoring cycle time and keeping things visible, so that the team can discuss the issue and make changes to their processes if it becomes a problem.</p>

<p>For teams which are new to agile and still struggle to create appropriately sized stories, the timeboxed model may be more helpful to build the discipline and experience needed before being able to move to a continuous model. However, for experienced teams, timeboxing and batching stories simply has too many negative effects.</p>

<p>Continuous development, with a looser approach to iterations, maximizes the productivity of the team, avoids pitfalls that put quality at risk, and offers the business and the team more flexibility.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Configuration Drift]]></title>
    <link href="http://kief.com/configuration-drift.html"/>
    <updated>2011-12-06T00:00:00+00:00</updated>
    <id>http://kief.com/configuration-drift</id>
    <content type="html"><![CDATA[<p>In my previous article on <a href="http://kief.com/ops/automated-server-management-lifecycle.html">the server lifecycle</a> I mentioned <strong>ConfigurationDrift</strong>, a term that <strike>I&#8217;ve either coined, or</strike> I&#8217;ve forgotten where I originally heard, although most likely I got it from the Puppet Labs folks.</p>

<p>Configuration Drift is the phenomenon where running servers in an infrastructure become more and more different as time goes on, due to manual ad-hoc changes and updates, and general entropy.</p>

<p>A nice automated server provisioning process as I&#8217;ve advocated helps ensure machines are consistent when they are created, but during a given machine&#8217;s lifetime it will drift from the baseline, and from the other machines.</p>

<p>There are two main methods to combat configuration drift. One is to use automated configuration tools such as Puppet or Chef, and run them frequently and repeatedly to keep machines in line. The other is to rebuild machine instances frequently, so that they don&#8217;t have much time to drift from the baseline.</p>

<p>The challenge with automated configuration tools is that they only manage a subset of a machine&#8217;s state. Writing and maintaining  manifests/recipes/scripts is time consuming, so most teams tend to focus their efforts on automating the most important areas of the system, leaving fairly large gaps.</p>

<p>There are diminishing returns for trying to close these gaps, where you end up spending inordinate amounts of effort to nail down parts of the system that don&#8217;t change very often, and don&#8217;t matter very much day to day.</p>

<p>On the other hand, if you rebuild machines frequently enough, you don&#8217;t need to worry about running configuration updates after provisioning happens. However, this may increase the burden of fairly trivial changes, such as tweaking a web server configuration.</p>

<p>In practice, most infrastructures are probably best off using a combination of these methods. Use automated configuration, continuously updated, for the areas of machine configuration where it gives the most benefit, and also ensure that machines are rebuilt frequently.</p>

<p>The frequency of rebuilds will vary depending on the nature of the services provided and the infrastructure implementation, and may even vary for different types of machines. For example, machines that provide network services such as DNS may be rebuilt weekly, while those which handle batch processing tasks may be rebuilt on demand.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Automated server management lifecycle]]></title>
    <link href="http://kief.com/automated-server-management-lifecycle.html"/>
    <updated>2011-12-05T00:00:00+00:00</updated>
    <id>http://kief.com/automated-server-management-lifecycle</id>
    <content type="html"><![CDATA[<p>One of the cornerstones of a well-automated infrastructure is a system for provisioning individual servers. A system that lets us reliably, quickly, and repeatably create new server instances that are consistent across our infrastructure means we spend less time fiddling with individual servers. Instead, servers become disposable components that are easily swapped, replaced, and expanded as we focus our attention on the bigger picture of the services we&#8217;re providing.</p>

<p>The first step in achieving this is making sure server instances are built using an automated process. This ensures every server is built the same way, that improvements can be easily folded into the server build process, and that it is a simple matter to spin up new instances and to scrap and replace broken ones. Automating this process also means your team of highly skilled, well-paid professionals don&#8217;t need to spend large amounts of their time on the brainless rote-work of menu-clicking through OS installation work.</p>

<p>I first used automated installation by PXE-booting physical rack servers in 2002, following the advice I found on the then-current <a href="http://infrastructures.org">infrastructures.org</a> site, and in later years applied the same concepts with virtualized servers and then IaaS cloud instances.</p>

<h2>The machine lifecycle</h2>


<p>I think of this as the machine lifecycle (which I tend to call the &#8216;server lifecycle&#8217; because that&#8217;s what I normally work with, although it&#8217;s just as applicable to desktops). This involves a number of activities required to set up and manage a single machine instance, such as partitioning storage, installing software, and applying configuration.</p>

<p><img src="http://kief.com/images/Server_Lifecycle_Summary.png" alt="Basic Server Lifecycle phases" align="right"/></p>

<p>These activities are applied during one or more phases of the machine lifecyle. There are three phases: &#8220;Package Image&#8221;, &#8220;Provision Instance&#8221;, and &#8220;Update Instance&#8221;. There are a number of different strategies for deciding which activities to do in each phase.</p>

<p>The various activities may be applied during one or more phases, depending on the strategy used to manage the machine&#8217;s lifecycle. Some strategies carry out more activities during the packaging phase, for instance, while other approaches might have a simpler packaging phase but do more in the provisioning and/or updating phase.</p>

<h2>Machine lifecycle phases</h2>




<h4>Image packaging phase</h4>


<p>In the image packaging phase, some or all elements of a machine instance are pre-packaged into a <strong>machine image</strong> in a way that can be reused to create multiple running instances.</p>

<p>This could be as simple as using a bare OS installation CD or ISO from the vendor. Alternately, it could be a snapshot of a fully installed, fully configured runnable system, such as a Symantec Ghost image, VMWare template, or EC2 AMI. Either way, these images are maintained in a <strong>Machine Image Library</strong> for use in the instance provisioning phase.</p>

<p><img src="http://kief.com/images/Lifecycle-ManualProvisioning.png" alt="With the ManualInstanceBuilding pattern, everything happens during provisioning" align="right"/></p>

<p>Different machine lifecycle strategies use different approaches to image packaging. <strong>ManualInstanceBuilding</strong> and <strong>ScriptedInstanceBuilding</strong> both tend to use stock OS images, which involves less up-front work and maintenance of the Machine Image Library, since the instances are take straight from the vendor. However, work is still needed to create, test, and maintain the checklists or scripts used to configure instances when provisioning.</p>

<p>On the other hand, <strong>CloningExistingMachineInstances</strong> and <strong>TemplatedMachineInstances</strong> both create pre-configured server images, which need only minor changes (e.g. hostnames and IP addresses) to provision new instances. This is appealing because less work is done to provision a new instance, but the drawback is that creating and updating images takes more work. Admins tend to make updates and fixes to running instances which may not make it into the templates, which contributes to <strong>ConfigurationDrift</strong>, especially if changes are made ad-hoc.</p>

<p><img src="http://kief.com/images/Lifecycle-TemplatedRoles.png" alt="What happens in each phase with the TemplateMachineInstances pattern" align="right"/></p>

<p>CloningExistingMachineInstances, which usually takes the shape of copying an existing server to create new ones as needed, tends to make ConfigurationDrift worse, as new servers inherit the runtime cruft and debris (log files, temporary files, etc.) of their parents, and it is difficult to bring various servers into line with a single, consistent configuration. TemplatedMachineInstances are a better way to keep an infrastructure consistent and easily managed.</p>

<p>The tradeoffs between scripted installs vs. packaged images depends partly on the tools used for scripting and / or packaging, which in turn often depends on the hosting platform. Amazon AWS requires the use of templates (AMIs), for example. In either case, exploiting automation more fully in the provisioning phase favours the case for keeping the packaging phase as lightweight as possible.</p>

<h4>Instance Provisioning Phase</h4>


<p>In the provisioning phase, a machine instance is created from an image and prepared for operational use.</p>

<p>Examples of activities in this phase include instantiating a VM or cloud instance, preparing storage (partitioning disks, etc.), installing the OS, installing relevant software packages and system updates, and configuring the system and applications for use.</p>

<p>There are two main strategies for deciding which activities belong in the packaging versus the provisioning phases. One is <strong>RoleSpecificTemplates</strong>, and the other is <strong>GenericTemplate</strong>.</p>

<p>With RoleSpecificTemplates, the machine image library includes images that have been pre-packaged for specific roles, such as web server, application server, mail server, etc. These have the necessary software and configuration created in the packaging phase, so that provisioning is a simple matter of booting a new instance and tweaking a few configuration options. There are two drawbacks of this approach. Firstly, you will have more images to maintain, which creates more work. When the OS used for multiple roles is updated, for example, the images for all of those roles must be repackaged. Secondly, this pattern gives you less flexibility, since you can&#8217;t easily provision an instance that combines multiple roles, unless you create - and then maintain - images for every combination of roles that you might need.</p>

<p><img src="http://kief.com/images/Lifecycle-GenericTemplate.png" alt="What happens in each phase with the GenericTemplate pattern" align="right"/></p>

<p>With the GenericTemplate pattern, each image is kept generic, including only the software and configuration that is common to all roles. The role for each machine instance is assigned during the provisioning phase, and software and configuration are applied accordingly then. The goal is to minimise the number of images in the machine image library, to reduce the work needed to maintain them. Typically, a separate template is needed for each hardware and OS combination that can&#8217;t be supported from a single OS install. The <a href="http://en.wikipedia.org/wiki/Just_enough_operating_system">JeOS</a> (Just Enough Operation System) concept takes this to the extreme, making the base template as small as possible.</p>

<p>The GenericTemplate pattern does require a more robust automated configuration during provisioning, and may mean provisioning an instance takes longer than using more fully-built images, since more packages will need to be installed during install.</p>

<h4>Instance Updating Phase</h4>


<p>Once a machine instance is running and in use, it is continuously updated. This includes activities such as applying system and software updates, new configuration settings, user accounts, etc.</p>

<p>Many teams carry out these updates manually, however it requires a high level of discipline and organization to maintain systems this way, especially as the number of systems grows. The number of machines that a team can be managed is closely dependent on the size of the team, so the ration of servers to sysadmins is low. In practice, teams using manual updates tend to be reactive, updating machines opportunistically when carrying out other tasks, or in order to fix problems that crop up. This leads to <strong>ConfigurationDrift</strong>, with machines becoming increasingly inconsistent with one another, creating various problems including unreliable operation (software that works on one machine but not another), and extra work to troubleshoot and maintain.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Breaking into automated infrastructure management]]></title>
    <link href="http://kief.com/breaking-into-automated-infrastructure-management.html"/>
    <updated>2011-11-08T00:00:00+00:00</updated>
    <id>http://kief.com/breaking-into-automated-infrastructure-management</id>
    <content type="html"><![CDATA[<p>Automated management of infrastructure is vital for delivering highly effective IT services. But although there are plenty of tools available to help implement automation, it&#8217;s still common to see operations teams manually installing and managing their servers, which leads to a high-maintenance infrastructure, which soaks up the team&#8217;s time on firefighting and other reactive tasks.</p>

<p><img align="right" src="http://kief.com/images/rice_paddy_plow.jpg" alt="Doing it by hand" width="454" height="264" /></p>

<p>I&#8217;ve met many smart and skilled systems administrators in this situation. These folks know automation can make their life easier, but they can&#8217;t afford to take time away from turning cranks, greasing wheels, and unjamming the gears to keep their infrastructure puffing along in order to focus on improving their situation.</p>

<p>I&#8217;m convinced this is largely due to habit. Even though these teams understand that automation would be useful to them, when the pressure is on (and the pressure is always on), they roll up their sleeves, ssh into the servers and knock them into shape, because that&#8217;s the fastest way to get stuff done. Manual infrastructure management is what they&#8217;re used to. I find that most of these teams haven&#8217;t had personal experience of well-automated infrastructures, and don&#8217;t tend to believe it&#8217;s something they can realistically implement for their own operations.</p>

<p>Sysadmins who have worked in teams with mature, comprehensive automation, on the other hand, can&#8217;t go back. Sure, they might log into a box to diagnose and fix something that needs fixing <em>right now</em>, but they can&#8217;t relax until they&#8217;ve baked the fix into their automated configuration, and made sure that their monitoring will alert them ahead of time if the problem happens again.</p>

<p>Breaking out of manual infrastructure management and setting up an effective automation regime is difficult. Although there are loads of tools out there to make it work, it helps to understand good strategies for implementing them. I recommend looking over the material on the <a href="http://infrastructures.org">infrastructures.org</a> site. It hasn&#8217;t been updated in a few years, so doesn&#8217;t take much of the advances since then into account, including virtualization, cloud, and newer tools like <a href="http://www.opscode.com/chef/">Chef</a> and <a href="http://projects.puppetlabs.com/projects/puppet/wiki">Puppet</a>, but there is still rich material there.</p>

<p>Another must-read which more up to date is <a href="http://www.amazon.com/gp/product/1449377440?tag=kiefcom-20">Web Operations</a> by John Allspaw, Jesse Robbins, and a bunch of other smart peeps.</p>

<p>I&#8217;m also planning to share a few of the practices I&#8217;ve seen and used for automation in upcoming posts.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Successful software delivery in spite of Evil IT]]></title>
    <link href="http://kief.com/successful-software-delivery-in-spite-of-evil-it.html"/>
    <updated>2011-09-30T00:00:00+01:00</updated>
    <id>http://kief.com/successful-software-delivery-in-spite-of-evil-it</id>
    <content type="html"><![CDATA[<p>In my previous post, I glibly said that <a href="http://kief.com/SLA_Definition.html">SLAs represent waste that an organization has identified and formalized</a>. ReaderKenfin commented on my post, rightly <a href="http://kief.com/definition-of-an-sla.html#disqus_thread">calling me out to provide alternatives</a>.</p>

<blockquote>
If you believe that SLA&#8217;s &#8216;formalise waste&#8217; this way how would you approach my situation where communications are beyond poor (atrocious) and the org structure is silo&#8217;d and no one is accountable for their work?
</blockquote>


<p>Kenfin&#8217;s example illustrates my point quite well - the organization&#8217;s structure is an obstacle to effective delivery. Since he&#8217;s not in a position to fix this problem, he&#8217;s turned to SLA&#8217;s as a way to manage the problem. They won&#8217;t make the issues go away, but they may give him a handle to manage them, and importantly, make them more predictable.</p>

<p><img src="http://kief.com/images/keyboard_turtle.jpg" height="282" width="425" alt="Turtle on a keyboard, like slow IT people. It's a metaphor." align="right"/></p>

<p>But it&#8217;s a fair question, what can someone in Kenfin&#8217;s shoes do in the face of an IT organization which is inherently not aligned to effectively providing the services he needs to deliver software to his users effectively?</p>

<p>A common strategy, and one that I&#8217;ve helped teams inside these kinds of organizations do, is to completely bypass the existing IT organization. The goal is to put control of everything that the product team needs in order to deliver into its hands, rather than leaving it at the mercy of a group (or multiple groups) who have other priorities.</p>

<h4>Outsource it!</h4>


<p>One way to do this is outsourcing, finding another company that specializes in the functions that the IT group would provide, whether this means development, integration, hosting, or something else. This works best if the project is not seen as core to the business, so that it avoids fear of entrusting sensitive data or business critical functions to outsiders. It also helps if the project needs skills that can&#8217;t be found in-house.</p>

<p>My friends at <a href="http://cognifide.com">Cognifide</a> have built their business on this, building technically complex content-focused websites for corporate clients, delivering far more quickly, and with greater expertise, than most corporate IT organizations can manage. This is also the premise that Software as a Service (SaaS) is based on. By choosing SalesForce for CRM a company completely bypasses the massive IT project that would be required to implement an off the shelf, self-hosted CRM package (integration with other applications aside).</p>

<p>There are pitfalls to outsourcing to bypass IT. Many outsourcers are no more responsive than an in-house IT department, using SLAs and change control processes to make their workload, risks, and profitability more manageable.</p>

<h4>Do it yourself!</h4>


<p>The strategy I&#8217;ve most often been involved with myself (although I didn&#8217;t really think of it this way at the time) is product departments building their own IT capabilities. Again, this is about having control of the services and resources the group needs in order to deliver to its own customers.</p>

<p>The typical pattern is an &#8220;online&#8221; (or often, &#8220;digital&#8221;) department of a company where online was originally on the fringes of the main business, but has in recent years grown into a major channel for sales, customer service, or even delivery of products (for example in publishing).</p>

<p>The online team leverages their growing importance, as well as the specialized needs they have compared with typical corporate IT custometrs, to get approval from top management to create their own &#8220;digital operations team&#8221; or similar. This team may outsource elements of infrastructure, such as hosting (with IaaS cloud providers as an increasingly appealing option), but they are able to respond immediately to the needs of the online product group, because a) they don&#8217;t have to juggle requests from other departments and teams, and b) they report directly to the manager of that group.</p>

<h4>But what if I have to use the crappy IT guys who don&#8217;t care about my project?</h4>


<p>Those strategies are not feasible for every team. I&#8217;ve certainly had to support projects where we had no alternative but to struggle along with unresponsive IT. In these cases, SLAs may well have to do, even though they represent waste and inefficiency.</p>

<p>There are a few other things you might at least try out in these cases. Your goal is still to have the resources you need in order to get things done at your disposal as far as possible. So see if you can identify those services which are especially critical, and particularly those which are likely to change frequently, and see if you can get some dedicated resource assigned to your project. You want someone who will sit with your team, be incentivized by the success of your project, and who has the skills, authority, and system privileges to carry out the tasks you need.</p>

<p>If full time secondment of people to your team is not quite feasible due to budget, lack of available resource, etc., see if you can at least get commitments of time from the right people. Can someone come to daily standups? Weekly meetings? Regular release management meetings? Ask for as much as possible to start with, then see what you can get.</p>

<p>Also, maybe you can hire someone into your own team with qualifications and background that will help them effecitely liaise with difficult IT teams. Your own DBA, security consultant, etc. can engage with the IT groups using their own language, couching things in terms that address their concerns. They may be able take certain tasks off the IT group&#8217;s plates, which ends up giving you the ability to get things done more quickly, while at the same time making IT grateful that their workload is lighter.</p>

<h4>But the right thing to do is &#8230;</h4>


<p>These are all ways to work around the core problems. The best solution is of course for the organization to restructure itself in a way that aligns its resources with its goals. Most companies, especially large ones, insist on organizing themselves in ways that are self-defeating. It&#8217;s a shame that many people who work in large companies accept this as normal, often even as desirable.</p>

<p>Grouping everyone with a given function into a single group forces them to focus on juggling the competing needs of many stakeholders, managing their own risks (especially the risk of getting blamed when projects fail). They will inevitably favor the abstract principles of their own technical practices over what is most effective in making the business succeed. Much better to group people into units that have complete ownership for delivering business value, and find ways to connect staff of given function with each other so they can develop their skills as working practices.</p>

<p>Unfortunately most of us are rarely in a position to influence this, so I hope that my suggestions will be helpful to some people in making things a little less painful.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Running multiple Tomcat instances on one server]]></title>
    <link href="http://kief.com/running-multiple-tomcat-instances-on-one-server.html"/>
    <updated>2011-09-29T00:00:00+01:00</updated>
    <id>http://kief.com/running-multiple-tomcat-instances-on-one-server</id>
    <content type="html"><![CDATA[<p>Here&#8217;s a brief step by step guide to running more than one instance of Tomcat on a single machine.</p>

<p><img src="http://kief.com/images/two_espressos.jpg"/></p>

<h4>Step 1: Install the Tomcat files</h4>


<p>Download Tomcat <a href="http://tomcat.apache.org/download-41.cgi">4.1</a> or <a href="http://tomcat.apache.org/download-55.cgi">5.5</a>, and unzip it into an appropriate directory. I usually put it in /usr/local, so it ends up in a directory called <em>/usr/local/apache-tomcat-5.5.17</em> (5.5.17 being the current version as of this writing), and make a symlink named /usr/local/tomcat to that directory. When later versions come out, I can unzip them and relink, leaving the older version in case things don&#8217;t work out (which rarely if ever happens, but I&#8217;m paranoid).</p>

<h4>Step 2: Make directories for each instance</h4>


<p>For each instance of Tomcat you&#8217;re going to run, you&#8217;ll need a directory that will be <em>CATALINA_BASE</em>. For example, you might make them <em>/var/tomcat/serverA</em> and <em>/var/tomcat/serverB</em>.</p>

<p>In each of these directories you need the following subdirectories: conf, logs, temp, webapps, and work.</p>

<p>Put a server.xml and web.xml file in the conf directory. You can get these from the conf directory of the directory where you put the tomcat installation files, although of course you should tighten up your server.xml a bit.</p>

<p>The webapps directory is where you&#8217;ll put the web applications you want to run on the particular instance of Tomcat.</p>

<p>I like to have the Tomcat manager webapp installed on each instance, so I can play with the webapps, and see how many active sessions there are. See my instructions for <a href="http://kief.com/tomcat/configurating-tomcat-manager.html">configuring the Tomcat manager webapp</a>.</p>

<h4>Step 3: Configure the ports and/or addresses for each instance</h4>


<p>Tomcat listens to at least two network ports, one for the shutdown command, and one or more for accepting requests. Two instances of Tomcat can&#8217;t listen to the same port number on the same IP address, so you will need to edit your server.xml files to change the ports they listen to.</p>

<p>The first port to look at is the shutdown port. This is used by the command line shutdown script (actually, but the Java code it runs) to tell the Tomcat instance to shut itself down. This port is defined at the top of the server.xml file for the instance.</p>

<pre>
&lt;Server port="8001" shutdown="_SHUTDOWN_COMMAND_" debug="0"&gt;
</pre>


<p>Make sure each instance uses a different port value. The port value will normally need to be higher than 1024, and shouldn&#8217;t conflict with any other network service running on the same system. The shutdown string is the value that is sent to shut the server down. Note that Tomcat won&#8217;t accept shutdown commands that come from other machines.</p>

<p>Unlike the other ports Tomcat listens to, the shutdown port can&#8217;t be configured to listen to its port on a different IP address. It always listens on 127.0.0.1.</p>

<p>The other ports Tomcat listens to are configured with the &lt;Connector&gt; elements, for instance the HTTP or JK listeners. The <em>port</em> attribute configures which port to listen to. Setting this to a different value on the different Tomcat instances on a machine will avoid conflict.</p>

<p>Of course, you&#8217;ll need to configure whatever connects to that Connector to use the different port. If a web server is used as the front end using mod_jk, mod_proxy, or the like, then this is simple enough - change your web server&#8217;s configuration.</p>

<p>In some cases you may not want to do this, for instance you may not want to use a port other than 8080 for HTTP connectors. If you want all of your Tomcat intances to use the same port number, you&#8217;ll need to use different IP addresses. The server system must be configured with multiple IP addresses, and the <em>address</em> attribute of the &lt;Connector&gt; element for each Tomcat instance will be set to the appropriate IP address.</p>

<h4>Step 4: Startup</h4>


<p>Startup scripts are a whole other topic, but here&#8217;s the brief rundown. The main different from running a single Tomcat instance is you need to set CATALINA_BASE to the directory you set up for the particular instance you want to start (or stop). Here&#8217;s a typical startup routine:</p>

<pre>
JAVA_HOME=/usr/java
JAVA_OPTS="-Xmx800m -Xms800m"
CATALINA_HOME=/usr/local/tomcat
CATALINA_BASE=/var/tomcat/serverA
export JAVA_HOME JAVA_OPTS CATALINA_HOME CATALINA_BASE

$CATALINA_HOME/bin/catalina.sh start
</pre>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Definition of an SLA]]></title>
    <link href="http://kief.com/definition-of-an-sla.html"/>
    <updated>2011-09-06T00:00:00+01:00</updated>
    <id>http://kief.com/definition-of-an-sla</id>
    <content type="html"><![CDATA[<p>SLA: Waste that an organization has identified in a critical business process and decided to formalize rather than eliminate.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Monitor your development infrastructure as if it were business critical]]></title>
    <link href="http://kief.com/monitor-your-development-infrastructure-as-if-it-were-business-critical.html"/>
    <updated>2011-06-28T00:00:00+01:00</updated>
    <id>http://kief.com/monitor-your-development-infrastructure-as-if-it-were-business-critical</id>
    <content type="html"><![CDATA[<p>A development team&#8217;s infrastructure - development and QA environments, CI servers, SCM servers, etc. - are indisputably business critical, but rarely given the kind of monitoring attention that production environments are. This is a missed opportunity, not only to ensure the continuity of development work, but also to gain valuable insight.</p>

<p>Reasons to monitor your application in every environment it&#8217;s deployed to:</p>

<h1>1 Keep your development team moving</h1>

<p>This is the obvious one. You need to know before you run out of disk space, RAM, etc.</p>

<h1>2 Optimize your CI / deployment pipeline</h1>

<p>Do you know what the limiting factors are on the time it takes your automated tests to run? The shorter you make your dev/test/fix feedback loop, the more productive your team will be, so why not analyze and optimize it as you would any other key software system? If checkout from SCM takes 20% of the time to test results, what can you do to reduce it? Are your unit tests constrained by CPU, RAM, or disk I/O?</p>

<h1>3 Understand your applications</h1>

<p>We&#8217;re conditioned to think that measuring performance and resource consumption is only useful in an environment that mirrors our production hardware. But if we build up an awareness of how our application uses memory and other resources as a part of every execution and every environment, we&#8217;ll have a deep and intuitive understanding of what makes it tick.</p>

<h1>4 Develop and test your monitoring</h1>

<p>By having monitoring running against applications while they are still in development, you will find ways to improve how you monitor (&#8220;let&#8217;s measure the activity on our queues&#8221;), catch holes in your monitoring (&#8220;why didn&#8217;t our monitoring tell us when the dev server queue broker went down?&#8221;), and test changes to your monitoring.</p>

<p>Once you put monitoring in place in development and testing and make a habit of using it, it becomes a ubiquitous and indispensable part of your team&#8217;s working processes, similar to the shift to using CI well.</p>

<p>Don&#8217;t leave it as a low priority task, something to get around to at some point after you get around to setting up a perfect performance testing environment. Put it at the center of your team&#8217;s toolset for understanding your work.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Build Monkey Antipattern]]></title>
    <link href="http://kief.com/the-build-monkey-antipattern.html"/>
    <updated>2011-04-11T00:00:00+01:00</updated>
    <id>http://kief.com/the-build-monkey-antipattern</id>
    <content type="html"><![CDATA[<p>A common pattern in software development teams is to have a person who owns the build system. This may be a deliberate decision, or it may evolve organically as a particular team member gravitates towards dealing with the build scripts, automated testing and deployment, etc. While it&#8217;s normal for some team members to have a deeper understanding of these things than others, it&#8217;s not a good idea for the knowledge and responsibility for the build to become overly concentrated in one person.</p>

<p><img src="http://kief.com/images/monkey_hanging_out.jpg" width="296" height="405" alt="I prefer the term build gorilla myself" align="right" />
The build system should be looked at as a module or component of the software application or platform being developed, so the philosophy taken towards <a href="http://martinfowler.com/bliki/CodeOwnership.html">code ownership</a> apply.</p>

<p>If a single person owns the build system, everyone else becomes dependent on them to fix issues with it, and to extend it to meet new needs. There is also a risk, especially for projects which are big enough that maintaining the build system becomes a full time job, that a bit of a siloed mentality can develop.</p>

<p>If developers have a poor understanding of how their software is built and deployed, their software is likely to be difficult and costly to deploy. On the flip side, if build and test tools are implemented and maintained entirely by people who don&#8217;t develop or test the software, it isn&#8217;t likely to make the life of those who do as easy as it could be.</p>

<p>In the past few months I&#8217;ve taken on a role which is largely focused on this area, and have been helping a development team get their build and delivery system in place. Pairing with developers to implement aspects of the system has worked well, as has letting them take on the setup of particular areas of the build and test tooling. This follows what Martin Fowler calls &#8220;Weak Code Ownership&#8221;, allowing everyone to take part in working on the build and test system.</p>

<p>Special attention is needed for stages of the path to production as they get further from the developer&#8217;s workstation. Developers are keen to optimize their local build and deployment, but can often be fuzzy on what happens when things are deployed in server environments. This is exacerbated when the platforms are different (e.g. developers working on Windows, code deployed on Linux).</p>

<p>Even without platform differences, developers understandably focus on the needs of their own local build over those of production system deployment. This is natural when server deployment is not a part of their daily world. So the best way to compensate for this is to keep developers involved in implementing and maintaining server deployment.</p>

<p>Driving the implementation of the build and deployment system according to the needs of business stories has also been useful. So rather than setting up tooling to test parts of the system that haven&#8217;t been developed yet, wait until the design of the code to be tested starts to be understood, and the code itself has actually started being developed. This helps ensure the tooling closely fits the testing and deployment needs, and avoids waste and re-work.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Maven: great idea, poor implementation (Part 3)]]></title>
    <link href="http://kief.com/maven-great-idea-poor-implementation-part-3.html"/>
    <updated>2011-03-24T00:00:00+00:00</updated>
    <id>http://kief.com/maven-great-idea-poor-implementation-part-3</id>
    <content type="html"><![CDATA[<p>In the first post in this series, I explained why I think Maven <a href="http://kief.com/maven-great-idea-part-1.html">Maven is a good idea</a>. Most projects need pretty much the same thing from a build system, but using Ant normally results in complex, non-standard build system which becomes a headache to maintain.</p>

<p>In theory, Maven should be a better way to run a build. By offering a standardised build out of the box, you would massively reduce the setup and learning curve for new joiners to the development team and take advantage of a healthy ecosystem of plugins that can be simply dropped into your build, and save loads of setup and maintenance hassle.</p>

<p><img src="http://kief.com/images/End_of_Road.jpg" height="282" width="425" alt="End of the Road sign" align="right" /></p>

<p>Although its goes pretty far towards the first two of these advantages, in my second post I described how <a href="http://grokandroll.com/maven-configuration-complexity.html">Maven&#8217;s configuration is too complex</a> even for simple things.</p>

<p>I note that the Maven site doesn&#8217;t currently mention &#8220;convention over configuration&#8221;, although I&#8217;m sure it used to in the past, and there are plenty of references to it around the web. The <a href="http://en.wikipedia.org/wiki/Convention_over_configuration">Wikipedia entry for  convention over configuration</a> lists Maven as a poster-child, and Sonatype, the commercial company supporting Maven, names a <a href="http://www.sonatype.com/books/maven-book/reference/installation-sect-conventionConfiguration.html">chapter of their reference book</a> named after the concept.</p>

<p>But it&#8217;s a load of bollocks.</p>

<p>Anyway.</p>

<p>My final point (for this series, anyway) is on flexibility. The tradeoff between configuration complexity is normally flexibility. This is certainly the case with Ant; the complexity which makes every Ant-based build system a painfully unique snowflake buys you the capability to do damn near anything you want with it.</p>

<p>But Maven&#8217;s complexity does not buy us flexibility.</p>

<p>My team wants to divide up its testing into multiple phases, following the &#8220;Agile testing pyramid&#8221; concept as mentioned by <a href="http://blog.mountaingoatsoftware.com/the-forgotten-layer-of-the-test-automation-pyramid">Mike Cohn</a>.</p>

<p>So we&#8217;d like to have four layers to our pyramid, unit tests running first; database integration tests running next; web service tests third; and only if all of these pass do we run web UI tests. These test groups run in order of increasing heaviness, so we get feedback on the simple stuff quickly.</p>

<p>Maven supports two levels of testing, unit tests and integration tests. The <a href="http://maven.apache.org/plugins/maven-failsafe-plugin/">failsafe plugin</a> which provides integration testing support seems fairly new, and is actually pretty good if you only need one phase of integration testing. It lets you configure setup and teardown activities, so you can fire up an app server before running tests, and make sure it gets shut down afterwards.</p>

<p>If we could get failsafe to run three times during the build, each time carrying out different setup and teardown activities, and running different groups of tests, my team would be fairly happy with Maven.</p>

<p>It is possible to use build profiles to set up different integration tests in this way, but to get them to run, you need to run the build three times, and each time the preceding steps will be re-run - compiling, unit tests, packaging, etc. So it&#8217;s kind of nasty, brutish, and too long.</p>

<p>The right way to achieve what we&#8217;re after is probably to customise the build lifecycle, or create a new build lifecyle. Either way, it involves creating custom plugins, or extensions, or both. I&#8217;ve taken a stab at working out how, but after burning a couple of evenings without getting anywhere, I&#8217;ve shelved it.</p>

<p>I have no doubt it can be done, but it&#8217;s just easier to do it in Ant and move on to other tasks. And that&#8217;s pretty much the bottom line for me. I still like the idea of Maven, I have hopes it will continue to improve (it&#8217;s a thousand times more usable than it was a few years ago), and maybe even go through a shift to embrace convention over configuration for real.</p>

<p>In the meantime, I&#8217;m likely to reach for Maven when I need something quickly for a project that seems likely to fit its paradigm, but for heavier projects (most of the ones I&#8217;m involved with for client projects), Ant is the pragmatic choice.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Maven: great idea, poor implementation (Part 2)]]></title>
    <link href="http://kief.com/maven-great-idea-poor-implementation-part-2.html"/>
    <updated>2011-03-24T00:00:00+00:00</updated>
    <id>http://kief.com/maven-great-idea-poor-implementation-part-2</id>
    <content type="html"><![CDATA[<p><img src="http://grokandroll.com/images/ConfusionAhead.jpg" alt="Signs of confusion ahead" width="334" height="359" align="right" /></p>

<p>In my previous post I explained <a href="http://grokandroll.com/maven-great-idea-part-1.html">why  Maven is a good concept</a> for Java project builds. In this post I&#8217;ll delve into a key area where it falls down, the overcomplexity of its configuration.</p>

<p>In brief, we have a proliferation of home-brewed build systems created in many different ways using Ant, all of which do much the same thing. Since the vast majority of Java projects have very similar build requirements,  an off the shelf build system should be able to do the job.</p>

<p>More to the point, a standard build system using convention over configuration should be simple to set up and maintain. This in turn helps the development team&#8217;s velocity, since less time is spent fiddling with (or worse, fighting against) the build system, so more time can be spent delivering value for customers.</p>

<p>Maven fulfils this if your build needs are ridiculously simple. Slap your source code into folders for application code and test code, name your tests right, and put in a very small pom.xml file. Run &#8220;mvn install&#8221; and your code is compiled, unit tested, and ready to deploy.</p>

<p>Things get ugly pretty quickly though, as soon as you need to make even a small tweak to the basic build.</p>

<p>For example, let&#8217;s look at what&#8217;s involved in changing the version of Java you want your project built to, for language compatibility and/or for compatibility with the runtime environment your project will be used in. Maven 3.0.x uses Java 1.5 by default, even if you have Java 1.6 installed, which is sensible enough.</p>

<p>So we have two parameters that need changing, language version for the source, and target version for generated classes. Here&#8217;s what we have to add to our simple pom.xml to achieve this:</p>

<pre>&lt;project&gt;
  [...]
  &lt;build&gt;
    [...]
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.3.2&lt;/version&gt;
        &lt;configuration&gt;
          &lt;source&gt;1.4&lt;/source&gt;
          &lt;target&gt;1.4&lt;/target&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
    [...]
  &lt;/build&gt;
  [...]
&lt;/project&gt;
</pre>


<p>So the first thing that strikes you is, holy spaghetti, that&#8217;s a lot of scaffolding for two parameters. Someone wading through a pom file trying to understand our build in order to modify or fix it will have a hard time working out the meat of this snippet, and it&#8217;s not clear that it&#8217;s all only there for those two parameters.</p>

<p>Much worse, the extra scaffolding isn&#8217;t harmless. Before we had this, compilation was done by the maven-compiler-plugin, using the latest available version for the version of Maven we&#8217;re using. Now this out of the box default has been surfaced in the pom file. Our project is locked into knowing about, and managing the plugin and its version. If we don&#8217;t specify the version, Maven 3.x prints a scary warning suggesting that in the future it will no longer enable our careless disregard for managing the nuts and bolts of its innards, so expect our build to break horribly.</p>

<blockquote>
As soon as you set any configuration option on a built-in component of Maven, you are forced to take responsibility for that component that you wouldn&#8217;t have otherwise, and clutter your configuration with stuff that would otherwise be assumed by Maven.
</blockquote>


<p>Now suppose you want to run integration tests on your code, that run heavier weight tests in a separate phase after unit testing. The testing model we&#8217;re following is to have lightweight unit tests that run fast for quick feedback on basic errors, then heavier tests which probably need a container like Jetty, and perhaps a database, to test a bit more deeply. It&#8217;s often referred to as integration testing, meaning you&#8217;re testing the components of a single application integrated together.</p>

<p>(However, the naming leads to confusion since integration testing can also refer to testing integration with external applications, web services, etc.)</p>

<p>So Maven supports running a separate set of tests in an integration test phase that runs after the unit tests, using the failsafe plugin. How do we make use of this? Firstly, we write JUnit test case classes, and name them <em>ITMyClass</em>, and the &#8220;IT&#8221; beginning tells Maven to run them in this phase.</p>

<p>So does Maven just find and run these classes if they exist? Of course not, you have to add some configuration to your pom.xml so it knows. Fair enough, Maven shouldn&#8217;t waste our precious build time searching all of our test classes for ones named with &#8220;IT&#8221; if we aren&#8217;t using integration tests.</p>

<p>So, it should be a pretty simple configuration setting to tell Maven we&#8217;re using the integration test phase. Right?</p>

<p>Right?</p>

<pre>&lt;project&gt;
  [...]
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.7.2&lt;/version&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;integration-test&lt;/id&gt;
            &lt;goals&gt;
              &lt;goal&gt;integration-test&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
            &lt;id&gt;verify&lt;/id&gt;
            &lt;goals&gt;
              &lt;goal&gt;verify&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  [...]
&lt;/project&gt;</pre>


<p>(From <a href="http://maven.apache.org/plugins/maven-failsafe-plugin/usage.html">the failsafe plugin docs</a>.)</p>

<p>So, no.</p>

<p>Holy scaffolding! All we&#8217;ve really told Maven with all that configuration is to include the &#8220;failsafe plugin&#8221;, and wire it into the build lifecycle to run at the integration-test phase. But again, we&#8217;ve locked the plugin details, including the version number, into our project&#8217;s pom file.</p>

<p>In this case, we&#8217;ve also had to explicitly (and verbosely) specify the lifecycle phase. So this is a plugin whose whole purpose in life is to be used in the integration phase of Maven&#8217;s build lifecycle, abut we have to take it by the hand and tell it exactly how and where to wire itself into the lifecycle, even though we&#8217;re following its default use case.</p>

<p>That isn&#8217;t configuration over convention! That isn&#8217;t even Mexico!</p>

<p>Oh, wait, this doesn&#8217;t run our integration tests with a servlet container. Let&#8217;s plug in Jetty. It&#8217;s actually pretty easy, just copy, paste and tweak the example in <a href="http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing">this documenation from Codehaus</a> (the second XML snippet on that page).</p>

<p>There is even a bit more meat in the configuration, which is fair enough, since there are a few things you might like to configure when running a servlet container. But you&#8217;ve still got loads more configuration, much of which is calling out details of Maven&#8217;s execution lifecyle that are, when it comes down to it, the default for 90% of the people using this.</p>

<p>So you can see how your Maven project&#8217;s pom.xml file quickly becomes packed with unneeded crap, which increases the barrier to understanding and modifying the build. Once you develop a pretty good understanding of Maven&#8217;s internal structures and models you become adept at working out which parts of the pom.xml are scaffolding, and which you actually care about.</p>

<p>But most developers on a team won&#8217;t invest the time to master Maven, and shouldn&#8217;t need to. They have business value to deliver. This is the wall I&#8217;m hitting supporting a high performance development team, because there is a low tolerance for spending time on things other than building the application features customers need.</p>

<p>So is Ant any better than this? As I said in my <a href="http://grokandroll.com/maven-great-idea-part-1.html">previous post</a>, Ant builds typically become over-complicated. But Maven projects not only suffer from complexity, they also suffer from Maven&#8217;s inflexibility. Normally you&#8217;d consider trading off some flexibility for simplicity, as long as the end result was higher productivity.</p>

<p>So my <a href="http://kief.com/maven-inflexibility.html">next Maven post</a> will focus on a specific area where Maven&#8217;s inflexibility is hurting my team&#8217;s productivity. I don&#8217;t currently have more than these three posts in mind for this series, but then my team is still only in iteration 0.</p>

<blockquote>
<strong>Feedback on these posts:</strong> I&#8217;m more than happy to be told I&#8217;m wrong, particularly if there are easier, simpler, and better ways to implement the examples I&#8217;ve described. Since I&#8217;ve given up on blog comments (for the time being at least), the best way to give feedback is to mention me (@kief) in a Tweet, with a link to your response.
</blockquote>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Maven: great idea, poor implementation (Part 1)]]></title>
    <link href="http://kief.com/maven-great-idea-poor-implementation-part-1.html"/>
    <updated>2011-03-24T00:00:00+00:00</updated>
    <id>http://kief.com/maven-great-idea-poor-implementation-part-1</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been building Java software using Ant for over 10 years. I&#8217;ve been giving Maven a try every few years since it first came out, and going back to Ant pretty quickly each time, until last year. Early last year I used Maven on a few smallish - pretty much one-person - projects, and found it to be pretty useful, so I decided it may be ready for prime time.</p>

<p>Recently I&#8217;ve begun working on my first build system for a ThoughtWorks project, which happens to be using Maven, and although I&#8217;ve been enthusiastic about the challenge, the weaknesses of the tool are showing pretty clearly.</p>

<p>The idea of Maven is a good one - it&#8217;s a standardised build system that, off the shelf, does pretty much what you need for typical Java projects, using convention over configuration. Ant, on the other hand, is not a build system, it&#8217;s a tool that you can use to create your own build system. It&#8217;s almost a DSL for build systems, but far more flexible.</p>

<p><img src="http://kief.com/images/Paradise.jpg" alt="Paradise" height="282" width="425" align="right" /></p>

<p>The thing is, at least 95% of Java projects have pretty much the same set of requirements from a build system. Get my dependencies. Compile my source. Run my unit tests. Run some analysis. Package my artefact. Run integration tests. Deploy. Build multiple modules into a single aggregated artefact. That&#8217;s pretty much it.</p>

<p>So everyone who uses Ant is using it to do pretty much the same thing, but they create wildly different build systems to do it. As a result, new team members have a serious learning curve, and often require days or even weeks to get set up. Adding tools such as a new code analysis report is not a simple drop-in, and the build system&#8217;s complexity tends to grow over time.</p>

<blockquote>
A typical project&#8217;s Ant-based build system is as complex, and as time consuming to maintain, as any major component of the software it builds. It accumulates technical debt and adds drag on the project&#8217;s velocity.
</blockquote>


<p>So rather than every team having it&#8217;s own home-brewed special snowflake build system, Maven aims to be a build system that uses convention over configuration to build any Java project that follows a common pattern. It&#8217;s become popular enough that other tools can just be dropped in, and a developer joining a Maven-based project could be up and running in less than a day, in ideal cases in under an hour.</p>

<p>Ideally, by using Maven on our project we eliminate the hassle of maintaining a complex build system, because Maven simply does what we need, by default.</p>

<p>This is a worthy goal. Unfortunately, Maven falls short. I&#8217;ll share why I think this is in <a href="maven-configuration-complexity.html">part 2</a> and <a href="http://kief.com/maven-inflexibility.html">part 3</a> of this series.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[DeMarco describes Continuous Delivery (without using the term)]]></title>
    <link href="http://kief.com/demarco-describes-continuous-delivery-without-using-the-term.html"/>
    <updated>2011-02-20T00:00:00+00:00</updated>
    <id>http://kief.com/demarco-describes-continuous-delivery-without-using-the-term</id>
    <content type="html"><![CDATA[<p>From Tom DeMarco&#8217;s article <a href="http://www2.computer.org/cms/Computer.org/ComputingNow/homepage/2009/0709/rW_SO_Viewpoints.pdf">Software Engineering:
An Idea Whose Time Has Come and Gone?</a> [PDF]:</p>

<blockquote>You say to your team leads, &#8220;I have a finish date in mind, and I&#8217;m not even going to share it with you. When I come in one day and tell you the project will end in one week, you have to be ready to package up and deliver what you&#8217;ve got as the final product. Your job is to go about the project incrementally, adding pieces to the whole in the order of their relative value, and doing integration and documentation and acceptance testing incrementally as you go.&#8221;</blockquote>


<p>DeMarco isn&#8217;t recommending specific methodologies like Agile, but this is a pretty good business oriented description of Continuous Delivery without continuous (production) deployment.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[What makes a high performance development team?]]></title>
    <link href="http://kief.com/what-makes-a-high-performance-development-team.html"/>
    <updated>2011-01-10T00:00:00+00:00</updated>
    <id>http://kief.com/what-makes-a-high-performance-development-team</id>
    <content type="html"><![CDATA[<p>The difference between a typical development team and a high performing team is that the typical team tries to deliver quickly by working in ways which turn out to add &#8220;drag&#8221; into its workload.</p>

<p>The harder the typical team works, the more baggage they pile onto themselves, and the harder it becomes for them to deliver. They spend more and more time on maintenance - bugfixing, working around production issues, working around their workarounds, etc. - and they find that even simple change requests and features are unreasonably complex, time consuming, and risky. The team is always busy, and endlessly discuss the refactorings and improvements that would make everything easier, if only they had enough time.</p>

<p>The truth is, even if the code brownies came in one night and completely refactored the typical team&#8217;s code so that it was sparkling clean and completely bug-free, within 6 - 12 months they would find themselves back up to their necks in technical debt. This situation is the inevitable product of the team&#8217;s working habits.</p>

<p>The high performing development team routinely uses practices like TDD, pair programming, Clean Code, and similar. The specific practices may vary, but generally speaking, there are many things that almost all developers know they probably ought to be doing, but generally don&#8217;t.</p>

<p>Most teams find these practices impractical. They may try them out, but they find them awkward to do, and it takes longer to get work done using them. The pressure to deliver (this is a business, after all) forces them to be pragmatic, so they refocus on getting functional code out the door. They dismiss these nice-sounding practices as a luxury, fine for consultants, coaches, and book authors, but impractical in the Real World.</p>

<p>The high performing team, on the other hand, has been doing these things long enough that they have become a matter of habit. It doesn&#8217;t slow them down the way it does a team which is just learning.</p>

<p>It&#8217;s important to note that very few of these practices necessarily make a team churn out code faster. Rather, they reduce the amount of drag produced along with the code, so more developer time is spent writing new code rather than coping with existing code.</p>

<p>The code is more thoroughly tested (it&#8217;s fully retested on every build) so fewer bugs make it into production, which means the team spends less time dealing with production issues. Their applications handle and communicate errors more clearly, so issues that do come up are rapidly identified and fixed. The codebase is structured and written more cleanly, so making changes and adding features is simpler and faster.</p>

<p>The difficulty is that getting from A to B - from a typical team uncomfortable using TDD and the rest, to a high performing team which does them without thinking, requires practice, time, and work, that most teams aren&#8217;t given.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Ops people do it by hand]]></title>
    <link href="http://kief.com/ops-people-do-it-by-hand.html"/>
    <updated>2010-11-09T00:00:00+00:00</updated>
    <id>http://kief.com/ops-people-do-it-by-hand</id>
    <content type="html"><![CDATA[<p>Why do many operations teams prefer to deploy applications manually, even where automated deployment tools exist?</p>

<p><img align="right" src="http://kief.com/images/rice_paddy_plow.jpg" alt="Old school"/></p>

<p>I&#8217;ve been a part of operations teams which deploy manually, but always felt this was wrong, and struggled to get the time and resources to implement automated deployment. But I&#8217;ve encountered teams which actually insist on manual deployment, even when the development team has provided automated deployment tools for them.</p>

<p>The usual explanation is that manually deploying an application is the only way to know exactly what changes are being made. On the face of it, belief in the reliability and auditability of humans over scripts is silly.</p>

<p>But this comes back to my previous point that <a href="http://kief.com/devops/ops-confidence-in-devs.html">Devops is a confidence game</a>. Ops won&#8217;t easily trust a black box deployment tool given to them by developers until they&#8217;ve had loads of experience with it.</p>

<p>Even if the deployment tool is written in a script that the Ops folks could theoretically read and understand if they took the time, it&#8217;s a non-trivial thing. Sysadmins don&#8217;t have loads of time to trawl through some weird developer-oriented scripting language (&#8220;what the hell is Ant?&#8221;) and test the hell out of a deployment script that they may only use every few months or so.</p>

<p>Where I have seen deployment tools used in ops is where ops have been involved in creating the tool. Ideally, ops should pair with developers to design, write, and test the deployment tool. If this isn&#8217;t practical, the deployment tool should be developed using agile principles, with the Ops team as the product owner. Given that ops people are technical, this needs to go even deeper than a normal product owner relationship; they should be involved in the technical design and even code review.</p>

<p>If the ops team is intimately involved in the specification, design, and implementation of the deployment tool, then they will have the confidence that they understand the tool thoroughly enough to use it in environments where failure may mean getting out of bed at 3 AM to fix it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Debugging chef on Vagrant VM]]></title>
    <link href="http://kief.com/debugging-chef-on-vagrant-vm.html"/>
    <updated>2010-11-09T00:00:00+00:00</updated>
    <id>http://kief.com/debugging-chef-on-vagrant-vm</id>
    <content type="html"><![CDATA[<p>Command to debug chef recipes on a  Vagrant VM that uses chef-solo for provisioning:</p>

<p>sudo chef-solo -c /tmp/vagrant-chef/solo.rb -j /tmp/vagrant-chef/dna.json -l debug</p>

<p>Or, the proper way:</p>

<p>vagrant provision</p>

<p>(Thanks to Mitchell Hashimoto for pointing that out)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Bring the Cloud on your desktop with Vagrant]]></title>
    <link href="http://kief.com/bring-the-cloud-on-your-desktop-with-vagrant.html"/>
    <updated>2010-11-04T00:00:00+00:00</updated>
    <id>http://kief.com/bring-the-cloud-on-your-desktop-with-vagrant</id>
    <content type="html"><![CDATA[<p>Some of the guys in the office have been playing with <a href="http://vagrantup.com/">Vagrant</a>, so I spent a bit of time monkeying around with it myself.</p>

<p>In a nutshell: Vagrant lets you write, and share, a configuration file that allows a group of VM&#8217;s to be provisioned and managed in proper cloud-style, running on <a href="http://www.virtualbox.org/">VirtualBox</a>.</p>

<p>You write a configuration file which describes the set of VM&#8217;s you want. This includes:</p>

<ul>
<li>A template to build it from (a &#8220;box&#8221;, which is analogous to an AMI in AWS EC2),</li>
<li><a href="http://wiki.opscode.com/">Chef</a> roles and recipes to apply to configure it,</li>
<li>Where to get chef recipes from (including a dirt simple option of sticking them in a local folder with your vagrant configuration file),</li>
<li>Local folder mapping into the VM&#8217;s, and network port mapping.</li>
</ul>


<p>You can then fire up the set of machines at any time, provisioning them from scratch, exactly as you would with a set of cloud machines. You can share this file so that other people can replicate the same environment.</p>

<p>This is great for playing with a cloud-style deployment environment on your local machine - cheaper, and works offline, although it does need a fair bit of RAM if you want to have many VM&#8217;s running.</p>

<p>Its an excellent way to start learning chef, which itself fails the 10 minute test (I find getting a new chef setup going, even following the instructions on the opscode site, very fiddly).</p>

<p>But the killer application for Vagrant is for development teams. A team can create a Vagrant file to define a local deployment environment that reflects production (with a major caveat mentioned below). This can be checked into the team&#8217;s VCS, then everyone should be able to replicate the environment locally.</p>

<p>Each developer can configure their local build to put the build artefacts into a local path that is mounted by the VM&#8217;s, so they can be deployed in the VM&#8217;s. Automated tests can be run against these.</p>

<p>Pros:</p>

<ul>
<li><p>Passes the 10 minute test for running through the tutorial to set it up, then playing with it on my own afterwards. &#8220;Just Works&#8221;.</p></li>
<li><p>Although you can set up a cluster of VM&#8217;s using VirtualBox without Vagrant, this is fiddly, and not sharable other than by writing up a &#8220;point and click script&#8221;.</p></li>
</ul>


<p>Cons:</p>

<ul>
<li>Only &#8220;Just Works&#8221; if you use Ubuntu and Chef, using the box (VM template) they provide.</li>
</ul>


<p>Vagrant does support running other Linux distributions (and possibly Windows), and other configuration management tools. However, it seems like you pretty much have to roll these yourself.</p>

<ul>
<li>So far, packaging up your own box (VM template) does not pass the 10 minute test. I fired up the stock Ubuntu VM, running apt-get dist ugprade, then ran through the instructions to create a new box, and it failed. A colleague has spent a couple of fruitless days trying to recreate a running CentOS / Puppet VM with Vagrant.</li>
</ul>


<p>But those concerns aside, I&#8217;m convinced the Vagrant model will quickly become an essential part of the devops toolkit.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Devops as a confidence game]]></title>
    <link href="http://kief.com/devops-as-a-confidence-game.html"/>
    <updated>2010-10-21T00:00:00+01:00</updated>
    <id>http://kief.com/devops-as-a-confidence-game</id>
    <content type="html"><![CDATA[<p>As an initiative to get developers, sysadmins, and testers working together to increase the speed of delivering high quality software changes, a key challenge devops must address is trust. Sysadmins simply don&#8217;t trust developers to hand them production ready code.</p>

<p>Sysadmins often seem to hear devops as, &#8220;You guys need to be more agile, like us developers. You should be putting our code into production every time we make a change, dude!&#8221;</p>

<p>Given that sysadmins are used to dealing with software releases hard-coded to run on a developer&#8217;s workstation, this proposition isn&#8217;t always well received.</p>

<p>The way to overcome this is to make sure that when the developers hand the first &#8220;production ready&#8221; build to the ops team, the ops team knows exactly what they&#8217;re getting. The release will be a non-event if the ops team has been involved in planning, designing, and testing the
application throughout development:</p>

<ul>
<li>they know it will reliably deploy into production, because it&#8217;s been deployed into environments which replicate production, using the same tools and processes, several times every day;</li>
<li>they know the things they&#8217;re concerned might break in production have been automatically tested, repeatedly;</li>
<li>they know how to monitor it because their new monitoring checks have been deployed and verified as part of the automated testing process;</li>
<li>they know its logging includes what they need;</li>
</ul>


<p>The ops team knows everything about the release that they need to know to put it into production because they have been involved from day one.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Where is Atlassian going?]]></title>
    <link href="http://kief.com/where-is-atlassian-going.html"/>
    <updated>2010-09-30T00:00:00+01:00</updated>
    <id>http://kief.com/where-is-atlassian-going</id>
    <content type="html"><![CDATA[<p><a href="http://atlassian.com">Atlassian&#8217;s</a> acquisition of <a href="http://bitbucket.org/">Bitbucket</a> (shouldn&#8217;t that be &#8220;bitBucket? How un-fashionable!), a hosted version control service, seems to be another step in the strategic direction shown by their launch of the <a href="http://www.atlassian.com/hosted/studio/">Jira Studio</a> service, which included hosted issue tracking, wiki, source code search, review, and continuous integration with Bamboo. Jira Studio already had Subversion hosting, but bitBucket offers <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">Distributed version control</a>, which is rapidly moving towards the mainstream.</p>

<p>What this looks like to me is Atlassian moving from providing tools for development teams (as opposed to tools for individual developers, such as IDEs) as essentially shrink-wrapped products, to providing them as a hosted service. Development Infrastructure as a Service (DIAAS) if you will, or better yet (more trendy!), devops as a Service (DevOpsaaS? DOaaS?)</p>

<p>This seems like a good position to get into as development for the cloud grows as a platform. Regardless of whether proper PaaS ever takes off (I&#8217;m sure it will, but it may take longer than we think), even teams developing for current application server platforms hosted on IaaS clouds can benefit from DevOpsaaS.</p>
]]></content>
  </entry>
  
</feed>

