Use a venv to build the python wheels

To limit the python packages installed on the host,
all packages installed by pip are implemented into
a venv.

While many of the repo_pip_packages may be available
via distribution packages, the versions vary wildly.
We therefore opt to use a venv instead to keep things
simple.

This reduces the requirement on the host to *only*
require the virtualenv package which is installed in
the openstack_hosts role.

The 'virtualenv' package is removed from the list as
it is not used.

Change-Id: I0619f51960e23756df7010d476d70f55ceda8441
This commit is contained in:
Jesse Pretorius 2018-08-07 21:51:09 +01:00
parent c7bbca5f77
commit d7acac1b99
3 changed files with 12 additions and 3 deletions

View File

@ -112,12 +112,15 @@ repo_build_venv_command_options: >-
--no-setuptools
--no-wheel
# Path to the repo build venv binaries
repo_build_bin: "/openstack/venvs/repo-build-{{ repo_build_release_tag }}/bin"
# Python packages to install into the repo build venv
repo_pip_packages:
- cython
- pbr
- requests
- urllib3
- virtualenv
- wheel
repo_build_store_pip_sources: false

View File

@ -102,6 +102,8 @@
pip:
name: "{{ repo_pip_packages }}"
state: "{{ repo_build_pip_package_state }}"
virtualenv: "{{ repo_build_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
--constraint {{ repo_build_release_path }}/requirements_constraints.txt
{{ pip_install_options }}
@ -114,6 +116,8 @@
pip:
name: "{{ repo_pip_packages }}"
state: "{{ repo_build_pip_package_state }}"
virtualenv: "{{ repo_build_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
--index-url {{ repo_build_pip_default_index }}
--trusted-host {{ repo_build_pip_default_index | netloc_no_port }}

View File

@ -41,7 +41,8 @@
- name: Download requirement pip sources
shell: >-
set -o pipefail;
yes i | pip install --timeout {{ repo_build_timeout }}
yes i | {{ repo_build_bin }}/pip install
--timeout {{ repo_build_timeout }}
--download {{ repo_build_output }}
--no-binary :all:
--constraint {{ repo_build_release_path }}/requirements_constraints.txt
@ -61,7 +62,8 @@
- name: Create OpenStack-Ansible requirement wheels
shell: >-
set -o pipefail;
pip wheel --timeout {{ repo_build_timeout }}
{{ repo_build_bin }}/pip wheel
--timeout {{ repo_build_timeout }}
--wheel-dir {{ repo_build_output }}
--find-links {{ repo_build_global_links_path }}
--find-links {{ repo_build_output }}