<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>maxgarrick.com &#187; development</title>
	<atom:link href="http://maxgarrick.com/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxgarrick.com</link>
	<description>Come take a look under the hood</description>
	<lastBuildDate>Sun, 08 Mar 2009 23:32:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get your dev server, $0.10 a pop</title>
		<link>http://maxgarrick.com/get-your-dev-server-010-a-pop/</link>
		<comments>http://maxgarrick.com/get-your-dev-server-010-a-pop/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 02:50:55 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[openvz]]></category>

		<guid isPermaLink="false">http://maxgarrick.com/?p=14</guid>
		<description><![CDATA[One of the best uses of virtualization technology is for creating development environments.  Virtual private servers (VPS) are ideal if you need a sandbox to create a new application stack, develop a new web app, or test out the app under a variety of Q/A scenarios.
How can we offer dev environments with low provisioning [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best uses of virtualization technology is for creating development environments.  Virtual private servers (VPS) are ideal if you need a sandbox to create a new application stack, develop a new web app, or test out the app under a variety of Q/A scenarios.</p>
<p>How can we offer dev environments with low provisioning cost?  This is one way:</p>
<ul>
<li>Set up OpenVZ on a RHEL5 server.</li>
<li>Set up a web template (Apache, PHP5).</li>
<li>Set up a MySQL template</li>
<li>For each dev environment, deploy a web and MySQL container.</li>
</ul>
<p>This 4 step process glosses over many important challenges.  For instance:</p>
<ul>
<li>How do you access these machines over the network?</li>
<li>How to get the latest code into each deployed web container?</li>
<li>How to get the latest MySQL schema &amp; associated dev data into the MySQL container?</li>
<li>How to get code and schema changes out of the container and into another environment (e.g.: deploying to production)?</li>
<li>How to upgrade/restart the VPS without having to coordinate with each developer?</li>
</ul>
<p>I&#8217;m thinking we can overcome these challenges with some crafty configuration &amp; scripts.</p>
<h2>Network access</h2>
<p>NAT all VPS servers for more fluid provisioning, less DNS updates.  Web nodes occupy one network subnet, DB nodes occupy another.  Use a database to track all VPS and build a simple webapp on top that provides bookmarks to each VPS along with CRUD ops.</p>
<h2>Getting code into the VPS</h2>
<p>Using our git repo, check out a working copy with the latest dev branch.  Alternatively, NFS mount staff home directories in each VPS and work off that.  I&#8217;d prefer the NFS approach, as it makes the VPS more transient: we can destroy and re-create the server using an upgraded template if desired without loosing code.</p>
<h2>Getting DB schema into the VPS</h2>
<p>Database migrations, similar to Rails (we use PHP for most apps).  Moodle CMS also has a form of database migrations which happen via the web, which is a tad simpler.  <a href="http://www.phpdoctrine.org/">Doctrine</a> ORM supports database migrations, although we use it only for new development and it won&#8217;t help our existing code.  For older/legacy webapps, we&#8217;ll have to maintain a per-tool schema file to bootstrap our webapps.</p>
<h2>Getting code and schema updates out of the VPS</h2>
<p>Pull code changes using git into a central repo.  Put all database migrations in the code, using Doctrine as described above, or schema bootstrap file.</p>
<h2>Painless VPS reboots</h2>
<p>If all database changes exist in code, and all code exists on the shared NFS server, then destroying &amp; deploying a new VPS from an updated template should not impact a developer.  Test data may disappear, which may cause concern.  Ideally, all important data would be saved in-code and easily imported into MySQL, through migrations or bootstrap SQL files.   Alternatively, we could place the MySQL data files on an iSCSI lun, at an additional provisioning cost.</p>
<p>Once we are able to quickly provision new dev environments, why not do the same for production apps?  I think we could use the same code bootstrap &amp; database migration code to deploy new application stacks on demand.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxgarrick.com/get-your-dev-server-010-a-pop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
