From 8f78f257d11dc2d788cf52099a0a5e34c32e4fce Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Fri, 4 Dec 2015 14:18:26 -0600 Subject: [PATCH] Use fastest Linux mirrors for gate jobs Some new providers for OpenStack CI have popped up in the last week and this patch ensures we're using the fastest possible mirrors in those locations. Closes-bug: 1522957 Change-Id: Iec03c768a9fadf82831af4b90db1907abd399966 --- scripts/gate-check-commit.sh | 43 +++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index a8cb93a42b..b290cebf86 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -65,19 +65,40 @@ iptables -P OUTPUT ACCEPT if [ -f /etc/nodepool/provider -a -s /etc/nodepool/provider ]; then source /etc/nodepool/provider - if [[ ${NODEPOOL_PROVIDER} == "rax"* ]]; then - - # Set the Ubuntu Repository for the AIO to the RAX Mirror - export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_ubuntu_repo=http://mirror.rackspace.com/ubuntu" - export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_ubuntu_security_repo=http://mirror.rackspace.com/ubuntu" - - elif [[ ${NODEPOOL_PROVIDER} == "hpcloud"* ]]; then - - # Set the Ubuntu Repository for the AIO to the HP Cloud Mirror - export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_ubuntu_repo=http://${NODEPOOL_AZ}.clouds.archive.ubuntu.com/ubuntu" - export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_ubuntu_security_repo=http://${NODEPOOL_AZ}.clouds.archive.ubuntu.com/ubuntu" + # Get the fastest possible Linux mirror depending on the datacenter where the + # tests are running. + case ${NODEPOOL_PROVIDER} in + "rax-dfw"*) + export UBUNTU_REPO="http://dfw.mirror.rackspace.com/ubuntu" + ;; + "rax-ord"*) + export UBUNTU_REPO="http://ord.mirror.rackspace.com/ubuntu" + ;; + "rax-iad"*) + export UBUNTU_REPO="http://iad.mirror.rackspace.com/ubuntu" + ;; + "hpcloud"*) + export UBUNTU_REPO="http://${NODEPOOL_AZ}.clouds.archive.ubuntu.com/ubuntu" + ;; + "ovh-gra1"*) + export UBUNTU_REPO="http://ubuntu.mirrors.ovh.net/ubuntu" + ;; + "ovh-bhs1"*) + export UBUNTU_REPO="http://ubuntu.bhs.mirrors.ovh.net/ubuntu" + ;; + "bluebox-sjc1"*) + export UBUNTU_REPO="http://ord.mirror.rackspace.com/ubuntu" + ;; + "internap-nyj01"*) + export UBUNTU_REPO="http://iad.mirror.rackspace.com/ubuntu" + ;; + esac + if [ -n "${UBUNTU_REPO:-}" ]; then + export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_ubuntu_repo=${UBUNTU_REPO}" + export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_ubuntu_security_repo=${UBUNTU_REPO}" fi + fi # Bootstrap an AIO