[p2pu-dev] difficulty setting up p2pu development environment

Asheesh Laroia lists at asheesh.org
Sun Nov 11 03:04:00 UTC 2012


Excerpts from James Sheldon's message of Fri Nov 09 17:29:28 -0500 2012:
> This totally worked!  Thanks.
> 
> but then I didn't run it for a while, and the problem came back.   Perhaps
> there was a new version of the virtual machine installed in the interim?
> 
> Incidentally, if I design a course on my local installation, will it get
> wiped out when a new version of the software comes out?

FWIW, I hacked around that this way in the OpenHatch Vagrant 
configuration:

In manifests/classes/apt_get_update.pp

## This appears to be necessary for the lucid32 VM
## provided by vagrantup. Go figure.
class apt_get_update {
  exec { "apt-get update":
    command => "/usr/bin/apt-get update",
  }

  # Ensure apt-get update has been run before installing any packages
  Exec["apt-get update"] -> Package <| |>
}

And in manifests/squeeze.pp (also manifests/lucid32.pp):

# The classes that we 'include' are actually
# each defined in their own file. We must import
# them to have access to them.
import "classes/*"

stage { 'first': before => Stage['main'] }

class {
  'openhatch_dependencies': stage => first;
  'apt_get_update': stage => first
}

node default {
  include apt_get_update
  include openhatch_dependencies
  include openhatch_code
  include openhatch_database
}

I hope that can help you folks provide a more reliable experience for 
Vagrant users with P2PU's code.

Having said that, for the OpenHatch project, after trying Vagrant, I 
abandoned it with great enthusiasm, and just switched to bundling all 
our pure-Python dependencies in a vendor/ directory, and for the 
non-pure-Python dependencies, we use this hack:

https://github.com/openhatch/oh-mainline/blob/master/mysite/base/depends.py

Now the bring-up steps are extremely simple and reliable:

* git clone

* python manage.py syncdb --migrate

* python manager.py runserver

That's all there is to it. It is an extreme relief to me, as project 
maintainer, to know it's that easy to bring up an instance of our code 
for new contributors, and I strongly encourage you folks to do the same.

(For bundling dependencies, I use this as a baseline: 
http://fjord.readthedocs.org/en/latest/vendor.html . I see their docs 
have changed, so I should document our processes since they're slightly 
different.)

For people who need extra stuff that isn't vendor-able, we provide an 
"Advanced Installation" guide that tells them how to install the 
non-pure-Python dependencies (like PIL) on their system.

Yes, this is awful for a sense of code cleanliness, but think of how 
great it makes things for new contributors. So that's my two cents!

-- Asheesh.


More information about the p2pu-dev mailing list