From 88df24b24d4bf3683ca75fbee0e8561c1418b12b Mon Sep 17 00:00:00 2001 From: "Thippaiah, Balachandra (bt061u)" Date: Tue, 6 Nov 2018 03:32:02 -0500 Subject: [PATCH] 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 --- Dockerfile | 1 + README.md | 2 ++ scripts/requirements.sh | 6 +++--- scripts/setup_pip.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b151e4b..3d8faf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index 4dc5d15..f6ae574 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/scripts/requirements.sh b/scripts/requirements.sh index 0e2074b..452f27b 100755 --- a/scripts/requirements.sh +++ b/scripts/requirements.sh @@ -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 diff --git a/scripts/setup_pip.sh b/scripts/setup_pip.sh index a5acf5b..77eceda 100755 --- a/scripts/setup_pip.sh +++ b/scripts/setup_pip.sh @@ -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