From 76d1d8c4b4b65b5511ed14f6d688b53e0e7189e2 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Thu, 16 Jan 2014 22:38:44 +0100 Subject: [PATCH] Fix issues with grizzly - Install a known working recent version of pip (cherry-picked from 62d1d698a0c1459) - Don't install boto from pip let use the default from ubuntu or the euac2ools will fails. - Don't install netaddr from the packages let the pip do its job without being confused. - Skip excercises that fails on grizzly. Change-Id: I27df3787b5b90621ea66e4cc9763365b4579e3ca --- exercise.sh | 2 +- files/apts/general | 3 +- files/apts/horizon | 1 - files/apts/keystone | 1 - files/apts/nova | 2 - files/apts/quantum | 2 - files/apts/ryu | 1 - files/apts/swift | 1 - files/rpms-suse/general | 3 +- files/rpms-suse/horizon | 1 - files/rpms-suse/keystone | 2 - files/rpms-suse/nova | 2 - files/rpms-suse/quantum | 2 - files/rpms-suse/ryu | 2 - files/rpms-suse/swift | 2 - files/rpms/general | 3 +- files/rpms/horizon | 2 - files/rpms/keystone | 1 - files/rpms/nova | 2 - files/rpms/quantum | 2 - files/rpms/ryu | 1 - files/rpms/swift | 1 - stack.sh | 3 + tools/install_pip.sh | 118 +++++++++++++++++++++++++++++++++++++++ 24 files changed, 125 insertions(+), 35 deletions(-) create mode 100755 tools/install_pip.sh diff --git a/exercise.sh b/exercise.sh index ce694fba66..bdeca95954 100755 --- a/exercise.sh +++ b/exercise.sh @@ -15,7 +15,7 @@ source $TOP_DIR/stackrc # comma separated list of script basenames to skip # to refrain from exercising euca.sh use SKIP_EXERCISES=euca -SKIP_EXERCISES=${SKIP_EXERCISES:-""} +SKIP_EXERCISES=${SKIP_EXERCISES:-"boot_from_volume,bundle,euca"} # comma separated list of script basenames to run # to run only euca.sh use RUN_EXERCISES=euca diff --git a/files/apts/general b/files/apts/general index a1fcf3cb61..fcb42379e4 100644 --- a/files/apts/general +++ b/files/apts/general @@ -1,7 +1,7 @@ bridge-utils pep8 pylint -python-pip +python-setuptools screen unzip wget @@ -21,4 +21,3 @@ tcpdump euca2ools # only for testing client tar python-cmd2 # dist:precise -python-netaddr diff --git a/files/apts/horizon b/files/apts/horizon index 2c2faf1a21..d84d4c5fc5 100644 --- a/files/apts/horizon +++ b/files/apts/horizon @@ -22,4 +22,3 @@ python-cherrypy3 # why? python-migrate nodejs nodejs-legacy # dist:quantal -python-netaddr diff --git a/files/apts/keystone b/files/apts/keystone index c98409faaf..564921b78b 100644 --- a/files/apts/keystone +++ b/files/apts/keystone @@ -1,4 +1,3 @@ -python-setuptools python-dev python-lxml python-pastescript diff --git a/files/apts/nova b/files/apts/nova index f4615c41ce..d220583492 100644 --- a/files/apts/nova +++ b/files/apts/nova @@ -30,7 +30,6 @@ python-greenlet python-libvirt python-libxml2 python-routes -python-netaddr python-numpy # used by websockify for spice console python-pastedeploy python-eventlet @@ -41,7 +40,6 @@ python-sqlalchemy python-suds python-lockfile python-m2crypto -python-boto python-kombu python-feedparser python-iso8601 diff --git a/files/apts/quantum b/files/apts/quantum index 64fc1bfb2d..355392d9cc 100644 --- a/files/apts/quantum +++ b/files/apts/quantum @@ -4,12 +4,10 @@ iputils-ping iputils-arping mysql-server #NOPRIME sudo -python-boto python-iso8601 python-paste python-routes python-suds -python-netaddr python-pastedeploy python-greenlet python-kombu diff --git a/files/apts/ryu b/files/apts/ryu index 4a4fc523b5..e8ed926c1e 100644 --- a/files/apts/ryu +++ b/files/apts/ryu @@ -1,4 +1,3 @@ -python-setuptools python-gevent python-gflags python-netifaces diff --git a/files/apts/swift b/files/apts/swift index c52c68b765..31bc4d8b6b 100644 --- a/files/apts/swift +++ b/files/apts/swift @@ -9,7 +9,6 @@ python-greenlet python-netifaces python-nose python-pastedeploy -python-setuptools python-simplejson python-webob python-xattr diff --git a/files/rpms-suse/general b/files/rpms-suse/general index b8ceeb7aab..8dfa5a3d4e 100644 --- a/files/rpms-suse/general +++ b/files/rpms-suse/general @@ -7,9 +7,8 @@ openssh openssl psmisc python-cmd2 # dist:opensuse-12.3 -python-netaddr +python-setuptools python-pep8 -python-pip python-pylint python-unittest2 python-virtualenv diff --git a/files/rpms-suse/horizon b/files/rpms-suse/horizon index 7e46ffe0f7..feca5b229f 100644 --- a/files/rpms-suse/horizon +++ b/files/rpms-suse/horizon @@ -15,7 +15,6 @@ python-dateutil python-eventlet python-kombu python-mox -python-netaddr python-nose python-pep8 python-pylint diff --git a/files/rpms-suse/keystone b/files/rpms-suse/keystone index 7d9a7bfe9b..403d82f926 100644 --- a/files/rpms-suse/keystone +++ b/files/rpms-suse/keystone @@ -7,8 +7,6 @@ python-Routes python-SQLAlchemy python-WebOb python-devel -python-distribute -python-setuptools # instead of python-distribute; dist:sle11sp2 python-greenlet python-lxml python-mysql diff --git a/files/rpms-suse/nova b/files/rpms-suse/nova index 04af7f3110..0c57c41311 100644 --- a/files/rpms-suse/nova +++ b/files/rpms-suse/nova @@ -22,7 +22,6 @@ python-PasteDeploy python-Routes python-SQLAlchemy python-Tempita -python-boto python-carrot python-cheetah python-eventlet @@ -34,7 +33,6 @@ python-lockfile python-lxml # needed for glance which is needed for nova --- this shouldn't be here python-mox python-mysql -python-netaddr python-numpy # needed by websockify for spice console python-paramiko python-python-gflags diff --git a/files/rpms-suse/quantum b/files/rpms-suse/quantum index 068c15c22f..d7ced2601b 100644 --- a/files/rpms-suse/quantum +++ b/files/rpms-suse/quantum @@ -4,13 +4,11 @@ ebtables iptables iputils mysql-community-server # NOPRIME -python-boto python-eventlet python-greenlet python-iso8601 python-kombu python-mysql -python-netaddr python-Paste python-PasteDeploy python-pyudev diff --git a/files/rpms-suse/ryu b/files/rpms-suse/ryu index 90b43a47d9..3797b6cb44 100644 --- a/files/rpms-suse/ryu +++ b/files/rpms-suse/ryu @@ -1,5 +1,3 @@ -python-distribute -python-setuptools # instead of python-distribute; dist:sle11sp2 python-Sphinx python-gevent python-netifaces diff --git a/files/rpms-suse/swift b/files/rpms-suse/swift index db379bbcdf..f3c95aad98 100644 --- a/files/rpms-suse/swift +++ b/files/rpms-suse/swift @@ -6,8 +6,6 @@ python-WebOb python-configobj python-coverage python-devel -python-distribute -python-setuptools # instead of python-distribute; dist:sle11sp2 python-eventlet python-greenlet python-netifaces diff --git a/files/rpms/general b/files/rpms/general index fc3412ba4b..9d2c5bc778 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -6,9 +6,8 @@ openssh-server openssl psmisc pylint -python-netaddr python-pep8 -python-pip +python-setuptools python-unittest2 python-virtualenv screen diff --git a/files/rpms/horizon b/files/rpms/horizon index 12f75ba5a8..d1581756d2 100644 --- a/files/rpms/horizon +++ b/files/rpms/horizon @@ -6,7 +6,6 @@ mod_wsgi # NOPRIME pylint python-anyjson python-BeautifulSoup -python-boto python-coverage python-dateutil python-eventlet @@ -15,7 +14,6 @@ python-httplib2 python-kombu python-migrate python-mox -python-netaddr python-nose python-paste python-paste-deploy diff --git a/files/rpms/keystone b/files/rpms/keystone index 59868c7f2f..f5fa44ae61 100644 --- a/files/rpms/keystone +++ b/files/rpms/keystone @@ -4,7 +4,6 @@ python-paste python-paste-deploy python-paste-script python-routes -python-setuptools python-sqlalchemy python-sqlite2 python-webob diff --git a/files/rpms/nova b/files/rpms/nova index 7ff926b230..f0f3868fbd 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -15,7 +15,6 @@ numpy # needed by websockify for spice console m2crypto mysql-server # NOPRIME parted -python-boto python-carrot python-cheetah python-eventlet @@ -27,7 +26,6 @@ python-kombu python-lockfile python-migrate python-mox -python-netaddr python-paramiko python-paste python-paste-deploy diff --git a/files/rpms/quantum b/files/rpms/quantum index 05398fcf85..fd58c70395 100644 --- a/files/rpms/quantum +++ b/files/rpms/quantum @@ -4,12 +4,10 @@ ebtables iptables iputils mysql-server # NOPRIME -python-boto python-eventlet python-greenlet python-iso8601 python-kombu -python-netaddr python-paste python-paste-deploy python-qpid diff --git a/files/rpms/ryu b/files/rpms/ryu index 4a4fc523b5..e8ed926c1e 100644 --- a/files/rpms/ryu +++ b/files/rpms/ryu @@ -1,4 +1,3 @@ -python-setuptools python-gevent python-gflags python-netifaces diff --git a/files/rpms/swift b/files/rpms/swift index ce41ceb8e2..4e070116b9 100644 --- a/files/rpms/swift +++ b/files/rpms/swift @@ -9,7 +9,6 @@ python-greenlet python-netifaces python-nose python-paste-deploy -python-setuptools python-simplejson python-webob pyxattr diff --git a/stack.sh b/stack.sh index 8c92ea6cf9..4ba2d3e36c 100755 --- a/stack.sh +++ b/stack.sh @@ -533,6 +533,9 @@ set -o xtrace echo_summary "Installing package prerequisites" source $TOP_DIR/tools/install_prereqs.sh +# Configure an appropriate python environment +$TOP_DIR/tools/install_pip.sh + install_rpc_backend if is_service_enabled $DATABASE_BACKENDS; then diff --git a/tools/install_pip.sh b/tools/install_pip.sh new file mode 100755 index 0000000000..0ea8f536f6 --- /dev/null +++ b/tools/install_pip.sh @@ -0,0 +1,118 @@ +#!/usr/bin/env bash + +# **install_pip.sh** + +# install_pip.sh [--pip-version ] [--use-get-pip] [--setuptools] [--force] +# +# Update pip and friends to a known common version + +# Assumptions: +# - currently we try to leave the system setuptools alone, install +# the system package if it is not already present +# - update pip to $INSTALL_PIP_VERSION + +# Keep track of the current directory +TOOLS_DIR=$(cd $(dirname "$0") && pwd) +TOP_DIR=`cd $TOOLS_DIR/..; pwd` + +# Change dir to top of devstack +cd $TOP_DIR + +# Import common functions +source $TOP_DIR/functions + +FILES=$TOP_DIR/files + +# Handle arguments + +INSTALL_PIP_VERSION=${INSTALL_PIP_VERSION:-"1.4"} +while [[ -n "$1" ]]; do + case $1 in + --force) + FORCE=1 + ;; + --pip-version) + INSTALL_PIP_VERSION="$2" + shift + ;; + --setuptools) + SETUPTOOLS=1 + ;; + --use-get-pip) + USE_GET_PIP=1; + ;; + esac + shift +done + +SETUPTOOLS_EZ_SETUP_URL=https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py +PIP_GET_PIP_URL=https://raw.github.com/pypa/pip/master/contrib/get-pip.py +PIP_TAR_URL=https://pypi.python.org/packages/source/p/pip/pip-$INSTALL_PIP_VERSION.tar.gz + +GetDistro +echo "Distro: $DISTRO" + +function get_versions() { + PIP=$(which pip 2>/dev/null || which pip-python 2>/dev/null) + if [[ -n $PIP ]]; then + DISTRIBUTE_VERSION=$($PIP freeze | grep 'distribute==') + SETUPTOOLS_VERSION=$($PIP freeze | grep 'setuptools==') + PIP_VERSION=$($PIP --version | awk '{ print $2}') + echo "pip: $PIP_VERSION setuptools: $SETUPTOOLS_VERSION distribute: $DISTRIBUTE_VERSION" + fi +} + +function setuptools_ez_setup() { + if [[ ! -r $FILES/ez_setup.py ]]; then + (cd $FILES; \ + curl -OR $SETUPTOOLS_EZ_SETUP_URL; \ + ) + fi + sudo python $FILES/ez_setup.py +} + +function install_get_pip() { + if [[ ! -r $FILES/get-pip.py ]]; then + (cd $FILES; \ + curl $PIP_GET_PIP_URL; \ + ) + fi + sudo python $FILES/get-pip.py +} + +function install_pip_tarball() { + curl -O $PIP_TAR_URL + tar xvfz pip-$INSTALL_PIP_VERSION.tar.gz + cd pip-$INSTALL_PIP_VERSION + sudo python setup.py install +} + +# Show starting versions +get_versions + +# Do setuptools +if [[ -n "$SETUPTOOLS" ]]; then + # We want it from source + uninstall_package python-setuptools + setuptools_ez_setup +else + # See about installing the distro setuptools + if ! python -c "import setuptools"; then + install_package python-setuptools + fi +fi + +# Do pip +if [[ -z $PIP || "$PIP_VERSION" != "$INSTALL_PIP_VERSION" || -n $FORCE ]]; then + + # Eradicate any and all system packages + uninstall_package python-pip + + if [[ -n "$USE_GET_PIP" ]]; then + install_get_pip + else + install_pip_tarball + fi + + get_versions +fi