Looking for advice on how to use Vagrant for a student dev environment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for advice on how to use Vagrant for a student dev environment

Jimmy Cuadra
Greetings everyone,

I'm in the planning stages for a software development education site called Querycasts. It will provide video lessons on web development and general programming for people with little to no experience. I want to provide the students with a development environment via Vagrant so I won't have to worry about what OS the student is running and to minimze the amount of setup they have to do to get started. While I will be teaching some UNIX and systems configuration at some point, at the start I want them to have an environment that "just works" for making static websites, and probably running Ruby programs. I am calling this box the "lab." Each lesson on the site will have an associated "homework" project with a Vagrantfile that uses the lab as its box.

I've been fiddling around with building such a box for the students, but I'm kind of torn on how best to balance these priorities:

1. Minimal set up and waiting time when the student boots the VM
2. Easy to change the environment over time, as the requirements for lessons change
3. Smallest file size for the "lab" box

I started with the approach of setting up a packaged box (based on Opscode's Ubuntu 12.04 base box and provisioned with Chef Solo) that installs everything I expect the students to need in the foreseeable future. This includes Git, Ruby, Nginx, Postgres, Mongo, Redis, Node.js, etc. All of these things resulted in a packaged box of 1.3 GB, which is not reasonable to ask a new student to download just to get started.

I started to think that maybe I shouldn't package so much software on the lab, and wait to see what I'm really going to need as the lessons are created. (Ya ain't gonna need it.) I tried removing most of those packages except for those needed for static websites, but the packaged box was still 700 MB.

Now I'm starting to think that it might be better for the "lab" box to be as bare bones as possible, and install only what is needed for a given project via its Vagrantfile and Chef Solo provisioning. The down side to this is the potentially very long time the student will have to wait for the initial VM building on each project. I don't want students to have to sit through Ruby compiling for every single lesson, for example.

If I use a model where the student uses the exact same VM for each project so that they don't have to wait for the lab to be provisioned every time, I'm not sure what the best way of updating the lab over time would be. Releasing a new base box? Changing what is provisioned in each project's Vagrantfile? Leaving the Vagrantfile alone and using a remote URL for cookbooks?

Any advice on how to proceed is greatly appreciated.

Thanks in advance,
Jimmy

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Looking for advice on how to use Vagrant for a student dev environment

Simon McCartney
> I started with the approach of setting up a packaged box (based on Opscode's Ubuntu 12.04 base box and provisioned with Chef Solo) that installs everything I expect the students to need in the foreseeable future. This includes Git, Ruby, Nginx, Postgres, Mongo, Redis, Node.js, etc. All of these things resulted in a packaged box of 1.3 GB, which is not reasonable to ask a new student to download just to get started.
>
> I started to think that maybe I shouldn't package so much software on the lab, and wait to see what I'm really going to need as the lessons are created. (Ya ain't gonna need it.) I tried removing most of those packages except for those needed for static websites, but the packaged box was still 700 MB.

If you want a really small starting point, you'll have to layer stuff on top as you go, my suggestion would be:

1st Practical
Students "git clone somewhere.com:projectworkspace.git", this includes a bare Vagrantfile that uses a small Ubuntu image (like http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box from http://www.vagrantbox.es/ - 258Mb)
vagrant up
vagrant ssh / putty etc

before the 2nd practical, you update the git repo with any additions required items, i.e. using chef-solo to install nginx

2nd practical
git pull
vagrant provision (vagrant destroy ; vagrant up if it all goes horribly wrong)

before the 3rd practical, add the next components (ruby?)

3rd practical
git pull
vagrant provision

repeat etc

The student only has to suffer the ruby compile once, unless they need to destroy the box (also, ruby compile?  why?  use packages, make life easier for yourself!!)


> Now I'm starting to think that it might be better for the "lab" box to be as bare bones as possible, and install only what is needed for a given project via its Vagrantfile and Chef Solo provisioning. The down side to this is the potentially very long time the student will have to wait for the initial VM building on each project. I don't want students to have to sit through Ruby compiling for every single lesson, for example.

They shouldn't have to sit through ruby compiling at all, or once if you insist ;-) unless something goes horribly wrong.  Set the lab setup as a task to start 30min before class?

> If I use a model where the student uses the exact same VM for each project so that they don't have to wait for the lab to be provisioned every time, I'm not sure what the best way of updating the lab over time would be. Releasing a new base box? Changing what is provisioned in each project's Vagrantfile? Leaving the Vagrantfile alone and using a remote URL for cookbooks?
>

I'd go for changing the Vagrantfile as outlined above, updating the base box is more fragile IMHO, and the student ends up with a 500Mb+ download ever class.

HTH,

Simon.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.