Browse Source

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
Thippaiah, Balachandra (bt061u) 5 months ago
parent
commit
88df24b24d
4 changed files with 7 additions and 4 deletions
  1. 1
    0
      Dockerfile
  2. 2
    0
      README.md
  3. 3
    3
      scripts/requirements.sh
  4. 1
    1
      scripts/setup_pip.sh

+ 1
- 0
Dockerfile View File

@@ -10,6 +10,7 @@ ARG DISTRO
10 10
 ARG PROFILES
11 11
 ARG PIP_PACKAGES=""
12 12
 ARG PIP_ARGS=""
13
+ARG PIP_WHEEL_ARGS=$PIP_ARGS
13 14
 ARG DIST_PACKAGES=""
14 15
 ARG PLUGIN=no
15 16
 ARG PYTHON3=no

+ 2
- 0
README.md View File

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

+ 3
- 3
scripts/requirements.sh View File

@@ -3,7 +3,7 @@
3 3
 set -eux
4 4
 
5 5
 $(dirname $0)/setup_pip.sh
6
-pip install bindep
6
+pip install ${PIP_ARGS} bindep
7 7
 
8 8
 $(dirname $0)/install_packages.sh
9 9
 $(dirname $0)/clone_project.sh
@@ -41,11 +41,11 @@ egrep -v "(scipy|scikit-learn)" /upper-constraints.txt | split -l1
41 41
 # This allows to work around such issues as
42 42
 #   https://github.com/lxc/pylxd/issues/308
43 43
 if [ ! -z "${PIP_PACKAGES}" ]; then
44
-  pip install -c /upper-constraints.txt ${PIP_PACKAGES}
44
+  pip install ${PIP_ARGS} -c /upper-constraints.txt ${PIP_PACKAGES}
45 45
 fi
46 46
 
47 47
 echo uwsgi enum-compat ${PIP_PACKAGES} | xargs -n1 | split -l1 -a3
48
-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
48
+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
49 49
 
50 50
 # TODO: Improve the failure catching
51 51
 if [[ -f /failure ]]; then

+ 1
- 1
scripts/setup_pip.sh View File

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

Loading…
Cancel
Save