This site is an archive; learn more about 8 years of OpenHatch.

[Devel] New way of building an OpenHatch development environment: please try it!

Vivek Shrivastava vivshrivastava at gmail.com
Fri Jul 8 16:52:23 UTC 2011


I think this is a great idea. We should put it somewhere in the wiki and
make it a live document in case someone faces any diffculty, they can update
it.. personally I experienced a lot, as any new committer I didn't have
development environment with all the necessary operating system and software
version. I started afresh with machines  from Amazon AWS and finally settled
with VMWare player, and I believe it will be experienced by anyone in future
also. So this will reduces the nightmares considerably.

       In future we can create whole echo system on a machine and let people
download and just run it with VMWare player or VirtualBox that probably let
them focus more on development than system administration..

      Thanks for initiating it...

Regards,

Vivek


On Tue, Jul 5, 2011 at 3:38 PM, Asheesh Laroia <asheesh at asheesh.org> wrote:

> I've been working on creating a virtual machine that sets up OpenHatch, so
> that it's easier for new contributors to get going. I'm succeeding, and I've
> gotten to the point where it's worthwhile for other people to look at it! I
> just pushed it to Gitorious.
>
> First, a quick glossary:
>
> puppet: a text-based language for describing the resources available on a
> machine
>
> vagrant: a program that manages virtual machines, with a particular eye to
> web app development. http://vagrantup.com/
>
> VirtualBox: A program that manages (and runs) virtual machines. Vagrant
> actually is a wrapper around VirtualBox.
>
> VM, aka "Virtual machine": A computer and operating system emulated within
> another computer.
>
> How to use Vagrant (and what it gives you)
> ------------------------------**------------
>
> If you have the latest version of the OpenHatch code, please do this:
>
> 0. Use git-clean to remove all unversioned files, or start with a fresh
> clone
>
> This is necessary because the the the VM and your main machine will have
> conflicting ideas about what to store in the eggs/ etc. directories.
>
> Run
>
>  git status
>
> to make sure there's nothing you want to keep. If that's true, run:
>
>  git clean -x -d -f
>
> BE CAREFUL! If you're unsure about running the above on your OpenHatch
> checkout, just do a fresh clone.
>
> 1. Install VirtualBox, if you don't already have it
>
> (On a Debian/Ubuntu system, just do: "sudo apt-get install virtualbox-ose")
>
> 2. Install RubyGems
>
> (On a Debian/Ubuntu system, just do: "sudo apt-get install rubygems")
>
> 3. Install Vagrant with 'gem':
>
>  sudo gem install vagrant
>
> 4. In the OpenHatch directory, run:
>
>  vagrant up
>
> This will (very slowly) create a VM that has OpenHatch installed.
>
> 5. To SSH into the VM you created, run:
>
>  vagrant ssh
>
> 6. To suspend the VM, for easy picking it up later:
>
>  vagrant suspend
>
> 7. To bring the VM back to life:
>
>  vagrant up
>
> 8. To destroy the VM, throwing away that operating system (you can always
> rebuild it later)
>
>  vagrant destroy
>
> The *really* neat thing is that you can still use "git" from your main
> machine -- the files are shared between the VM and your main machine. You
> can also use your regular old text editor; it's just the OpenHatch code
> *runs* in a VM.
>
> Why I like this
> ---------------
>
> Right now, if you run "buildout" and it fails on your system, you go onto
> IRC and see if you can find me, and then we'll both try really hard to debug
> an absurdly large complex stack of dependencies which normally operate great
> but routinely fail in random environments.
>
> Instead of that, you could just have a virtual machine that we know works.
> Assuming you have about 1GB of free disk space, this simplifies things
> dramatically.
>
> If you're familiar with the 'virtualenv' tool for isolating Python, this is
> the virtual environment to end all virtualenvs.
>
> Vagrant has the mindset of disposable virtual machines, which I really
> like. The virtual machine's configuration is laid down in Puppet manifests.
> This means, basically, that if whatever service you need is not described in
> the Puppet manifests, then you will lose it when you "destroy" then "up".
> This provides the necessary incentive to actually describe things in the
> Puppet manifest.
>
> I only added a few files to make this work:
>
> * Vagrantfile
> * puppet-provisioning-files/**manifests/squeeze.pp
> * puppet-provisioning-files/**manifests/classes/openhatch_**
> dependencies.pp
> * puppet-provisioning-files/**manifests/classes/openhatch_**code.pp
> * puppet-provisioning-files/**manifests/classes/apt_get_**update.pp
>
> What work remains to be done
> ----------------------------
>
> The Puppet configuration files should, really, be a bit longer. They are
> missing some crucial pieces:
>
> * Configure MySQL within the VM so that './bin/mysite' can connect to it
>
> * Setting up celery to run background tasks
>
> * Setting up cron to run periodic background tasks
>
> * Setting up Apache (maybe not necessary actually)
>
> * Configuring Django and buildout so that emails that the dev server sends
> out are logged to a directory.
>
> There are some niceties we could put in place:
>
> * Automatically download and import a data snapshot
>
> * Set up the bug tracker and wiki and forum (and any future apps) so that
> you have a very realistic simulation of the main server, and you can test
> out your patches to the services, too.
>
> Why this took me so long
> ------------------------
>
> (-:
>
> I hit a whole bunch of snags getting this far. For example:
>
> * Buildout would utterly fail on an Ubuntu virtual machine. Eventually I
> had the good idea of trying it on Debian, which works great. I spent a while
> yesterday banging my head against this.
>
> * My computer would periodically turn off with a message like this:
>
>  ERROR CRITICAL CPU TEMPERATURE 128 C SHUTTING DOWN
>
> and then it would turn off.
>
> What's next
> -----------
>
> I really want someone to try this and let me know what you think.
> Preferably multiple "someone"s!
>
> You (dear reader) might also find the Vagrant tutorial instructive. I sure
> did. http://vagrantup.com/docs/**getting-started/index.html<http://vagrantup.com/docs/getting-started/index.html>
>
> -- Asheesh.
>
> --
> Good day for a change of scene.  Repaper the bedroom wall.
> ______________________________**_________________
> Devel mailing list
> Devel at lists.openhatch.org
> http://lists.openhatch.org/**mailman/listinfo/devel<http://lists.openhatch.org/mailman/listinfo/devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openhatch.org/pipermail/devel/attachments/20110708/bcb326e8/attachment-0001.html>


More information about the Devel mailing list