
<?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>Nobien</title>
	<atom:link href="http://blog.nobien.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nobien.net</link>
	<description>A nerd blog about nerdy things by ... nerdy guys?</description>
	<lastBuildDate>Mon, 15 Aug 2011 02:16:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Nginx, uWSGI, and web.py&#8230;and my new job</title>
		<link>http://blog.nobien.net/2011/08/14/nginx-uwsgi-and-web-py-and-my-new-job/</link>
		<comments>http://blog.nobien.net/2011/08/14/nginx-uwsgi-and-web-py-and-my-new-job/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 02:16:55 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=382</guid>
		<description><![CDATA[This past week I started a new job at Local Projects. I'm really excited about working with all the talented people there. One of the fun things about the job so far is that I'm doing a bunch of Python development with web.py. It's a great minimal web framework and working with Python has been [...]]]></description>
			<content:encoded><![CDATA[<p>This past week I started a new job at <a title="Local Projects" href="http://www.localprojects.com" target="_blank">Local Projects</a>. I'm really excited about working with all the talented people there. One of the fun things about the job so far is that I'm doing a bunch of Python development with <a title="web.py" href="http://www.webpy.org">web.py</a>. It's a great minimal web framework and working with Python has been great as well.</p>
<p>One of the things I wanted to do this weekend was to figure out how to run a web.py app with <a title="nginx" href="http://www.nginx.org/">nginx</a> and <a title="uWSGI" href="http://projects.unbit.it/uwsgi/wiki">uWSGI</a>. It took me ages to figure it out, but I finally got a working setup. This post is mostly to document the few things that made the difference.</p>
<p>First thing to note is that I did this all on a micro instance of Ubuntu 11.04 on EC2 (<a href="https://console.aws.amazon.com/ec2/home?region=us-east-1#launchAmi=ami-1aad5273">ami-1aad5273</a>). Second, I installed the lastest versions of nginx and uWSGI from source. The following gist lists examples of the files I used to get this running. I should note that the config and .sh files are intended for running one server and one web.py application.</p>
<p><script src="https://gist.github.com/1145592.js"> </script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2011/08/14/nginx-uwsgi-and-web-py-and-my-new-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The wonderful eyeo festival</title>
		<link>http://blog.nobien.net/2011/07/01/the-wonderful-eyeo-festival/</link>
		<comments>http://blog.nobien.net/2011/07/01/the-wonderful-eyeo-festival/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 15:49:37 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=375</guid>
		<description><![CDATA[I think I'd be putting it lightly if I said that eyeo festival was inspiring. It was easily the best gathering of talented minds that I've been to over the years. I'd only be echoing the words of nearly every attendee if I was to go into any detail about what made the event so [...]]]></description>
			<content:encoded><![CDATA[<p>I think I'd be putting it lightly if I said that <a href="http://www.eyeofestival.com" target="_blank">eyeo festival</a> was inspiring. It was easily the best gathering of talented minds that I've been to over the years. I'd only be echoing the words of nearly every attendee if I was to go into any detail about what made the event so great, so I'll spare your time. The biggest thing in my mind is that eyeo must be an indicator of where our minds should be headed.</p>
<p>You can so easily forget about what artists, designers, and developers are doing outside the stereotypical agency world of microsites, Facebook apps, Twitter mashups, and the like. Much of this work isn't rooted in the web, and as a developer I am more inspired to look beyond the laptop and mobile screen. I know I have the skills and know-how, I just need to get my mind out the rut its been in and into the area that the speakers and attendees of eyeo have carved out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2011/07/01/the-wonderful-eyeo-festival/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java, Foursquare, Instagram, and the Last Six Months</title>
		<link>http://blog.nobien.net/2011/06/24/java-foursquare-instagram-and-the-last-six-months/</link>
		<comments>http://blog.nobien.net/2011/06/24/java-foursquare-instagram-and-the-last-six-months/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 20:32:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Spring Framework]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[instagram]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring framework]]></category>
		<category><![CDATA[spring social]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=362</guid>
		<description><![CDATA[After a bit of a hiatus, it's time to start writing again. In the last six months I've been familiarizing myself with as many different technologies and tools as possible. There has been, though, a focus on Java, Spring Framework, and it's various sub projects such as Spring Social. I gave Spring Social a try [...]]]></description>
			<content:encoded><![CDATA[<p>After a bit of a hiatus, it's time to start writing again. In the last six months I've been familiarizing myself with as many different technologies and tools as possible. There has been, though, a focus on Java, <a href="http://www.springsource.org/about" target="_blank">Spring Framework</a>, and it's various sub projects such as <a href="http://www.springsource.org/spring-social" target="_blank">Spring Social</a>.</p>
<p>I gave Spring Social a try a a few months ago when building a little prototype for a project at work. It made integrating with sites like Facebook and Twitter so ridiculously easy. For whatever reason I was expecting a lot of headaches so I was pleasantly surprised. So much so that I was motivated to write an <a href="https://github.com/mattupstate/spring-social-instagram" target="_blank">API binding for Instagram</a>. It was a good way to cut my teeth as their API isn't too complicated. Nearly all API endpoints are covered aside from some sort of implementation against their real-time API. Also, it's not officially released by SpringSource so you won't find it in any of their repositories or the central Maven repo. Check out the tiny <a href="https://github.com/mattupstate/spring-social-instagram-example" target="_blank">example project</a> to get started with it. Or better yet, fork it and contribute.</p>
<p>To my surprise, <a href="http://twitter.com/#!/poornerd" target="_blank">@poornerd</a> was actually using it in a project of his. Check out the hist <a href="http://beta.locoflow.com/venue.jsp?vid=4adcda7af964a5201a4721e3&amp;tag=smcberlin" target="_blank">test/beta</a>. His project also intends to use Foursquare so I decided to have a go at writing another <a href="https://github.com/mattupstate/spring-social-foursquare" target="_blank">API binding for Foursquare</a>. The Foursquare API is much more complicated than Instagram, and there are some oddities with how their objects are serialized to JSON. Thus, some of the object names are a little odd but I'm hoping to get some feedback from the community on that.  Aside from that, all major endpoints are implemented aside from the "multi" API which lets you  make more than one call with one HTTP request. I also setup an <a href="https://github.com/mattupstate/spring-social-foursquare-example" target="_blank">example project</a> for Foursquare as well.</p>
<p>It's been fun contributing to an open source community and hopefully at some point they'll be officially released through SpringSource. Some feedback and/or criticisms would be greatly appreciated about either project so please go check them out if you have a moment and leave your comments here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2011/06/24/java-foursquare-instagram-and-the-last-six-months/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick Update</title>
		<link>http://blog.nobien.net/2011/02/03/quick-update/</link>
		<comments>http://blog.nobien.net/2011/02/03/quick-update/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 04:56:09 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=358</guid>
		<description><![CDATA[Howdy, everyone. It's been ages since I've written on this thing so I wanted to give you an update on what I've been up to. Over the past summer and fall I had been working on a large project for a client that I, unfortunately, can't mention. I may not ever be able to mention [...]]]></description>
			<content:encoded><![CDATA[<p>Howdy, everyone. It's been ages since I've written on this thing so I wanted to give you an update on what I've been up to.</p>
<p>Over the past summer and fall I had been working on a large project for a client that I, unfortunately, can't mention. I may not ever be able to mention it. The project itself was pretty cool. It was a product configuration application. The front end was built with Flash using Robotlegs as the core architecture. On the backend there was two systems. The application model was tied in with Magento and all data was accessed using AMF. I didn't build or maintain that bit, but I had the pleasure of working with Adil Hashem on that piece.</p>
<p>The other backend system was a Java image compositor. The image compositor already existed but it needed a different implementation for the application to scale. With the image compositor being written in Java I took the opportunity to get into Java web development. I spent a good couple of weeks getting into <a title="Spring Framework" href="http://www.springsource.org/" target="_self">Spring Framework </a>and its Web MVC component. I also started exploring usage of <a title="MongoDB" href="http://www.mongodb.org/" target="_blank">MongoDB</a> for basic statistical tracking but in the end went with Amazon's SimpleDB for ease of use and to minimize future IT needs. The whole image compositor is hosted and supported with various Amazon web services including EC2, S3, and CloudFront. I also set up a pretty snazzy automated deployment process with Ant.</p>
<p>The product configuration application was just one part of a bigger project. My app was pretty much in order but a combination of problems from all sorts of sources caused the project to stagger and eventually the project abruptly ended. I wont go into anything beyond that because it doesn't really matter. I was certainly bummed out when I found out the project would never see the light of day. However, the positive side is that I learned a whole bunch of new stuff. I'm really stoked on Spring and MongoDB lately. I can whip up backend prototypes so quickly with those two pieces of software and <a title="Morphia" href="http://code.google.com/p/morphia/" target="_blank">Morphia</a> which is a document mapper for Java.</p>
<p>After work for me stopped on that project I started getting into Android game development a bit. It was fun for a while but I eventually decided that I had been at Rokkan for long enough. Nearly 5 and a half years after I came to New York City to work for them I finally felt the need to move on. I interviewed at a bunch of places and I ended up taking a job at <a title="Syrup" href="http://www.syrupnyc.com" target="_blank">Syrup</a>. Syrup is essentially a full blown advertising agency but they're quite small considering how much they do. They do broadcast, print, and digital. They brought me on as their CTO to help boost their digital offering. I'm working with some really creative people and its been awesome so far.</p>
<p>That's all for now. I'm hoping to get back into blogging a bit. I'm still trying to prototype ideas and I hope to share some of the things I run into along the way. Perhaps I'll write a post on Spring and MongoDB next. Who knows...until then, happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2011/02/03/quick-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Practicing Continuous Integration on Flash Projects : Using Hudson</title>
		<link>http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-using-hudson/</link>
		<comments>http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-using-hudson/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 13:56:41 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=304</guid>
		<description><![CDATA[In the previous part of my series "Practicing Continuous Integration on Flash Projects" I described how to setup a CI server using Amazon's EC2 service. In this final part of the series I'm going to quickly show you how to set up your project in Hudson so that it can build it. Using Hudson If you're [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a title="Integration Server Setup" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-integration-server-setup/">previous part</a> of my series "Practicing Continuous Integration on Flash Projects" I described how to setup a CI server using Amazon's EC2 service. In this final part of the series I'm going to quickly show you how to set up your project in Hudson so that it can build it.</p>
<h2>Using Hudson</h2>
<p>If you're practicing CI properly you should be integrating new code on a pretty regular basis. When new code is integrated the project should then run through its build process which should include running all the unit tests and building the project if all the unit tests pass. This is where Hudson comes in. Hudson can monitor your source repository and whenever new code is committed it will retrieve it and build the project. Now I'm going to show you how to set up the CIExample project in Hudson.</p>
<p><span id="more-304"></span></p>
<p>If you happen to follow the steps in the previous part of this series, or have your own Hudson server properly configured navigate to the Hudson install's home page. It should look like this:</p>
<div id="attachment_306" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-intro.jpg"><img class="size-medium wp-image-306" title="hudson-intro" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-intro-299x181.jpg" alt="" width="299" height="181" /></a><p class="wp-caption-text">Hudson dashboard</p></div>
<p>Click the "New Job" link in the top left. In the 'Job name' field enter 'CIExample' and select the "Build a free-style software project" option. The screen should look like this:</p>
<div id="attachment_308" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-newjob1.jpg"><img class="size-medium wp-image-308" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-newjob1-299x181.jpg" alt="New job screen" width="299" height="181" /></a><p class="wp-caption-text">New job screen</p></div>
<p>Click the OK button. If you'd like you can fill out a description for the project. But for now we're going to be quick and dirty. Scroll down a bit to the Source Code Management section. Select the Subversion option and some form fields should appear. Configure the repository URL with the CIExample project SVN repository: <a href="http://ci-example.googlecode.com/svn/trunk/">http://ci-example.googlecode.com/svn/trunk/</a> It should look like this:</p>
<div id="attachment_309" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-subversion.jpg"><img class="size-medium wp-image-309" title="hudson-subversion" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-subversion-299x181.jpg" alt="" width="299" height="181" /></a><p class="wp-caption-text">Hudson source code management configuration</p></div>
<p>Scroll all the way down so that you can see the Build Environment and Build sections. First check the "Run Xvnc during build" check box. This ensures the Flash Player will be able to be used when inspecting the unit tests. Lastly, in the Build section, click the "Add build step" button and select "Invoke Ant" from the list of options. We don't need to specify any targets since the default target of the project's build file builds the project. The screen should look like this:</p>
<div id="attachment_312" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-vnc-ant1.jpg"><img class="size-medium wp-image-312" title="hudson-vnc-ant" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-vnc-ant1-299x181.jpg" alt="" width="299" height="181" /></a><p class="wp-caption-text">Hudson VNC and ANT configuration</p></div>
<p>Lastly, click the "Save" button to save the project. This should take you to the project's dashboard and look like this:</p>
<div id="attachment_311" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-project.jpg"><img class="size-medium wp-image-311" title="hudson-project" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-project-299x181.jpg" alt="" width="299" height="181" /></a><p class="wp-caption-text">Hudson project dashboard</p></div>
<p>Now, the only thing left to do is click the "Build Now" button in the left hand navigation. After a second or two of clicking the button a notification window should appear and should look like this:</p>
<div id="attachment_314" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-notification1.jpg"><img class="size-medium wp-image-314" title="hudson-notification" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-notification1-299x181.jpg" alt="" width="299" height="181" /></a><p class="wp-caption-text">Hudson notification panel</p></div>
<p>If everything has been installed and configured properly the build should be successful and you'll see a little blue dot notifying you that the build has completed. It should look like this:</p>
<div id="attachment_315" class="wp-caption aligncenter" style="width: 309px"><a href="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-completed.jpg"><img class="size-medium wp-image-315" title="hudson-completed" src="http://blog.nobien.net/wp-content/uploads/2010/07/hudson-completed-299x181.jpg" alt="" width="299" height="181" /></a><p class="wp-caption-text">Build completed!</p></div>
<p>Wa-la! Thats it! You've got Hudson working and building your project for you. Pretty awesome. Now you can configure the project with various options. For instance, you can configure Hudson to build the project whenever it detects new code has been committed to the repository so that you don't have to initiate the build by hand every time.</p>
<h2>Wrap Up</h2>
<p>So that concludes my "Practicing Continuous Integration on Flash Projects" series. In the first part I covered what Continuous Integration is and why it might be useful to your process. In the second part of the series I covered how to set up a project and its unit tests with the assumption that the build and tests will be automated. In the third part of the series I covered how to automate the build process using Apache Ant. In the fourth part of the series I covered how to setup a Continuous Integration server on a bare bones Fedora 8 Linux box using Amazon's EC2 service. And lastly, in this fifth and final part I covered how to setup the project in Hudson so that the build process can be automated and monitored</p>
<p>Series Index</p>
<ol>
<li><a title="What is CI?" href="http://blog.nobien.net/2010/07/18/practicing-continuous-integration-on-flash-projects-what-is-ci/">What is CI?</a></li>
<li><a title="Project Structure" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-project-structure/">Project Structure</a></li>
<li><a title="Automation" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-automation/">Automation</a></li>
<li><a title="Integration Server Setup" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-integration-server-setup/">Integration Server Setup</a></li>
<li><a title="Using Hudson" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-using-hudson/">Using Hudson</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-using-hudson/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Practicing Continuous Integration on Flash Projects : Integration Server Setup</title>
		<link>http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-integration-server-setup/</link>
		<comments>http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-integration-server-setup/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 13:52:49 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=290</guid>
		<description><![CDATA[In the previous part of my series "Practicing Continuous Integration on Flash Projects" I explained how to use Apache Ant and the Flex SDK to automate the build process of a project. In this part of the series I'm going to show you how to set up Hudson, an integration server, on a bare bones [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a title="Automation" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-automation/">previous part</a> of my series "Practicing Continuous Integration on Flash Projects" I explained how to use Apache Ant and the Flex SDK to automate the build process of a project. In this part of the series I'm going to show you how to set up <a title="Hudson CI Server" href="http://www.hudson-ci.org/">Hudson</a>, an integration server, on a bare bones Fedora 8 Linux box.</p>
<h2>Introduction</h2>
<p>Code integration happens whenever you commit code into the project's mainline. There are essentially two camps when it comes to building the project after new code has been committed. Some developers prefer to do it manually, meaning that the developer switches to the "integration machine", checks out the new code and runs the build process. If the build is successful then the developer's commit is also successful. If its not successful, then the developer should revert their commit, make adjustments to their code, and attempt to integrate again later.</p>
<p>The other camp enjoys using a CI server such as Hudson or CruiseControl. A CI server will monitor the project's mainline and attempt to build the project any time new code is committed. A developer can check out the CI server website to see the progress or the eventual status of the build. When the build is complete, successful or not, the CI server should notify the developer who committed the new code. Personally I think a CI server is an invaluable tool when it comes to practicing CI and thus I'd like to show you how to get Hudson up and running.</p>
<p><span id="more-290"></span></p>
<h2>Amazon EC2</h2>
<p><a title="Amazon Web Sevices" href="http://aws.amazon.com/">Amazon EC2</a> is a great service that allows you to create computing resources on demand. In other words, it gives you an easy way of expanding your network infrastructure without actually having to buy hardware. In my mind, its the perfect service to run a CI server on because its easy to use and relatively cheap (you only pay for what you use). Otherwise, you'll need to find an machine in your network to install your flavor of CI server on. Personally, I'd rather not bog down an existing machine on my network with building projects. Amazon EC2 gives me nearly instant access to a virtual Linux box with root access and a decent amount of storage.</p>
<h2>Creating an Instance on EC2</h2>
<p>First allow me to make a disclaimer. Just because I'm advocating the use of EC2, doesn't mean you'll need an Amazon Web Services account to run a CI server. The steps needed to get Hudson up and running will depend on the flavor of Linux you're running, but if you know Linux then it shouldn't be too hard to know what to adjust for your setup. Additionally, Hudson runs just fine on Windows. If you need information about installing Hudson on other platforms visit their <a href="http://www.hudson-ci.org/">website</a>.</p>
<p>So, before we can do anything, we'll need a machine to run Hudson on. With EC2 that means starting an instance. Before starting up an instance you should consider if you might ever want to reuse the resulting system configuration. If you think you might want to reuse it then ensure that you create an EBS backed instance. This will allow you to easily create an AMI from it and then be able to easily launch a new instance of the same configuration later on. Information about creating an EBS backed instance can be found in their <a title="EC2 documentation" href="http://aws.amazon.com/documentation/ec2/">documentation</a>.</p>
<p>For the purpose of this example a small instance of a bare bones, 32-bit, Fedora 8 system is just fine. Here is what I did to get my instance running:</p>
<ol>
<li>Log in to the AWS Management Console</li>
<li>Click the <strong>AMIs</strong> button in the navigation panel on the left hand side</li>
<li>Select <strong>EBS Images</strong> from the combo box labeled <strong>Viewing</strong> above the list of AMIs</li>
<li>Click the <strong>Owner</strong> column label to sort the AMIs by owner.</li>
<li>Select the AMI with the source name <strong>amazon/fedora-8-i386-v1.14-std</strong>. It should be the first one on the list.</li>
<li>Click the <strong>Launch</strong> button above the list.</li>
<li>Select the default settings on the Instance Details panel</li>
<li>Create a key pair or use an existing key pair.</li>
<li>Configure the firewall to allow connections on port 22, 80, 8080 and any other ports that you think might be necessary</li>
<li>Review the details and launch the instance.</li>
</ol>
<p>Eventually you're instance will show up as running in the dashboard. Once its running ensure you can connect to the instance using your favorite SSH client. I personally use PuTTy. Bear in mind that EC2 instances don't use password authentication to connect. They use the public keys. PuTTy is a little weird when it comes to public keys and requires them to be converted to a specific format. Luckily Amazon has a <a title="PuTTy info" href="http://docs.amazonwebservices.com/AmazonEC2/gsg/2007-01-19/putty.html">quick little tutorial</a> on how to properly configure PuTTy with the public keys.</p>
<h2>Software</h2>
<p>Once you're able to connect to your instance its time to start installing all the software you'll need to run Hudson and build your Flash project. The following is a list of all the software needed:</p>
<ol>
<li>vnc (remote display system)</li>
<li>vnc-server (to allow connections)</li>
<li>X-Window (windowing agent)</li>
<li>GNOME (window manager/desktop)</li>
<li>Subversion (SVN)</li>
<li>Java Development Kit (JDK)</li>
<li>Apache Tomcat (or other Java servlet service)</li>
<li>Apache Ant</li>
<li>Flex SDK</li>
<li>Hudson</li>
<li>Xvnc plugin for Hudson</li>
</ol>
<p><strong>Installing vnc and vnc-server</strong><br />
Installing vnc and vnc-server is important because in order to analyze the compiled unit tests the resulting SWF needs to run in the Flash Player. Linux needs a windowing environment and a way of redirecting the windowing output to a virtual display. vnc is what does the redirecting. To install vnc and vnc-server simply type the following commands and agree to download the files:</p>
<p><em># yum install vnc<br />
#yum install vnc-server </em></p>
<p><strong>Installing X-Window (X11)</strong><br />
As previously mentioned, you'll need a windowing environment to run the Flash Player, particularly for analyzing unit test results. To install X-Window type the following command:</p>
<p><em># yum -y install xorg*</em><em> </em></p>
<p><strong>Installing GNOME</strong><br />
X-Window(X11) will need a window manager and, more importantly, we'll need a window manager that works with X11 and doesn't require any user input to create a screen. GNOME is a decent choice and will make connecting through a visual VNC client pretty nice as well. To install GNOME type the following command:</p>
<p># yum groupinstall "GNOME Desktop Environment"</p>
<p><strong>Installing Subversion</strong><br />
The CIExample project resides in a Subversion repository on Google Code, thus you'll need Subversion to be installed to retrieve it. To install Subversion simply type the following:</p>
<p><em># yum install subversion</em></p>
<p><strong>Installing the Java Development Kit</strong><br />
Installing the JDK is a little tricky mainly because Sun doesn't make finding the distributable files very easy. You'll want to download a binary package from somewhere into some location on the machine. I like to create a downloads folder at the root of the machine for this. At the time of writing this you can download the latest self extracting RPM by typing the following commands:</p>
<p><em># wget http://www.java.net/download/jdk6/6u21/promoted/b05/binaries/jdk-6u21-ea-bin-b05-linux-i586-29_may_2010-rpm.bin<br />
# chmod 755 jdk-6u21-ea-bin-b05-linux-i586-29_may_2010-rpm.bin<br />
# ./</em><em>jdk-6u21-ea-bin-b05-linux-i586-29_may_2010-rpm.bin</em></p>
<p>To confirm the JDK was installed, you can type the following command:</p>
<p><em># java -version</em></p>
<p>You should see something like the following:</p>
<p><em>java version "1.6.0_21-ea"<br />
Java(TM) SE Runtime Environment (build 1.6.0_21-ea-b05)<br />
Java HotSpot(TM) Client VM (build 17.0-b15, mixed mode, sharing)</em></p>
<p><strong>Install Apache Tomcat</strong></p>
<p>Apache Tomcat is needed because Hudson is written in Java. Before we install tomcat, however, a new Linux user should be created to run tomcat under. Create a user named tomcat by typing the following command:</p>
<p><em># useradd tomcat</em></p>
<p>Switch to the tomcat user by typing the following command:</p>
<p><em># su tomcat</em></p>
<p>Create a folder for tomcat to be installed in within the /usr/local folder by typing the following commands:</p>
<p><em># cd /usr/local<br />
# mkdir tomcat</em></p>
<p>Download Apache Tomcat into the folder you created from any of the available mirrors and extract the files. At the time of this writing I typed the follwing:</p>
<p><em># cd tomcat<br />
# wget http://mirror.atlanticmetro.net/apache/tomcat/tomcat-7/v7.0.0-beta/bin/apache-tomcat-7.0.0.tar.gz<br />
# tar -xvf apache-tomcat-7.0.0.tar.gz</em></p>
<p>Now all the files for tomcat are located in /usr/local/tomcat/apache-tomcat-7.0.0. Last thing to do now is switch back to the root user:</p>
<p><em># exit </em></p>
<p><strong>Install Apache Ant</strong><br />
Apache Ant is need to run the automated build process. Ant doesn't require anything special for installing, simply download the binary and extract it into a convenient location. I prefer to install it in the the /usr/ant/&lt;version&gt; folder. Also, don't forget to switch back to the root user. At the time of this writing I typed the following:</p>
<p><em># cd /usr<br />
# mkdir ant<br />
# cd ant<br />
# wget http://apache.opensourceresources.org/ant/binaries/apache-ant-1.8.1-bin.tar.gz<br />
# tar -xvf apache-ant-1.8.1-bin.tar.gz</em></p>
<p>Now all the files for Ant should reside in the folder /usr/ant/apache-ant-1.8.1.</p>
<p><strong>Install the Flex SDK</strong><br />
Now we need to install the Flex SDK. This will be just like installing Ant. I like to install any SDK's in a folder structure such as this: /sdk/&lt;name-version&gt;. Type the following to install the Flex SDK:</p>
<p><em># cd /<br />
# mkdir sdk<br />
# cd sdk<br />
# mkdir flex-4.1<br />
# wget http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076.zip<br />
# unzip flex_sdk_4.1.0.16076.zip -d /sdk/flex-4.1</em></p>
<p><strong>Set Environment Variables and Permissions</strong><br />
In order for a lot of this software to run properly you'll need to set some environment variables, add additional directories to the system PATH variable, change some file permissions. First, lets set the JAVA_HOME, ANT_HOME, CATALINA_HOME and FLEX_HOME environment variables and add Ant to the system PATH. To do this we'll need to edit the /etc/profile file. Type the following to open the file in the basic vi text editor:</p>
<p><em># vi/etc/profile</em></p>
<p>Now we need to add some new lines to the file. Using the vi text editor is a little weird if you haven't used it before. I'll describe exactly what I did.</p>
<ol>
<li>Navigate one line below the line that reads: "<em>export PATH USER LOGNAME MAIL HOSTNAME HITSIZE INPUTRC</em>" by using the arrow keys on your keyboard.</li>
<li>Press the letter <em>i </em>on your keyboard to enter insert mode.</li>
<li>Enter the following text into the file:
<div id="_mcePaste"><em>export JAVA_HOME=/usr/java/jdk1.6.0_21</em></div>
<div id="_mcePaste"><em>export ANT_HOME=/usr/ant/apache-ant-1.8.1</em></div>
<div id="_mcePaste"><em>export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-7.0.0<br />
export FLEX_HOME=/sdk/flex-4.1</em></div>
<div id="_mcePaste">
<div id="_mcePaste"><em>export PATH=$PATH:$ANT_HOME/bin<br />
</em></div>
</div>
</li>
<li>Press the <em>escape</em> key on your keyboard to exit insert mode</li>
<li>Type the following to save and quit the text editor:<em>:wq</em></li>
<li>Logout of your SSH session</li>
<li>Log back into your SSH session</li>
<li>Verify that each environment variable has been set by typing the following:<br />
<em><br />
# echo $JAVA_HOME<br />
# echo $ANT_HOME<br />
# echo $CATALINA_HOME<br />
# echo $FLEX_HOME<br />
</em></li>
<li>Verify that Ant can be called by the tomcat user from within the tomcat folder by typing the following:<br />
<em><br />
# su tomcat<br />
# cd /usr/local/tomcat<br />
# ant -version </em></li>
</ol>
<p>Hopefully all went well for you there. Now we just need to change the permissions on the Flex SDK so that any user Linux user, specifically the tomcat user, can use the SDK. Type the following:</p>
<p><em># exit (switch back to root user)<br />
# cd /sdk<br />
# chmod -R 755 flex-4.1 </em></p>
<p>Verify the tomcat user can execute the mxmlc compiler by typing the following:</p>
<p><em># cd /usr/local/tomcat<br />
# su tomcat<br />
# /sdk/flex-4.1/bin/mxmlc</em></p>
<p>If you don't get a permission error you're good to go!</p>
<p><strong>Installing Hudson</strong><br />
Hudson can be installed in many ways, but in my opinion, the easiest way to install it is to deploy through the Tomcat manager. First you'll need to download Hudson to your local machine. The most recent WAR file can always be downloaded from <a title="Latest Version of Hudson" href="http://hudson-ci.org/latest/hudson.war">this link</a>. Save it somewhere easy to remember.</p>
<p>Now before you can access the Tomcat manager you're going to need to add a user with permission to view the web manager. To do this we need to modify the Tomcat user file. Type the following:</p>
<p># su tomcat<br />
# vi /usr/local/tomcat/apache-tomcat-7.0.0/conf/tomcat-users.xml</p>
<p>Now modify the file using the following steps:</p>
<ol>
<li> Navigate between the &lt;tomcat-users&gt;&lt;/tomcat-users&gt; XML node by using the arrow keys on your keyboard.</li>
<li>Press the <em>i </em>key on your keyboard to enter insert mode.</li>
<li>Enter the following text:&lt;user username="admin" password="tomcatadmin" roles="manager-gui"/&gt;</li>
<li>Modify the username and password to your liking.</li>
<li>Press the <em>escape</em> key on your keyboard to exit insert mode.</li>
<li>Type the following to save and quit the text editor<br />
<em>:wq&lt;enter&gt;</em></li>
</ol>
<p>Now its time to startup Tomcat. To start Tomcat type the following:</p>
<p><em> # $CATALINA_HOME/bin/startup.sh</em></p>
<p>You should see some output in the console. Now, open your favorite web browser and navigate to the URL of your EC2 instance on port 8080. For instance, my url looked like this:</p>
<p><em>http://&lt;some-ec2-id&gt;.compute-1.amazonaws.com:8080</em></p>
<p>Navigate to the manager console by clicking on the <em>Tomcat Manager </em>button in the left navigation under the Administration tab. Login with the user credentials you created in the tomcat-users.xml file. You should see a list of the web apps that have been packaged with Tomcat. Now its time to deploy Hudson on Tomcat. Perform the following:</p>
<ol>
<li>Scroll down to the <em>Deploy</em> section of the manager console.</li>
<li>Click the <em>Choose File </em>button in the <em>War file to deploy</em> section of the console.</li>
<li>Click the <em>deploy</em> button below the <em>Choose File</em> button.</li>
<li>Wait for the file to upload</li>
<li>Find Hudson in the list of applications and verify that it is running</li>
</ol>
<p>Now there's a little tricky thing you have to do in order to get the index page of Hudson to appear. From what I understand its discrepency in the Java servlet specification. Alas, all you need to do is modify Hudson's web.xml file.</p>
<ol>
<li>Open Hudson's web.xml file in a text editor by typing the following:<br />
<em># vi /usr/local/tomcat/apache-tomcat-7.0.0/webapps/hudson/WEB-INF/web.xml<br />
</em></li>
<li>Find the &lt;servlet-mapping&gt; node that looks like the following:<br />
<em>&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;Stapler&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;/&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;<br />
</em></li>
<li>Press the letter <em>i</em> on your keyboard to enter insert mode.</li>
<li>Modify the entry to look like the following:<br />
<em>&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;Stapler&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;/</em><strong><em>*</em></strong><em>&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;<br />
</em></li>
<li>Press the <em>escape</em> key on your keyboard to exit insert mode.</li>
<li>Type the following command to save and quit<br />
<em>:wq&lt;enter&gt;</em></li>
</ol>
<p>Now you can view Hudson in your browser with no trouble. Go to the following URL:</p>
<p><em>http://&lt;some-ec2-id&gt;.compute-1.amazonaws.com:8080/hudson/</em></p>
<p>You should now be able see the Hudson dashboard!</p>
<p><strong>Install Hudson Plugins</strong><br />
There are loads of plugins for Hudson, including this totally sweet<a title="Chuck Norris Hudson Plugin" href="http://wiki.hudson-ci.org/display/HUDSON/ChuckNorris+Plugin"> Chuck Norris Plugin</a>, that you may or may not want to install. At the very least you'll need at least one Hudson plugin to be able to run vnc so that the Flash Player can redirect its output. Download the <a title="Download Xvnc plugin for Hudson" href="http://hudson-ci.org/latest/xvnc.hpi">Xvnc plugin</a> to your local machine.  Navigate to the Advanced panel of the Hudson plugin manager by going to the following URL:</p>
<p><em>http://&lt;some-ec2-id&gt;.compute-1.amazonaws.com:8080/hudson/pluginManager/advanced</em></p>
<p>Upload the plugin using the <em>Upload Plugin</em> section of the plugin manager. Once both plugins are uploaded you'll need to restart Hudson. Navigate to the Tomcat manager again</p>
<p><em>http://&lt;some-ec2-id&gt;.compute-1.amazonaws.com:8080/manager/html</em></p>
<p>Find Hudson in the list of web apps again and click <em>Reload </em>button to the right under the <em>Commands</em> column. Once this has completed, verify that the plugins have been installed by navigating to:</p>
<p><em>http://&lt;some-ec2-id&gt;.compute-1.amazonaws.com:8080/hudson/pluginManager/installed</em></p>
<p>You should now see the Git and Xvnc plugins listed.</p>
<p><strong>Configure the Flash Player Debugger</strong><br />
I know this seems like a lot, but we're almost there. Time to configure the Flash Player debugger. First we'll need to extract the debugger from the Flex SDK. Make sure you switch back to the root user if you haven't already. Type the following commands:</p>
<p><em># cd /sdk/flex-4.1/runtimes/player/10.1/lnx<br />
# tar -xvf flashplayerdebugger.tar.gz </em></p>
<p>Now that the debugger has been extracted you you'll need to create a a symbolic link to it named <em>gflashplayer</em>.  To create the link type the following commands:</p>
<p># cd /usr/sbin<br />
# ln -s /sdk/flex-4.1/runtimes/player/10.1/lnx/flashplayerdebugger gflashplayer</p>
<p>Now, in order for the Flash Player debugger to "trust" our unit test SWF(s), we have to create the "would-be" folder that the normal Flash Player security settings would be stored in. Create the following folder tree:</p>
<p><em>/home/tomcat/.macromedia/Flash_Player/#Security/FlashPlayerTrust</em></p>
<p><strong>Configure VNC<br />
<span style="font-weight: normal;">Now, the last thing to do is to configure the VNC server for the tomcat user and ensure that its using GNOME as its window manager. Lets first configure the vnc server for the tomcat user. Make sure you're the root user and open the vnc server config file by typing the following:</span></strong></p>
<p><em># vi /etc/sysconfig/vncservers </em></p>
<p>Now you'll need to add a server for the tomcat user. Do this by performing the following steps:</p>
<ol>
<li>Move the cursor below all the comments.</li>
<li>Press the letter <em>i </em>on your keyboard to enter insert mode.</li>
<li>Enter the following text:<em>VNCSERVERS="1:tomcat"<br />
VNCSERVERARGS[1]="-geometry 1024x769 -depth 16"<br />
</em></li>
<li>Press <em>escape </em> to exit insert mode.</li>
<li>Type the following to save and quit the text editor<br />
<em>:wq&lt;enter&gt;</em></li>
</ol>
<p><em><span style="font-style: normal;">Now that this is done, you'll need to set the tomcat user's vnc password. Type the following:</span></em></p>
<p><em># su tomcat<br />
# vncpasswd</em></p>
<p><em><span style="font-style: normal;">Set the password to whatever you like. Just remember this if you ever want to connect through a VNC viewer! The next thing to do is configure the tomcat user to use GNOME instead of the default window manager. To do this open the tomcat user's vnc configuration file by typing the following:</span></em></p>
<p><em># vi /home/tomcat/.vnc/xstartup</em></p>
<p>By now you should know how to edit a text file, so make it look like the following:</p>
<p><em>#!/bin/sh<br />
# Uncomment the following two lines for normal desktop:<br />
unset SESSION_MANAGER<br />
exec /etc/X11/xinit/xinitrc<br />
[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<br />
[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<br />
#xsetroot -solid grey<br />
#vncconfig -iconic &amp;<br />
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;<br />
#twm<br />
&amp;startx &amp;</em></p>
<p><em><span style="font-style: normal;">Save and quit the text editor. Lastly, start the vnc server by typing the following command:</span></em></p>
<p><em># service vncserver start</em></p>
<p>Now guess what? You're done installing and configuring everything! Woohoo!</p>
<p><strong>Wrap Up</strong></p>
<p>After all that work you should now have your CI server up and running. The only thing left to do is add the project to Hudson so that it can start building it. I'll explain how to do this in <a title="Using Hudson" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-using-hudson/">the following section</a>. For now, go grab yourself a well deserved beverage or snack.</p>
<p><em>Series Index</em></p>
<ol>
<li><a title="What is CI?" href="http://blog.nobien.net/2010/07/18/practicing-continuous-integration-on-flash-projects-what-is-ci/">What is CI?</a></li>
<li><a title="Project Structure" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-project-structure/">Project Structure</a></li>
<li><a title="Automation" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-automation/">Automation</a></li>
<li><a title="Integration Server Setup" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-integration-server-setup/">Integration Server Setup</a></li>
<li><a title="Using Hudson" href="http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-using-hudson/">Using Hudson</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2010/07/19/practicing-continuous-integration-on-flash-projects-integration-server-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

