The first motivation to make it was because we have had to work in a private network with a very very slow internet access: for example updating a plone buildout could take more than one hour (just checking eggs freshness) when it should be no more than a few minutes. This condition also prevent to run some kind of rsync against pypi. So the obvious solution was to proxy the eggs we need, on-demand.
The module is installed as a handler on a Location. When accessing this location, eggproxy will serve an index similar to pypi simple view.
This is done like this:
- we already have the information in index.html: just let apache serve the file
- or, we use setuptools to fetch index information, build index.html, and let apache serve the file
Then easy_install can see a package is available on our server, and tries to fetch information on available eggs:
- the subdirectory and its index.html already exists: just let apache serve the file
- or, we use setuptools again to get package information, make the subdirectory (package name) and build index.html
Finally, when trying to fetch an egg we do the same:
- the file is already present and is served by apache
- or we use setuptools to get the file on the server
We have installed it here: http://release.ingeniweb.com/pypi.python.org-mirror
Known bugs: some packages on pypi don't have eggs, then eggproxy does not respond. This is the case with "reportlab" for example.
Enhancements:
- indexes aggregation. At ingeniweb we plan to install it on local server and agregate pypi and some private eggs indexes.
- Standalone/pluggable server. Currently we are bound to apache + mod_python, which may not suit to anyone.
1 comment:
eggproxy_update is not launched automatically every day, you need to add a crontab for this:
$ crontab -e
@daily /path/to/virtualenv/bin/eggproxy_update
^Save and quit
Post a Comment