Faster Web Development With Virtual Machines at deviantART
dt.deviantart.com
dt.deviantart.com
If anyone is looking for an easy, low-risk, documented method of beginning development in VMs, check out Vagrant[1], which is what I wrote this for. Creating dev VMs from scratch is pretty tedious and there are a lot of steps involved. Vagrant abstracts this away and provides a tool to automate all of this in a reproducible manner.
[1]: http://vagrantup.com
I see that is has a plug in system for other provision systems like Puppet, but the chef support works great out of the box.
I was hoping to contribute to the project by integrating fog the ruby library which talks to many cloud systems including EC2 so someone could build an image via Chef or Puppet, dev and test in their image, then provision and upload to the cloud. Could probably do this without integrating with vagrant by building a clever rake or capistrano script.
Its a great solution, but I much prefer working with RoR or Python/Django where recreating the server environment locally is much easier.
Every language should have something as simple as these. Heck, it should be part of the OS, IMO; why I can't (easily) run two different versions of Firefox with two different profiles at the same time is beyond comprehension.
Unless there's some serious increases in clock speeds, I'm not sure doing it for every language is worth it. As it is, VMs are a great, general purpose system that are easy to set up, use, and replicate.
* Install your different Firefox versions in different locations (so one doesn't overwrite the other)
* Use "firefox -ProfileManager" to create at least one different 'profile', which is Firefox's user data set
* Use "firefox -P <profilename> -no-remote" to launch Firefox. -no-remote allows multiple Firefox instances to run on the same machine. -P profilename is necessary because you need a separate profile for each running instance.
More info at http://kb.mozillazine.org/Command_line_arguments
Still; mindboggling. Different version = different binary launched, which accesses a different and non-locked profile. Why the hell does it instead open a new window of the currently-running version?
As a heads-up to anyone considering this: Sync doesn't (currently) like multiple versions. 3.6.10 won't sync now that I've hooked up some 4 betas.
RVM is just great and simple.
What I’m trying to say though: Having done quite some side projects with node, the ruby stuff suddenly feels very enterprisey to me. More and more conventions might make it harder to keep track of everything in the future.
I've been developing locally for years and while I can't mimic the exact hardware of the live server, I wouldn't be able to do that regardless of stack I chose.
We used to develop historious like this, until we switched to redis/celery. Then it became too much hassle to install these in every machine, plus we wanted to test on the db we used (postgres) rather than sqlite, so we made a VM and now everything's dandy.
As others have mentioned, you make a bold claim, yet fail to give anything concrete as proof that it is "much easier".
Developing against a VM is not something I did before working at Rackspace, and I find the practice so useful that I will do what I can to continue doing it no matter where I work in the future.
I'm amazed at the level of sophistication in this setup - using virtual machines and TCP proxies that do text replaces seems too much. They could have just built the configurability in the damn application. I have a .NET app that normally gets deployed on three servers and uses various remote resources like Amazon SQS queues, but I easily built a configuration abstraction similar to Rails' environments that lets me deploy on a single machine and even test locally with a debugger attached.
My point is that this problem looks as if it got solved at the wrong level of abstraction. Which, obviously, made it unnecessarily hard and complex. If I had to tackle it, I'd make sure developers do the right thing and try to make the app configurable enough first.
Let me ask another question: Will it become feasible to move code, tools and everything else into web services? Imagine you have your favorite editor (emacs, TM, vim) running in a browser window. Only that it’s live-updating like, e.g., Ethercodes or Wave. And you have very straight-forward access to SCM features like staging hunks of code. Also the code deploys straight to heroku or whatever. It could, of course, also go through closure or sproutcore in case of a fancy js client app.
Do you think it’ll all evaporate (I refuse to say cloud :) eventually?
The thing is I’m really going through a lot of pain setting up my system and other’s systems over and over again. Yes, there are ways to automate that but the effort is too high for most or we would all be doing it right now.
Also, parenthesis mismatch in paragraph 3.
Now this doesn't even take into account things like memcached that require a lot more customization.
I wish I had thought of this when we ran into issues with Windows people and Ruby. Too much of their time was spent fussing with stuff and crying about it. :)
-“I’m getting an error”
“Which error?”
-“Unnamed method in [...]”
Then, a mountain of pain and torture later.
"But now it works, ok?”
-“Ok.”
---
Ever had to fix someone else’s system via Skype or phone? I personally believe writing a rails clone in brainfuck is more fun.
It's unlikely that your server is the same os as your desktop. So you waste time setting up versions of libraries and services for e.g. windows that don't always work quite the same as in production. Plus you can also take advantage of snapshots to mess around with your local vm, confident that you can always roll back to a known version. You can do simplified load testing without actually crashing your whole machine.
It also means your devs can use whatever OS they want - the hard work of setting up a dev environment is already done.
These things all have to be dealt with and should not be thrown over the wall and "let the sysadmin deal with it." That's where the value of the OS and infrastructure is a set of code and config files which are kept in source control next to our code and versioned with it is so valuable. Run "vagrant up" and a fresh consistant build every time. Then develop in php, python, perl, ruby or brainfuck if you want.
Of course, even if you're running a modern web framework in Ruby/Python/somethingtrendy, a VM makes a lot of sense. It lets you run the exact versions of everything that your production environment is, without having to worry about it.
Anyway, VMs are cool but has anyone tried developing with NixOS? It seems even more suited for the tasks they want since it has rollbacks and so on: http://nixos.org/
The problem I am running into now is that our production environment is starting to get complicated enough(mysql, redis, 2 different django projects) that testing all the components working together gets more and more difficult all the time.
Once you have your env scripted with EC2 you can setup / teardown environments easily for testing.
Edit: I think it's an awesome idea, btw, and something we try to push to web service shops at GridCentric.
Local development doesn't scale.