summaryrefslogtreecommitdiff
path: root/elements/os-svc-install
diff options
context:
space:
mode:
authorJon-Paul Sullivan <jonpaul.sullivan@hp.com>2014-03-12 19:47:41 +0000
committerJon-Paul Sullivan <jonpaul.sullivan@hp.com>2014-03-25 12:22:59 +0000
commit1c998eb93f6938c10a546c9daf15b5bd109e9198 (patch)
tree2aaf75db4237c134a5e9b00a63b19a455a5b7fd8 /elements/os-svc-install
parentd6d087e3a1058d9ee5e0b9b7f156f721e0fadb98 (diff)
Create pip manifest files of installed packages
Create the pip-manifest element to encapsulate the saving and use of pip manifest files. Ensure that it installs prior to any elements that should be able to use it. Write pip manifest files for installs in: * os-svc-install * os-apply-config * os-collect-config * os-refresh-config * openstack-clients Enable using a manifest file to reinstall exact versions of packages in a subsequent run through the DIB_PIP_MANIFEST_* environment variables. Change-Id: I4d4ab5921c534727b48cb9969ec8ecfd2c26e6ed
Notes
Notes (review): Verified+2: Jenkins Approved+1: Clint "SpamapS" Byrum <clint@ubuntu.com> Code-Review+2: Clint "SpamapS" Byrum <clint@ubuntu.com> Submitted-by: Jenkins Submitted-at: Wed, 26 Mar 2014 03:12:48 +0000 Reviewed-on: https://review.openstack.org/80644 Project: openstack/tripleo-image-elements Branch: refs/heads/master
Diffstat (limited to 'elements/os-svc-install')
-rwxr-xr-xelements/os-svc-install/bin/os-svc-install46
-rw-r--r--elements/os-svc-install/element-deps1
2 files changed, 29 insertions, 18 deletions
diff --git a/elements/os-svc-install/bin/os-svc-install b/elements/os-svc-install/bin/os-svc-install
index b6ab2d9..df74d16 100755
--- a/elements/os-svc-install/bin/os-svc-install
+++ b/elements/os-svc-install/bin/os-svc-install
@@ -5,6 +5,8 @@ function python_install() {
5 local svc_root=$1 5 local svc_root=$1
6 local install_dir=$2 6 local install_dir=$2
7 local system_site_packages=${3:-"False"} 7 local system_site_packages=${3:-"False"}
8 local name=$(basename $install_dir)
9 local svc_manifest=$(get-pip-manifest $name)
8 10
9 SITE_PCKGS="--no-site-packages" 11 SITE_PCKGS="--no-site-packages"
10 if [ $system_site_packages == "True" ]; then 12 if [ $system_site_packages == "True" ]; then
@@ -17,31 +19,39 @@ function python_install() {
17 source $install_dir/bin/activate 19 source $install_dir/bin/activate
18 set -u 20 set -u
19 21
20 if [ -e $svc_root/requirements.txt ]; then 22 # If given an exact deps list, use it, and upgrade to the local git service
21 reqs=$svc_root/requirements.txt 23 if [ -n "$svc_manifest" ]; then
22 elif [ -e $svc_root/tools/pip-requires ]; then 24 use-pip-manifest $svc_manifest
23 reqs=$svc_root/tools/pip-requires
24 else 25 else
25 reqs="" 26 if [ -e $svc_root/requirements.txt ]; then
26 fi 27 reqs=$svc_root/requirements.txt
28 elif [ -e $svc_root/tools/pip-requires ]; then
29 reqs=$svc_root/tools/pip-requires
30 else
31 reqs=""
32 fi
27 33
28 # bug #1201253 : virtualenv-1.10.1 embeds setuptools-0.9.8, which 34 # bug #1201253 : virtualenv-1.10.1 embeds setuptools-0.9.8, which
29 # doesn't manage correctly HTTPS sockets when downloading pbr from 35 # doesn't manage correctly HTTPS sockets when downloading pbr from
30 # https://pypi.python.org/simple/ if using http_proxy and 36 # https://pypi.python.org/simple/ if using http_proxy and
31 # https_proxy envvars 37 # https_proxy envvars
32 pip install -U 'setuptools>=1.0' 38 pip install -U 'setuptools>=1.0'
33 39
34 # bug #1293812 : Avoid easy_install triggering on pbr. 40 # bug #1293812 : Avoid easy_install triggering on pbr.
35 pip install -U 'pbr>=0.5.21,<1.0' 41 pip install -U 'pbr>=0.5.21,<1.0'
36 42
37 if [ -n "$reqs" ] ; then 43 if [ -n "$reqs" ] ; then
38 pip install -r $reqs 44 pip install -r $reqs
39 # FIXME: pip requires doesn't include MySQL-python 45 # FIXME: pip requires doesn't include MySQL-python
40 pip install MySQL-python 46 pip install MySQL-python
47 fi
41 fi 48 fi
42 49 # Always replay this, as we cannot use the entry this would generate in the manifest
43 pip install $svc_root 50 pip install $svc_root
44 51
52 # Write the manifest of what was installed
53 write-pip-manifest $name
54
45 set +u 55 set +u
46 deactivate 56 deactivate
47 set -u 57 set -u
diff --git a/elements/os-svc-install/element-deps b/elements/os-svc-install/element-deps
index 7c8922a..9770f9b 100644
--- a/elements/os-svc-install/element-deps
+++ b/elements/os-svc-install/element-deps
@@ -1 +1,2 @@
1pip-and-virtualenv 1pip-and-virtualenv
2pip-manifest