Install latest version of pip and virtualenv

We install pip with get-pip.py and use this to install virtualenv. This
is done as part of the new pip-and-virtualenv element. All elements that
need pip or virtualenv should use this element to install them.

Our motivation is that we need to talk to a pypi mirror generated with
a recent http://github.com/openstack-infra/pypi-mirror This mirror
caches some 'wheels' that the previous version of pip & virtualenv
can't install.

virtualenv contains its own version of pip that is used for all
virtualenv environments.

Change-Id: I282fd8fffc8d5707a078f78f2b4571138d7266f3
This commit is contained in:
Michael Kerrin 2014-02-20 15:23:40 +00:00
parent 44408e278c
commit 09e1abdfdc
23 changed files with 44 additions and 24 deletions

View File

@ -18,7 +18,7 @@ function deps {
apt-get update
fi
install-packages screen ccze
install-packages git ipmitool python-dev python-pip python-greenlet libxml2-dev libxslt-dev
install-packages git ipmitool python-dev python-greenlet libxml2-dev libxslt-dev
install-packages openvswitch-common openvswitch-controller openvswitch-switch open-iscsi
install-packages python-numpy python-lxml
}

View File

@ -1 +1,2 @@
source-repositories
pip-and-virtualenv

View File

@ -2,8 +2,6 @@
set -eux
install-packages python-pip
pushd /opt/stack/diskimage-builder
pip install .
popd

View File

@ -1,8 +1,6 @@
#!/bin/bash
set -eux
install-packages python-virtualenv
mkdir -p /opt/stack/venvs
virtualenv /opt/stack/venvs/gear

View File

@ -0,0 +1 @@
pip-and-virtualenv

View File

@ -2,8 +2,7 @@
set -uex
install-packages \
python-pip python-psutil python-virtualenv gcc python-dev
install-packages python-psutil gcc python-dev
mkdir -p /opt/stack/venvs

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -eux
install-packages python-pip nagios3
install-packages nagios3
# set check_external_commands
sed -i "s/check_external_commands=0/check_external_commands=1/" /etc/nagios3/nagios.cfg

View File

@ -1 +1,2 @@
source-repositories
pip-and-virtualenv

View File

@ -2,4 +2,4 @@
set -eux
install-packages git build-essential python-dev libssl-dev python-pip python-virtualenv libxml2-dev libxslt-dev libffi-dev
install-packages git build-essential python-dev libssl-dev libxml2-dev libxslt-dev libffi-dev

View File

@ -1,8 +1,6 @@
#!/bin/bash
set -eux
install-packages python-virtualenv
virtualenv --setuptools /opt/stack/venvs/os-apply-config
# bug #1201253 : virtualenv-1.10.1 embeds setuptools-0.9.8, which

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -eux
install-packages python-virtualenv build-essential libz-dev libxslt-dev libxml2-dev python-dev
install-packages build-essential libz-dev libxslt-dev libxml2-dev python-dev
virtualenv --setuptools /opt/stack/venvs/os-collect-config

View File

@ -1,3 +1,4 @@
pip-and-virtualenv
source-repositories
os-collect-config
os-apply-config

View File

@ -4,12 +4,13 @@
set -eux
install-packages python-virtualenv
# pip and virtualenv is installed by the pip-and-virtualenv element
virtualenv --setuptools /opt/stack/venvs/os-refresh-config
# Need setuptools>=1.0 to manage connections when
# downloading from pypi using http_proxy and https_proxy
/opt/stack/venvs/os-refresh-config/bin/pip install -U pip
/opt/stack/venvs/os-refresh-config/bin/pip install -U 'setuptools>=1.0'
/opt/stack/venvs/os-refresh-config/bin/pip install -U os-refresh-config

View File

@ -109,5 +109,5 @@ if [[ -z "$user" || -z "$repo" ]]; then
exit 1
fi
install-packages python-dev python-pip git-core python-setuptools gcc libc6-dev libxml2-dev libxslt-dev libz-dev
install-packages python-dev git-core gcc libc6-dev libxml2-dev libxslt-dev libz-dev
install-os-service "$user" "$repo" "$branch"

View File

@ -0,0 +1 @@
pip-and-virtualenv

View File

@ -2,12 +2,7 @@
set -eux
# Mysqlclient-dev is needed for MySQL-python which os-svc-install installs.
install-packages python-pip libmysqlclient-dev
pip install -U distribute # required by virtualenv
# required to ensure clean distribute -> setuptools migration
pip install -U setuptools
pip install -U 'virtualenv==1.10.1'
install-packages libmysqlclient-dev
install -m 0755 -o root -g root $(dirname $0)/../bin/os-svc-install /usr/local/bin/os-svc-install
install -m 0755 -o root -g root $(dirname $0)/../bin/os-svc-daemon /usr/local/bin/os-svc-daemon

View File

@ -0,0 +1,15 @@
Install latest pip and virtualenv
=================================
We have problems with the latest binary package of pip and virtualenv.
Packaged version of pip can be old and virtualenv can also contain its
own version of pip. Issues include downloading packages from a local
pypi mirror that include a wheel package for pip.
The element follows the instructions from the pip website here:
http://www.pip-installer.org/en/latest/installing.html on how to install
the latest version of pip. That is to download get-pip.py and run this
file.
We use source-repositories element to download the file so it will be
cached and can be overridden to use package if that is required.

View File

@ -0,0 +1 @@
source-repositories

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
install-packages python-pip python-virtualenv

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -eux
python /tmp/get-pip.py
pip install virtualenv

View File

@ -0,0 +1 @@
get-pip-py file /tmp/get-pip.py https://raw.github.com/pypa/pip/master/contrib/get-pip.py

View File

@ -1 +1,2 @@
pip-and-virtualenv
source-repositories

View File

@ -15,10 +15,7 @@
# under the License.
set -eux
install-packages libyaml-dev pkg-config python-dev python-pip build-essential
# need latest virtualenv
pip install -U virtualenv
install-packages libyaml-dev pkg-config python-dev build-essential
mkdir -p /opt/stack/venvs
virtualenv /opt/stack/venvs/pypi-mirror