Skip to content

Commit

Permalink
Install ansible with OpenStack requirements constrains
Browse files Browse the repository at this point in the history
OpenStack requirements constrains is well tested. Use it in case of
installing upstream broken package.

This also fixes latest requests 2.12.2 break docker-py, which makes
kolla gate red.

Change-Id: I3e4ec4af2a6e1280313733e8f31f2eea7669dbc1
  • Loading branch information
jeffrey4l committed Dec 1, 2016
1 parent 0d234fe commit 27ee397
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tools/setup_gate.sh
Expand Up @@ -12,22 +12,28 @@ NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.$NODEPOOL_REGION.$NODEPOOL_C
NODEPOOL_MIRROR_HOST=$(echo $NODEPOOL_MIRROR_HOST|tr '[:upper:]' '[:lower:]')
NODEPOOL_PYPI_MIRROR=${NODEPOOL_PYPI_MIRROR:-http://$NODEPOOL_MIRROR_HOST/pypi/simple}

GIT_PROJECT_DIR=$(mktemp -d)

# Just for mandre :)
if [[ ! -f /etc/sudoers.d/jenkins ]]; then
echo "jenkins ALL=(:docker) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/jenkins
fi

function build_image {
KOLLA_DIR=$(mktemp -d)
function clone_repos {
cat > /tmp/clonemap <<EOF
clonemap:
- name: openstack/kolla
dest: ${KOLLA_DIR}
dest: ${GIT_PROJECT_DIR}/kolla
- name: openstack/requirements
dest: ${GIT_PROJECT_DIR}/requirements
EOF
/usr/zuul-env/bin/zuul-cloner -m /tmp/clonemap --workspace "$(pwd)" \
--cache-dir /opt/git git://git.openstack.org \
openstack/kolla
pushd "${KOLLA_DIR}"
openstack/kolla openstack/requirements
}

function build_image {
pushd "${GIT_PROJECT_DIR}/kolla"
sudo tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}"
popd
}
Expand Down Expand Up @@ -138,15 +144,15 @@ function setup_ansible {
mkdir /tmp/kolla

# TODO(SamYaple): Move to virtualenv
sudo -H pip install -U "ansible>=2" "docker-py>=1.6.0" "python-openstackclient" "python-neutronclient"
sudo -H pip install -U -c ${GIT_PROJECT_DIR}/requirements/upper-constraints.txt "ansible>=2" "docker-py>=1.6.0" "python-openstackclient" "python-neutronclient"
detect_distro

setup_inventory

# Record the running state of the environment as seen by the setup module
ansible all -i ${RAW_INVENTORY} -m setup > /tmp/logs/ansible/initial-setup

sudo pip install ara
sudo pip install -c ${GIT_PROJECT_DIR}/requirements/upper-constraints.txt ara
sudo mkdir /etc/ansible
sudo tee /etc/ansible/ansible.cfg<<EOF
[defaults]
Expand All @@ -170,6 +176,7 @@ function setup_logging {

setup_logging
tools/dump_info.sh
clone_repos
setup_workaround_broken_nodepool
setup_ssh
setup_ansible
Expand Down

0 comments on commit 27ee397

Please sign in to comment.