Add PIP_WHEEL_ARGS and use PIP_ARGS for pip install

This ps adds new argument PIP_WHEEL_ARGS
 - allows additional parameters for pip wheel
 - defaults to PIP_ARGS
Also use PIP_ARGS with all pip installs

Useful when building requirements image with local pip mirrors

Change-Id: I43c6b921467150509d013554aaa1983f30abedff
This commit is contained in:
Thippaiah, Balachandra (bt061u) 2018-11-06 03:32:02 -05:00
parent d0ef425ef6
commit 88df24b24d
4 changed files with 7 additions and 4 deletions

View File

@ -10,6 +10,7 @@ ARG DISTRO
ARG PROFILES
ARG PIP_PACKAGES=""
ARG PIP_ARGS=""
ARG PIP_WHEEL_ARGS=$PIP_ARGS
ARG DIST_PACKAGES=""
ARG PLUGIN=no
ARG PYTHON3=no

View File

@ -86,6 +86,8 @@ For more advanced building you can use docker build arguments to define:
you wanted to include rpdb, you would need to have built that into your
WHEELS.
* `PIP_ARGS` Specify additional pip's parameters you would like.
* `PIP_WHEEL_ARGS` Specify additional pip's wheel parameters you would like.
Default is PIP_ARGS.
* `DIST_PACKAGES` Specify additional distribution packages you would like
installed.
* `EXTRA_BINDEP` Specify a bindep-* file to add in the container. It would

View File

@ -3,7 +3,7 @@
set -eux
$(dirname $0)/setup_pip.sh
pip install bindep
pip install ${PIP_ARGS} bindep
$(dirname $0)/install_packages.sh
$(dirname $0)/clone_project.sh
@ -41,11 +41,11 @@ egrep -v "(scipy|scikit-learn)" /upper-constraints.txt | split -l1
# This allows to work around such issues as
# https://github.com/lxc/pylxd/issues/308
if [ ! -z "${PIP_PACKAGES}" ]; then
pip install -c /upper-constraints.txt ${PIP_PACKAGES}
pip install ${PIP_ARGS} -c /upper-constraints.txt ${PIP_PACKAGES}
fi
echo uwsgi enum-compat ${PIP_PACKAGES} | xargs -n1 | split -l1 -a3
ls -1 | xargs -n1 -P20 -t bash -c 'pip wheel --no-deps --wheel-dir / -c /upper-constraints.txt -r $1 || echo %1 >> /failure' _ | tee /tmp/wheels.txt
ls -1 | xargs -n1 -P20 -t bash -c 'pip wheel ${PIP_WHEEL_ARGS} --no-deps --wheel-dir / -c /upper-constraints.txt -r $1 || echo %1 >> /failure' _ | tee /tmp/wheels.txt
# TODO: Improve the failure catching
if [[ -f /failure ]]; then

View File

@ -15,6 +15,6 @@ if (( $(${TMP_VIRTUALENV} --version | cut -d. -f1) >= 14 )); then
fi
${TMP_VIRTUALENV} --extra-search-dir=/tmp/wheels ${SETUPTOOLS} /tmp/venv
source /tmp/venv/bin/activate
pip install --upgrade virtualenv
pip install --upgrade ${PIP_ARGS} virtualenv
hash -r
virtualenv --extra-search-dir=/tmp/wheels /var/lib/openstack