
Python venvs are not particularly portable. To overcome this problem we have a bunch of stuff implemented to fix them after we unpack them. This ranges from relatively simple things like re-implementing python in the venv and changing the shebangs for everything in it, to more complex things like having to package a venv per distro/architecture. All of this can be eliminated by simplifying the mechanism into just creating the venv on the target host, and installing the python packages into it. To help speed up the build, we can simply build wheels before hand and store them on a web server somewhere. This patch implements the changes to: 1. Do away with packaging the venv. 2. Keep it simple. We install into the venv, and that's that. 3. Add a toggle to rebuild the venv if you'd like to. 4. Use import_tasks with tags for each stage so that it's easy to skip a portion of what executes. Change-Id: I708b5cf32e5cce6a18624d0b3be0cd4c828ad389
Team and repository tags
OpenStack-Ansible python_venv_build
This Ansible role prepares a python venv for use in OpenStack-Ansible.
The role requires the following to be present prior to execution:
- virtualenv >= 1.10 (to support using the never-download option)
- pip >= 7.1 (to support using the constraints option) in the virtualenv once it has been created.
Use-cases
This role is built to cater to the following use-cases:
- # Execute a build against a build host, then serve the venvs from a web
-
server.
- # Execute a build against the first host in a group, then serving the
-
venvs from the deployment host.
References
- Documentation for the project can be found at:
-
https://docs.openstack.org/openstack-ansible-python_venv_build/latest/
- The project home is at:
- Release notes for the project can be found at:
-
https://docs.openstack.org/releasenotes/ansible-role-python_venv_build/
Description
Languages
Python
72.5%
Shell
27.5%