3

There's a Python project I want to deploy on a production server which has no internet connection and no compiler. The project is using SQLAlchemy and pip install sqlalchemy requires a compiler to work.

The server is running a Debian stable version. Because Debian is what it is, packages are mainly outdated and using the system package manager is not an option.

I can create a local pip mirror and a build server with the same configuration than the production one (with a compiler). Note that I want to run the code from a virtualenv.
A Python virtualenv inserts absolute paths in files located in virtualenv/bin/ so if I wanted to create the virtualenv on the build server and copy it to the production server, I'd need to modify those files to update paths accordingly (which I try to avoid, even if making the modification is not really a big deal).

How should I package my application ? How the deployment is supposed to work, step by step ?

2
  • If I were in your shoes, I would be extremely tempted to just build a chroot environment that includes everything you need. Then just tar up the chroot, and drop it in a folder on the server, and add a startup script that runs the chroot.
    – Zoredache
    Jan 29, 2013 at 17:49
  • This questions is really useful to a lot of people, and you may find your answer at stackoverflow.com/a/13754897/565999 Jan 29, 2013 at 23:44

1 Answer 1

1

If virtualenv is the tool you want, you could check using the --relocatable option, though it may not work unless the two machines are mostly identical, possibly down to the dot version of Python:

virtualenv --relocatable ENV

Not the answer you're looking for? Browse other questions tagged .