3 ms·
The way I deploy Python apps at $EMPLOYER: - CI system detects a commit and checks out the latest code - CI system makes a virtualenv and sets up the project
by thristian 11y ago
The way I deploy Python apps at $EMPLOYER:
- CI system detects a commit and checks out the latest code
- CI system makes a virtualenv and sets up the project and its dependencies into it with "pip install --editable path/to/checkout"
- CI system runs tests, computes coverage, etc.
- CI system makes a output directory and populates it with "pip wheel --wheel-dir path/to/output path/to/checkout"
- Deployment system downloads wheels to a temporary location
- Deployment system makes a virtualenv in the right location
- Deployment system populates virtualenv with "pip install --no-deps path/to/temp/location/*.whl"
The target node only needs a compatible build of python and the virtualenv package installed; it doesn't need a compiler and only needs a network connection if you want to transfer wheel files that way.
- falcolas 11y agoThe way I deploy Go apps at $EMPLOYER2: - go get - go test - go build - copy to target It's possible with Python, it's easier with Go. It's a place where we could use a lot of progress.
- nulltype 11y agoIt seems weird how you can't easily package python into an executable without Docker.
- falcolas 11y agoYou can with various levels of success with a few "freeze" programs. They basically bundle up the entire environment into an executable, so the executables are stupidly large (more-or-less the size of your /usr/lib/python directory plus the python binaries), but they mostly work.
- nulltype 11y agoI've done it before, but it was kind of a pain and I got the impression nobody else used that stuff. I wonder why it's not more popular/easy.
- bpicolo 11y agohttp://nuitka.net/ http://nuitka.net/
- twic 11y agoPresumably, though, what both of you actually do is: build.sh Once you'd done the up-front work of figuring out how to do deployment sanely, it became equally easy for both of you.
- SEJeff 11y agoYou really should look at Armin's (same guy who wrote Flask and Jinja2) platter tool. It takes a few of the steps out and for an almost identical workflow as you, we are switching to it. http://platter.pocoo.org/dev/ http://platter.pocoo.org/dev/ Really nice stuff
- thristian 11y agoActually, that's where I got the idea... but when I last looked at Platter it was covered in "experimental only, do not use in production warnings". Considering I'd have to write a build script to use Platter, it didn't seem like it would be a lot of work to write a few extra lines and not require an additional dependency.