Coding in the Cloud [practical fact or developer fiction]


For the last 12 months I have been intrigue with the idea of a development environment in the cloud.  There are some great posts out there detailing methodologies and the experiences of engineers whom have gone down this road.  The following is a short list of ones I have read and found useful:

I am somewhat of a polyglot engineer who started with a Spectrum ZX-81 and basic over 34 years ago,  C/C++ at university then moved into enterprise development (integrating heterogeneous systems) with Visual Basic,  ASP and SQL through to Java, .Net, JavaScript, Lisp, R, Ruby, Go Lang, Objective C for both enterprise, mobile and SaaS solutions.  Now my general day-to-day tool-chain is Ruby (web/general development) and recently Go Lang (system development).  Gone are days of building platform native GUI applications, replace with platform agnostic APIs leverage through JavaScript client applications; nothing new here.

For the last 20+ years I have been lugging a laptop around, starting with an Olivetti Echos P120c then, a beast of a Dell (4 KG), Apple TiBook,  IBM ThinkPad, 17" MBP ... finally ending up with a 2013 13" MacBook Air which is my current daily driver.  This IMHO, is almost the perfect developer laptop, lasts all day and the i7 with 8GB RAM chews up and spits out any tasks I throw at it.  The downside is hunting for WIFI hotspots (or tethering) while on the move

A little over a year ago I dumped my existing development editor (Sublime Text 3 Beta) which was/is a superb editor and moved to MacVim primarily after reading a blog post by the Infamous Yehuda Kata detailing how he approach the switch.  Vim is all about muscle memory, which sometimes drives me nuts, particularly when it comes to using other content creation apps, all I seem to end up with is 'hjklhjkl...', anyway lets not digress.

12 months later and I have my Vim environment finely tuned, leveraging essential plug-ins such as 'Unite, Vundle, NerdTree'  to name but a few.  When setting up Linux servers I generally deploy my Vim configuration allowing me to transition between local and server machines for editing configuration and deployment settings.

At home and the office, the coding-test-deployment cycle is a joy as fast, always on internet connections allowing me to be super productive and responsive.   I have gotten into the habit of closing OS X Mail, ignoring Skype and just getting on with the task at hand.

Recently work has required me to be on-site at key customer locations, where the WIFI connection is poor/unavailable hence have been depending on mobile data connections.  In these circumstances,  development on my MBA is fine, but deploying updates to UAT and production environments over a mobile connection can prove challenging and long winded,  particularly with large assets that have to be copied to multiple servers, and don't forget the data costs once you go over you monthly allowance.

Last week, after much deployment pain and data cost, I decided to purchase a VPS subscription from OVH to use as my primary coding environment.  Having recommended OVH to clients in the past (as they provide an excellent service with cost savings over the competition - BTW I am not on commission), I selected the VPS Classic 1 2GB Ram 2x virtual cores, a consistent 100 MBits connection would mean no more issues with deployments and @£5.09/month this becomes a cost no-brainer.

The VPS was configured with a standard 14.04 LTS image, 1 hour later after installing VIM, Postgres, RVM/Ruby, GIT, Dropbox (sync files between my MBA and VPS) I was up and running - well almost.  Next I needed a terminal multiplexer to replace my local use of iTerm, I settled on Tmux and tmuxinator which allows per project tmux session configuration.  Done or so I though !

One wrinkle was the reliability of SSH connections when changing networks (i.e switching from a Wifi hotspot to mobile connection and back again).  Constantly killing SSH client sessions is a waste of keystrokes.  After some further research I found mosh, a client/server terminal application that initiates a connection over SSH which spawns a server instance of the application,  the client then connects to the server over UDP 6001 - 6100 and the SSH connection is closed.  Mosh handles all aspects of maintaining the server connection (including client network address changes) while optimising data transmission (i.e. only transmitting screen deltas between server and client).  Now I just close my laptop, no need to worry about the SSH client hanging when I open the lid, it just works; but ...  alas I have not found an iOS compatible application, thus I am relying on SSH when using an iPad/iPhone (but this is where tmux really shines).

I am only a week into my new setup, roaming around with my MBA rather than just an iPad, but all work is done on my VPS.  Dropbox automatically syncs changes back to my MBA in case I of network loss, although I have to remember not to edit code in both places otherwise the local git branch indexes & change lists conflict and require manually editing.

Unlike the gradual move to Vim a year or so ago,  my move to the cloud for a full-blown development environment has been immediate (although I have a safety net with Dropbox syncing all changes between my VPS and MBA).

My next stage is to leave the MBA at home, although I am not convinced of the advantages of going iPad only as you still need to lug a keyboard around (mine is the Filco bluetooth Minila Air).  But the new iPhone 6 Plus hooked up to an external 1920x1020 monitor with a bluetooth keyboard is an interesting proposition I am keen to explore.

Setup of the VPS development environment was manual,  which I plan to automate in the future by leveraging Docker in combined with the OVH provisioning API making for a slick way to per-project development environments.

blog comments powered by Disqus