use released library versions by default
This patch provides a new path for installing libraries in devstack so that it's possible to either test with upstream released libraries, or with git versions of individual libraries. Libraries are added by name to 3 associative arrays GITREPO, GITBRANCH, GITDIR. When we get to the library install phase we inspect LIBS_FROM_GIT and look for libraries by name (i.e. "oslo.config") and if they exist we'll clone and install those libraries from git. Otherwise we won't, and just let pip pull them as dependencies when it needs them. This patch provides the conversion of the oslo libraries, including pbr. Devstack-gate jobs for these libraries will need to change to support actually forward testing their content. Change-Id: I6161fa3194dbe8fbc25b6ee0e2fe3cc722a1cea4
This commit is contained in:
parent
8e087fa83b
commit
cc52406a78
@ -36,6 +36,11 @@
|
|||||||
XTRACE=$(set +o | grep xtrace)
|
XTRACE=$(set +o | grep xtrace)
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
|
|
||||||
|
# Global Config Variables
|
||||||
|
declare -A GITREPO
|
||||||
|
declare -A GITBRANCH
|
||||||
|
declare -A GITDIR
|
||||||
|
|
||||||
|
|
||||||
# Config Functions
|
# Config Functions
|
||||||
# ================
|
# ================
|
||||||
@ -598,6 +603,18 @@ function git_clone {
|
|||||||
cd $orig_dir
|
cd $orig_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# A variation on git clone that lets us specify a project by it's
|
||||||
|
# actual name, like oslo.config. This is exceptionally useful in the
|
||||||
|
# library installation case
|
||||||
|
function git_clone_by_name {
|
||||||
|
local name=$1
|
||||||
|
local repo=${GITREPO[$name]}
|
||||||
|
local dir=${GITDIR[$name]}
|
||||||
|
local branch=${GITBRANCH[$name]}
|
||||||
|
git_clone $repo $dir $branch
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# git can sometimes get itself infinitely stuck with transient network
|
# git can sometimes get itself infinitely stuck with transient network
|
||||||
# errors or other issues with the remote end. This wraps git in a
|
# errors or other issues with the remote end. This wraps git in a
|
||||||
# timeout/retry loop and is intended to watch over non-local git
|
# timeout/retry loop and is intended to watch over non-local git
|
||||||
@ -1541,6 +1558,26 @@ function pip_install {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# should we use this library from their git repo, or should we let it
|
||||||
|
# get pulled in via pip dependencies.
|
||||||
|
function use_library_from_git {
|
||||||
|
local name=$1
|
||||||
|
local enabled=1
|
||||||
|
[[ ,${LIBS_FROM_GIT}, =~ ,${name}, ]] && enabled=0
|
||||||
|
return $enabled
|
||||||
|
}
|
||||||
|
|
||||||
|
# setup a library by name. If we are trying to use the library from
|
||||||
|
# git, we'll do a git based install, otherwise we'll punt and the
|
||||||
|
# library should be installed by a requirements pull from another
|
||||||
|
# project.
|
||||||
|
function setup_lib {
|
||||||
|
local name=$1
|
||||||
|
local dir=${GITDIR[$name]}
|
||||||
|
setup_install $dir
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# this should be used if you want to install globally, all libraries should
|
# this should be used if you want to install globally, all libraries should
|
||||||
# use this, especially *oslo* ones
|
# use this, especially *oslo* ones
|
||||||
function setup_install {
|
function setup_install {
|
||||||
|
10
lib/infra
10
lib/infra
@ -19,7 +19,7 @@ set +o xtrace
|
|||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
# --------
|
# --------
|
||||||
PBR_DIR=$DEST/pbr
|
GITDIR["pbr"]=$DEST/pbr
|
||||||
REQUIREMENTS_DIR=$DEST/requirements
|
REQUIREMENTS_DIR=$DEST/requirements
|
||||||
|
|
||||||
# Entry Points
|
# Entry Points
|
||||||
@ -31,8 +31,12 @@ function install_infra {
|
|||||||
git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
|
git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
|
||||||
|
|
||||||
# Install pbr
|
# Install pbr
|
||||||
git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
|
if use_library_from_git "pbr"; then
|
||||||
setup_install $PBR_DIR
|
git_clone_by_name "pbr"
|
||||||
|
setup_lib "pbr"
|
||||||
|
else
|
||||||
|
pip_install "pbr"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
|
97
lib/oslo
97
lib/oslo
@ -20,21 +20,21 @@ set +o xtrace
|
|||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
# --------
|
# --------
|
||||||
CLIFF_DIR=$DEST/cliff
|
GITDIR["cliff"]=$DEST/cliff
|
||||||
OSLOCFG_DIR=$DEST/oslo.config
|
GITDIR["oslo.config"]=$DEST/oslo.config
|
||||||
OSLOCON_DIR=$DEST/oslo.concurrency
|
GITDIR["oslo.concurrency"]=$DEST/oslo.concurrency
|
||||||
OSLODB_DIR=$DEST/oslo.db
|
GITDIR["oslo.db"]=$DEST/oslo.db
|
||||||
OSLOI18N_DIR=$DEST/oslo.i18n
|
GITDIR["oslo.i18n"]=$DEST/oslo.i18n
|
||||||
OSLOLOG_DIR=$DEST/oslo.log
|
GITDIR["oslo.log"]=$DEST/oslo.log
|
||||||
OSLOMID_DIR=$DEST/oslo.middleware
|
GITDIR["oslo.middleware"]=$DEST/oslo.middleware
|
||||||
OSLOMSG_DIR=$DEST/oslo.messaging
|
GITDIR["oslo.messaging"]=$DEST/oslo.messaging
|
||||||
OSLORWRAP_DIR=$DEST/oslo.rootwrap
|
GITDIR["oslo.rootwrap"]=$DEST/oslo.rootwrap
|
||||||
OSLOSERIALIZATION_DIR=$DEST/oslo.serialization
|
GITDIR["oslo.serialization"]=$DEST/oslo.serialization
|
||||||
OSLOUTILS_DIR=$DEST/oslo.utils
|
GITDIR["oslo.utils"]=$DEST/oslo.utils
|
||||||
OSLOVMWARE_DIR=$DEST/oslo.vmware
|
GITDIR["oslo.vmware"]=$DEST/oslo.vmware
|
||||||
PYCADF_DIR=$DEST/pycadf
|
GITDIR["pycadf"]=$DEST/pycadf
|
||||||
STEVEDORE_DIR=$DEST/stevedore
|
GITDIR["stevedore"]=$DEST/stevedore
|
||||||
TASKFLOW_DIR=$DEST/taskflow
|
GITDIR["taskflow"]=$DEST/taskflow
|
||||||
|
|
||||||
# Support entry points installation of console scripts
|
# Support entry points installation of console scripts
|
||||||
OSLO_BIN_DIR=$(get_python_exec_prefix)
|
OSLO_BIN_DIR=$(get_python_exec_prefix)
|
||||||
@ -42,52 +42,31 @@ OSLO_BIN_DIR=$(get_python_exec_prefix)
|
|||||||
# Entry Points
|
# Entry Points
|
||||||
# ------------
|
# ------------
|
||||||
|
|
||||||
|
function _do_install_oslo_lib {
|
||||||
|
local name=$1
|
||||||
|
if use_library_from_git "$name"; then
|
||||||
|
git_clone_by_name "$name"
|
||||||
|
setup_lib "$name"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# install_oslo() - Collect source and prepare
|
# install_oslo() - Collect source and prepare
|
||||||
function install_oslo {
|
function install_oslo {
|
||||||
git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
|
_do_install_oslo_lib "cliff"
|
||||||
setup_install $CLIFF_DIR
|
_do_install_oslo_lib "oslo.i18n"
|
||||||
|
_do_install_oslo_lib "oslo.utils"
|
||||||
git_clone $OSLOI18N_REPO $OSLOI18N_DIR $OSLOI18N_BRANCH
|
_do_install_oslo_lib "oslo.serialization"
|
||||||
setup_install $OSLOI18N_DIR
|
_do_install_oslo_lib "oslo.config"
|
||||||
|
_do_install_oslo_lib "oslo.concurrency"
|
||||||
git_clone $OSLOUTILS_REPO $OSLOUTILS_DIR $OSLOUTILS_BRANCH
|
_do_install_oslo_lib "oslo.log"
|
||||||
setup_install $OSLOUTILS_DIR
|
_do_install_oslo_lib "oslo.middleware"
|
||||||
|
_do_install_oslo_lib "oslo.messaging"
|
||||||
git_clone $OSLOSERIALIZATION_REPO $OSLOSERIALIZATION_DIR $OSLOSERIALIZATION_BRANCH
|
_do_install_oslo_lib "oslo.rootwrap"
|
||||||
setup_install $OSLOSERIALIZATION_DIR
|
_do_install_oslo_lib "oslo.db"
|
||||||
|
_do_install_oslo_lib "olso.vmware"
|
||||||
git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
|
_do_install_oslo_lib "pycadf"
|
||||||
setup_install $OSLOCFG_DIR
|
_do_install_oslo_lib "stevedore"
|
||||||
|
_do_install_oslo_lib "taskflow"
|
||||||
git_clone $OSLOCON_REPO $OSLOCON_DIR $OSLOCON_BRANCH
|
|
||||||
setup_install $OSLOCON_DIR
|
|
||||||
|
|
||||||
git_clone $OSLOLOG_REPO $OSLOLOG_DIR $OSLOLOG_BRANCH
|
|
||||||
setup_install $OSLOLOG_DIR
|
|
||||||
|
|
||||||
git_clone $OSLOMID_REPO $OSLOMID_DIR $OSLOMID_BRANCH
|
|
||||||
setup_install $OSLOMID_DIR
|
|
||||||
|
|
||||||
git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
|
|
||||||
setup_install $OSLOMSG_DIR
|
|
||||||
|
|
||||||
git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH
|
|
||||||
setup_install $OSLORWRAP_DIR
|
|
||||||
|
|
||||||
git_clone $OSLODB_REPO $OSLODB_DIR $OSLODB_BRANCH
|
|
||||||
setup_install $OSLODB_DIR
|
|
||||||
|
|
||||||
git_clone $OSLOVMWARE_REPO $OSLOVMWARE_DIR $OSLOVMWARE_BRANCH
|
|
||||||
setup_install $OSLOVMWARE_DIR
|
|
||||||
|
|
||||||
git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH
|
|
||||||
setup_install $PYCADF_DIR
|
|
||||||
|
|
||||||
git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH
|
|
||||||
setup_install $STEVEDORE_DIR
|
|
||||||
|
|
||||||
git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH
|
|
||||||
setup_install $TASKFLOW_DIR
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
|
64
stackrc
64
stackrc
@ -222,68 +222,68 @@ ORC_REPO=${ORC_REPO:-${GIT_BASE}/openstack/os-refresh-config.git}
|
|||||||
ORC_BRANCH=${ORC_BRANCH:-master}
|
ORC_BRANCH=${ORC_BRANCH:-master}
|
||||||
|
|
||||||
# cliff command line framework
|
# cliff command line framework
|
||||||
CLIFF_REPO=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
|
GITREPO["cliff"]=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
|
||||||
CLIFF_BRANCH=${CLIFF_BRANCH:-master}
|
GITBRANCH["cliff"]=${CLIFF_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.concurrency
|
# oslo.concurrency
|
||||||
OSLOCON_REPO=${OSLOCON_REPO:-${GIT_BASE}/openstack/oslo.concurrency.git}
|
GITREPO["oslo.concurrency"]=${OSLOCON_REPO:-${GIT_BASE}/openstack/oslo.concurrency.git}
|
||||||
OSLOCON_BRANCH=${OSLOCON_BRANCH:-master}
|
GITBRANCH["olso.concurrency"]=${OSLOCON_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.config
|
# oslo.config
|
||||||
OSLOCFG_REPO=${OSLOCFG_REPO:-${GIT_BASE}/openstack/oslo.config.git}
|
GITREPO["oslo.config"]=${OSLOCFG_REPO:-${GIT_BASE}/openstack/oslo.config.git}
|
||||||
OSLOCFG_BRANCH=${OSLOCFG_BRANCH:-master}
|
GITBRANCH["oslo.config"]=${OSLOCFG_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.db
|
# oslo.db
|
||||||
OSLODB_REPO=${OSLODB_REPO:-${GIT_BASE}/openstack/oslo.db.git}
|
GITREPO["olso.db"]=${OSLODB_REPO:-${GIT_BASE}/openstack/oslo.db.git}
|
||||||
OSLODB_BRANCH=${OSLODB_BRANCH:-master}
|
GITBRANCH["olso.db"]=${OSLODB_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.i18n
|
# oslo.i18n
|
||||||
OSLOI18N_REPO=${OSLOI18N_REPO:-${GIT_BASE}/openstack/oslo.i18n.git}
|
GITREPO["olso.i18n"]=${OSLOI18N_REPO:-${GIT_BASE}/openstack/oslo.i18n.git}
|
||||||
OSLOI18N_BRANCH=${OSLOI18N_BRANCH:-master}
|
GITBRANCH["olso.i18n"]=${OSLOI18N_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.log
|
# oslo.log
|
||||||
OSLOLOG_REPO=${OSLOLOG_REPO:-${GIT_BASE}/openstack/oslo.log.git}
|
GITREPO["olso.log"]=${OSLOLOG_REPO:-${GIT_BASE}/openstack/oslo.log.git}
|
||||||
OSLOLOG_BRANCH=${OSLOLOG_BRANCH:-master}
|
GITBRANCH["olso.log"]=${OSLOLOG_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.messaging
|
# oslo.messaging
|
||||||
OSLOMSG_REPO=${OSLOMSG_REPO:-${GIT_BASE}/openstack/oslo.messaging.git}
|
GITREPO["olso.messaging"]=${OSLOMSG_REPO:-${GIT_BASE}/openstack/oslo.messaging.git}
|
||||||
OSLOMSG_BRANCH=${OSLOMSG_BRANCH:-master}
|
GITBRANCH["olso.messaging"]=${OSLOMSG_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.middleware
|
# oslo.middleware
|
||||||
OSLOMID_REPO=${OSLOMID_REPO:-${GIT_BASE}/openstack/oslo.middleware.git}
|
GITREPO["oslo.middleware"]=${OSLOMID_REPO:-${GIT_BASE}/openstack/oslo.middleware.git}
|
||||||
OSLOMID_BRANCH=${OSLOMID_BRANCH:-master}
|
GITBRANCH["oslo.middleware"]=${OSLOMID_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.rootwrap
|
# oslo.rootwrap
|
||||||
OSLORWRAP_REPO=${OSLORWRAP_REPO:-${GIT_BASE}/openstack/oslo.rootwrap.git}
|
GITREPO["olso.rootwrap"]=${OSLORWRAP_REPO:-${GIT_BASE}/openstack/oslo.rootwrap.git}
|
||||||
OSLORWRAP_BRANCH=${OSLORWRAP_BRANCH:-master}
|
GITBRANCH["olso.rootwrap"]=${OSLORWRAP_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.serialization
|
# oslo.serialization
|
||||||
OSLOSERIALIZATION_REPO=${OSLOSERIALIZATION_REPO:-${GIT_BASE}/openstack/oslo.serialization.git}
|
GITREPO["olso.serialization"]=${OSLOSERIALIZATION_REPO:-${GIT_BASE}/openstack/oslo.serialization.git}
|
||||||
OSLOSERIALIZATION_BRANCH=${OSLOSERIALIZATION_BRANCH:-master}
|
GITBRANCH["olso.serialization"]=${OSLOSERIALIZATION_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.utils
|
# oslo.utils
|
||||||
OSLOUTILS_REPO=${OSLOUTILS_REPO:-${GIT_BASE}/openstack/oslo.utils.git}
|
GITREPO["olso.utils"]=${OSLOUTILS_REPO:-${GIT_BASE}/openstack/oslo.utils.git}
|
||||||
OSLOUTILS_BRANCH=${OSLOUTILS_BRANCH:-master}
|
GITBRANCH["olso.utils"]=${OSLOUTILS_BRANCH:-master}
|
||||||
|
|
||||||
# oslo.vmware
|
# oslo.vmware
|
||||||
OSLOVMWARE_REPO=${OSLOVMWARE_REPO:-${GIT_BASE}/openstack/oslo.vmware.git}
|
GITREPO["olso.vmware"]=${OSLOVMWARE_REPO:-${GIT_BASE}/openstack/oslo.vmware.git}
|
||||||
OSLOVMWARE_BRANCH=${OSLOVMWARE_BRANCH:-master}
|
GITBRANCH["olso.vmware"]=${OSLOVMWARE_BRANCH:-master}
|
||||||
|
|
||||||
# pycadf auditing library
|
# pycadf auditing library
|
||||||
PYCADF_REPO=${PYCADF_REPO:-${GIT_BASE}/openstack/pycadf.git}
|
GITREPO["pycadf"]=${PYCADF_REPO:-${GIT_BASE}/openstack/pycadf.git}
|
||||||
PYCADF_BRANCH=${PYCADF_BRANCH:-master}
|
GITBRANCH["pycadf"]=${PYCADF_BRANCH:-master}
|
||||||
|
|
||||||
# stevedore plugin manager
|
# stevedore plugin manager
|
||||||
STEVEDORE_REPO=${STEVEDORE_REPO:-${GIT_BASE}/openstack/stevedore.git}
|
GITREPO["stevedore"]=${STEVEDORE_REPO:-${GIT_BASE}/openstack/stevedore.git}
|
||||||
STEVEDORE_BRANCH=${STEVEDORE_BRANCH:-master}
|
GITBRANCH["stevedore"]=${STEVEDORE_BRANCH:-master}
|
||||||
|
|
||||||
# taskflow plugin manager
|
# taskflow plugin manager
|
||||||
TASKFLOW_REPO=${TASKFLOW_REPO:-${GIT_BASE}/openstack/taskflow.git}
|
GITREPO["taskflow"]=${TASKFLOW_REPO:-${GIT_BASE}/openstack/taskflow.git}
|
||||||
TASKFLOW_BRANCH=${TASKFLOW_BRANCH:-master}
|
GITBRANCH["taskflow"]=${TASKFLOW_BRANCH:-master}
|
||||||
|
|
||||||
# pbr drives the setuptools configs
|
# pbr drives the setuptools configs
|
||||||
PBR_REPO=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
|
GITREPO["pbr"]=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
|
||||||
PBR_BRANCH=${PBR_BRANCH:-master}
|
GITBRANCH["pbr"]=${PBR_BRANCH:-master}
|
||||||
|
|
||||||
# neutron service
|
# neutron service
|
||||||
NEUTRON_REPO=${NEUTRON_REPO:-${GIT_BASE}/openstack/neutron.git}
|
NEUTRON_REPO=${NEUTRON_REPO:-${GIT_BASE}/openstack/neutron.git}
|
||||||
|
Loading…
Reference in New Issue
Block a user