Before I start.. I did a bit of tidying up in couple of related files too (see fist commit, if you want to see those changes separate).
I also changed some of the logic behind installing MySQL vs PostgreSQL packages.. That was a big headache to get right.
The idea is this:
Pin all python dependencies/packages to the exact version running in production right now.
The way I did it was:
Go to production servers, and run pip freeze in the virtualenv running wasa2il.
Take that list, and put into requirements.txt.freeze. Since prod is using mysql, I took the mysql dependency and put it into requirements-mysql.txt.freeze.
Changed the make setup (well, the requirements targets) so they use the .freeze files to install dependencies. This makes it so that anyone checking out the project will install exactly the requirements that are on prod.
Added couple of targets to help updating/managing these requirements.
Tidied up requirements.txt, adding some commentary. This file ought be managed by humans.
The end result is:
Slightly tweaked Makefile
Updated requirements.txt
New .freeze files that contain the actual packages to be installed.
The final change to the prod server should be:
None at all!
After merging this, I'll copy the prod virtualenv, and then try make setup, to verify that nothing is installed, and nothing changes (pip doesn't have --dry-run option).
Testing
Tested pretty rigorously on my local machine (archlinux on Thinkpad), but also created the 2 vagrant boxes found in the vagrants/ directory, and they also came up fine.
Future work:
Actually start to update some packages.
Look into fully deprecating support for PostgreSQL (if we don't need it, don't support it!).
Look into defaulting to MySQL (but allow SQLite for local development). This would still force developers to install some MySQL system packages to support the python MySQL client library installation.
Look into converting to a more mature package system
Phew.. this one is a bit tricky.
Before I start.. I did a bit of tidying up in couple of related files too (see fist commit, if you want to see those changes separate).
I also changed some of the logic behind installing MySQL vs PostgreSQL packages.. That was a big headache to get right.
The idea is this:
Pin all python dependencies/packages to the exact version running in production right now.
The way I did it was:
pip freeze
in the virtualenv running wasa2il.requirements.txt.freeze
. Since prod is using mysql, I took the mysql dependency and put it intorequirements-mysql.txt.freeze
.make setup
(well, the requirements targets) so they use the.freeze
files to install dependencies. This makes it so that anyone checking out the project will install exactly the requirements that are on prod.requirements.txt
, adding some commentary. This file ought be managed by humans.The end result is:
.freeze
files that contain the actual packages to be installed.The final change to the prod server should be:
After merging this, I'll copy the prod virtualenv, and then try
make setup
, to verify that nothing is installed, and nothing changes (pip doesn't have--dry-run
option).Testing
Tested pretty rigorously on my local machine (archlinux on Thinkpad), but also created the 2 vagrant boxes found in the
vagrants/
directory, and they also came up fine.Future work: