Multiple dev environments on single machine

Soldato
Joined
18 Oct 2002
Posts
6,817
Location
Cambridge
Hi Linux guys :)

I would like to have multiple development environments on a single Linux machine, and I'd be interested in any thoughts, ideas or opinions on the best way to achieve this (or if it's even possible).

For example, I might have 2-3 live projects on the go in Node.js, Ruby on Rails, Go or other languages. I would like a way to, on a single server, be able to segregate these so that the prerequisites / dependencies of each stack don't interfere with one another.

I might also have a number of older projects that I have occasional work for, whereupon I'd like to be able to 'spin these up' / re-hydrate them in some way to allow me to do the work before then taking them down again.

Currently, I have a home server running ESXi and a load of full-fat VMs, one for each dev environment. However, I'd really like to move away from this and simply have a Linode (or similar) that I rent which I can silo my environments on. Security between environments (i.e. true segregation, firewalling etc.) is not really needed - I just want to avoid dependencies messing about with one another.

So far I've looked at Docker (which uses LXC) and BSD jails. Docker looks pretty good but I've had a lot of issues with networking on it, and I'm not 100% clear on how I'd actually use it for things other than longer-running processes (e.g. web servers). BSD jails look promising but not so geared towards maintainability, e.g. snapshotting, using base 'images' to build out new ones etc.

Sorry for the reams of text but I wanted to explain what I'm trying to do. I want something lightweight, robust, fairly easy to set up and ideally fast :) Thanks a lot for any thoughts.
 
Good suggestion, thanks. I looked at it a year or two back but it wasn't as mature then. I'll spend some time playing with it.

I notice there's also an LXC plugin for it which looks quite interesting :)
 
Well, yesterday I had a play with Vagrant using the LXC plugin I linked to in my post, and I managed to get something up and running in a local VM in about 30 minutes :) It looks very good; I particularly like the idea of describing the dev environment needed for a given project in terms of a Vagrantfile / bootstrap script and then committing that to source control so that at any point in future I can just rebuild the environment. It's also quick and seems pretty lightweight in terms of system resources.

I've hopefully got some Dart work starting in the next week or two so I might try out this approach with that. Thanks for all the suggestions and feedback :)
 
As a bit of an update:

I had a load of problems with network transfers being reset after 1-2MBs within my LXC containers, even after rebuilding the host and trying several different base builds, meaning that my build scripts were always failing. I tried quite a lot of things to solve this, including updating LXC, different host OSs, different guest OSs, unsupported builds of curl and OpenSSL, and even various dodgy proxies and other hackery.

In the end, though, I'm 99% sure I've narrowed it down to the ESXi host I'm running my lab on. This morning I've converted my base Ubuntu 13.10 LXC host VM to a VMware Fusion image, and all of my environment build scripts have magically started working with no network issues at all. I'm therefore pretty sure that there's something amiss with the networking on my ESXi host. That may also partly explain the ZFS pool rebuild I had to do late last night when I came home to find my NAS VM had exploded (ouch :()

I think I'll be tearing down my lab in the next week or two and hopefully replacing it with something simpler / more robust, and possibly easier to run remotely (e.g. in AWS or Linode if the fancy takes me). I've just been tapped for a PHP project at short notice so if that comes off I'll definitely be trying out the Vagrant / LXC approach with that.

If there's interest in all of this I might whack it on a blog at some point as I've learned quite a lot in the last few days, and sometimes the information out there has been out of date, or way too simple / way too advanced :)
 
Back
Top Bottom