Merge "Add bridge-utils to deps for Ubuntu and Fedora."
diff --git a/exercise.sh b/exercise.sh
index 15f264f..a0349ce 100755
--- a/exercise.sh
+++ b/exercise.sh
@@ -5,6 +5,9 @@
# Keep track of the current devstack directory.
TOP_DIR=$(cd $(dirname "$0") && pwd)
+# Import common functions
+source $TOP_DIR/functions
+
# Load local configuration
source $TOP_DIR/stackrc
diff --git a/files/horizon_settings.py b/files/horizon_settings.py
index 1a6c17a..487c06e 100644
--- a/files/horizon_settings.py
+++ b/files/horizon_settings.py
@@ -20,6 +20,10 @@
CACHE_BACKEND = 'dummy://'
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
+# Set a secure and unique SECRET_KEY (the Django default is '')
+from horizon.utils import secret_key
+SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
+
# Send email to the console by default
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Or send them to /dev/null
diff --git a/functions b/functions
index 46a6f8a..b66dc15 100644
--- a/functions
+++ b/functions
@@ -471,12 +471,19 @@
if [[ -z "$os_PACKAGE" ]]; then
GetOSVersion
fi
- if [[ "$os_PACKAGE" = "deb" ]]; then
- CMD_PIP=/usr/bin/pip
+ if [[ $TRACK_DEPENDS = True ]] ; then
+ source $DEST/.venv/bin/activate
+ CMD_PIP=$DEST/.venv/bin/pip
+ SUDO_PIP="env"
else
- CMD_PIP=/usr/bin/pip-python
+ SUDO_PIP="sudo"
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ CMD_PIP=/usr/bin/pip
+ else
+ CMD_PIP=/usr/bin/pip-python
+ fi
fi
- sudo PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
+ $SUDO_PIP PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \
$CMD_PIP install --use-mirrors $@
@@ -501,12 +508,17 @@
# develop, so that pip and not distutils process the dependency chain
# setup_develop directory
function setup_develop() {
+ if [[ $TRACK_DEPENDS = True ]] ; then
+ SUDO_CMD="env"
+ else
+ SUDO_CMD="sudo"
+ fi
(cd $1; \
python setup.py egg_info; \
raw_links=$(awk '/^.+/ {print "-f " $1}' *.egg-info/dependency_links.txt); \
depend_links=$(echo $raw_links | xargs); \
pip_install -r *-info/requires.txt $depend_links; \
- sudo \
+ $SUDO_CMD \
HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \
python setup.py develop \
diff --git a/samples/local.sh b/samples/local.sh
index 83637f9..2c54b10 100755
--- a/samples/local.sh
+++ b/samples/local.sh
@@ -13,6 +13,9 @@
# Keep track of the devstack directory
TOP_DIR=$(cd $(dirname "$0") && pwd)
+# Import common functions
+source $TOP_DIR/functions
+
# Use openrc + stackrc + localrc for settings
source $TOP_DIR/stackrc
diff --git a/stack.sh b/stack.sh
index 19803bb..c1e06cb 100755
--- a/stack.sh
+++ b/stack.sh
@@ -614,6 +614,130 @@
install_package $(get_packages $FILES/rpms)
fi
+if [[ $SYSLOG != "False" ]]; then
+ install_package rsyslog-relp
+fi
+
+if is_service_enabled rabbit; then
+ # Install rabbitmq-server
+ # the temp file is necessary due to LP: #878600
+ tfile=$(mktemp)
+ install_package rabbitmq-server > "$tfile" 2>&1
+ cat "$tfile"
+ rm -f "$tfile"
+elif is_service_enabled qpid; then
+ if [[ "$os_PACKAGE" = "rpm" ]]; then
+ install_package qpid-cpp-server
+ else
+ install_package qpidd
+ fi
+fi
+
+if is_service_enabled mysql; then
+
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ # Seed configuration with mysql password so that apt-get install doesn't
+ # prompt us for a password upon install.
+ cat <<MYSQL_PRESEED | sudo debconf-set-selections
+mysql-server-5.1 mysql-server/root_password password $MYSQL_PASSWORD
+mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASSWORD
+mysql-server-5.1 mysql-server/start_on_boot boolean true
+MYSQL_PRESEED
+ fi
+
+ # while ``.my.cnf`` is not needed for openstack to function, it is useful
+ # as it allows you to access the mysql databases via ``mysql nova`` instead
+ # of having to specify the username/password each time.
+ if [[ ! -e $HOME/.my.cnf ]]; then
+ cat <<EOF >$HOME/.my.cnf
+[client]
+user=$MYSQL_USER
+password=$MYSQL_PASSWORD
+host=$MYSQL_HOST
+EOF
+ chmod 0600 $HOME/.my.cnf
+ fi
+ # Install mysql-server
+ install_package mysql-server
+fi
+
+if is_service_enabled quantum; then
+ if [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
+ # Install deps
+ # FIXME add to files/apts/quantum, but don't install if not needed!
+ install_package python-configobj
+ fi
+fi
+
+if is_service_enabled horizon; then
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ # Install apache2, which is NOPRIME'd
+ install_package apache2 libapache2-mod-wsgi
+ else
+ sudo rm -f /etc/httpd/conf.d/000-*
+ install_package httpd mod_wsgi
+ fi
+fi
+
+if is_service_enabled q-agt; then
+ if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
+ # Install deps
+ # FIXME add to files/apts/quantum, but don't install if not needed!
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ kernel_version=`cat /proc/version | cut -d " " -f3`
+ install_package make fakeroot dkms openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version
+ else
+ ### FIXME(dtroyer): Find RPMs for OpenVSwitch
+ echo "OpenVSwitch packages need to be located"
+ fi
+ elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
+ install_package bridge-utils
+ fi
+fi
+
+if is_service_enabled n-cpu; then
+
+ # Virtualization Configuration
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ LIBVIRT_PKG_NAME=libvirt-bin
+ else
+ LIBVIRT_PKG_NAME=libvirt
+ fi
+ install_package $LIBVIRT_PKG_NAME
+ # Install and configure **LXC** if specified. LXC is another approach to
+ # splitting a system into many smaller parts. LXC uses cgroups and chroot
+ # to simulate multiple systems.
+ if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
+ if [[ "$os_PACKAGE" = "deb" ]]; then
+ if [[ "$DISTRO" > natty ]]; then
+ install_package cgroup-lite
+ fi
+ else
+ ### FIXME(dtroyer): figure this out
+ echo "RPM-based cgroup not implemented yet"
+ yum_install libcgroup-tools
+ fi
+ fi
+fi
+
+if is_service_enabled swift; then
+ # Install memcached for swift.
+ install_package memcached
+fi
+
+TRACK_DEPENDS=${TRACK_DEPENDS:-False}
+
+# Install python packages into a virtualenv so that we can track them
+if [[ $TRACK_DEPENDS = True ]] ; then
+ install_package python-virtualenv
+
+ rm -rf $DEST/.venv
+ virtualenv --system-site-packages $DEST/.venv
+ source $DEST/.venv/bin/activate
+ $DEST/.venv/bin/pip freeze > $DEST/requires-pre-pip
+fi
+
# Install python requirements
pip_install $(get_packages $FILES/pips | sort -u)
@@ -671,7 +795,6 @@
install_cinder
fi
-
# Initialization
# ==============
@@ -715,12 +838,19 @@
configure_cinder
fi
+if [[ $TRACK_DEPENDS = True ]] ; then
+ $DEST/.venv/bin/pip freeze > $DEST/requires-post-pip
+ if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff ; then
+ cat $DEST/requires.diff
+ fi
+ echo "Ran stack.sh in depend tracking mode, bailing out now"
+ exit 0
+fi
# Syslog
# ------
if [[ $SYSLOG != "False" ]]; then
- install_package rsyslog-relp
if [[ "$SYSLOG_HOST" = "$HOST_IP" ]]; then
# Configure the master host to receive
cat <<EOF >/tmp/90-stack-m.conf
@@ -743,12 +873,7 @@
# --------------
if is_service_enabled rabbit; then
- # Install and start rabbitmq-server
- # the temp file is necessary due to LP: #878600
- tfile=$(mktemp)
- install_package rabbitmq-server > "$tfile" 2>&1
- cat "$tfile"
- rm -f "$tfile"
+ # Start rabbitmq-server
if [[ "$os_PACKAGE" = "rpm" ]]; then
# RPM doesn't start the service
restart_service rabbitmq-server
@@ -756,45 +881,17 @@
# change the rabbit password since the default is "guest"
sudo rabbitmqctl change_password guest $RABBIT_PASSWORD
elif is_service_enabled qpid; then
- if [[ "$os_PACKAGE" = "rpm" ]]; then
- install_package qpid-cpp-server
- restart_service qpidd
- else
- install_package qpidd
- fi
+ restart_service qpidd
fi
# Mysql
# -----
+
if is_service_enabled mysql; then
- if [[ "$os_PACKAGE" = "deb" ]]; then
- # Seed configuration with mysql password so that apt-get install doesn't
- # prompt us for a password upon install.
- cat <<MYSQL_PRESEED | sudo debconf-set-selections
-mysql-server-5.1 mysql-server/root_password password $MYSQL_PASSWORD
-mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASSWORD
-mysql-server-5.1 mysql-server/start_on_boot boolean true
-MYSQL_PRESEED
- fi
-
- # while ``.my.cnf`` is not needed for openstack to function, it is useful
- # as it allows you to access the mysql databases via ``mysql nova`` instead
- # of having to specify the username/password each time.
- if [[ ! -e $HOME/.my.cnf ]]; then
- cat <<EOF >$HOME/.my.cnf
-[client]
-user=$MYSQL_USER
-password=$MYSQL_PASSWORD
-host=$MYSQL_HOST
-EOF
- chmod 0600 $HOME/.my.cnf
- fi
-
- # Install and start mysql-server
- install_package mysql-server
+ #start mysql-server
if [[ "$os_PACKAGE" = "rpm" ]]; then
# RPM doesn't start the service
start_service mysqld
@@ -904,10 +1001,8 @@
sudo mkdir -p $HORIZON_DIR/.blackhole
if [[ "$os_PACKAGE" = "deb" ]]; then
- # Install apache2, which is NOPRIME'd
APACHE_NAME=apache2
APACHE_CONF=sites-available/horizon
- install_package apache2 libapache2-mod-wsgi
# Clean up the old config name
sudo rm -f /etc/apache2/sites-enabled/000-default
# Be a good citizen and use the distro tools here
@@ -917,8 +1012,6 @@
# Install httpd, which is NOPRIME'd
APACHE_NAME=httpd
APACHE_CONF=conf.d/horizon.conf
- sudo rm -f /etc/httpd/conf.d/000-*
- install_package httpd mod_wsgi
sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
fi
## Configure apache to run horizon
@@ -1028,9 +1121,6 @@
Q_PLUGIN_CLASS="quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2"
fi
elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
- # Install deps
- # FIXME add to files/apts/quantum, but don't install if not needed!
- install_package python-configobj
Q_PLUGIN_CONF_PATH=etc/quantum/plugins/linuxbridge
Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
Q_DB_NAME="quantum_linux_bridge"
@@ -1104,15 +1194,6 @@
# Quantum agent (for compute nodes)
if is_service_enabled q-agt; then
if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
- # Install deps
- # FIXME add to files/apts/quantum, but don't install if not needed!
- if [[ "$os_PACKAGE" = "deb" ]]; then
- kernel_version=`cat /proc/version | cut -d " " -f3`
- install_package make fakeroot dkms openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version
- else
- ### FIXME(dtroyer): Find RPMs for OpenVSwitch
- echo "OpenVSwitch packages need to be located"
- fi
# Set up integration bridge
OVS_BRIDGE=${OVS_BRIDGE:-br-int}
for PORT in `sudo ovs-vsctl --no-wait list-ports $OVS_BRIDGE`; do
@@ -1126,8 +1207,7 @@
AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py"
elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
# Start up the quantum <-> linuxbridge agent
- install_package bridge-utils
- #set the default network interface
+ # set the default network interface
QUANTUM_LB_PRIVATE_INTERFACE=${QUANTUM_LB_PRIVATE_INTERFACE:-$GUEST_INTERFACE_DEFAULT}
sudo sed -i -e "s/^physical_interface = .*$/physical_interface = $QUANTUM_LB_PRIVATE_INTERFACE/g" /$Q_PLUGIN_CONF_FILE
AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py"
@@ -1273,15 +1353,6 @@
if is_service_enabled n-cpu; then
- # Virtualization Configuration
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- if [[ "$os_PACKAGE" = "deb" ]]; then
- LIBVIRT_PKG_NAME=libvirt-bin
- else
- LIBVIRT_PKG_NAME=libvirt
- fi
- install_package $LIBVIRT_PKG_NAME
-
# Force IP forwarding on, just on case
sudo sysctl -w net.ipv4.ip_forward=1
@@ -1304,9 +1375,7 @@
# to simulate multiple systems.
if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
if [[ "$os_PACKAGE" = "deb" ]]; then
- if [[ "$DISTRO" > natty ]]; then
- install_package cgroup-lite
- else
+ if [[ ! "$DISTRO" > natty ]]; then
cgline="none /cgroup cgroup cpuacct,memory,devices,cpu,freezer,blkio 0 0"
sudo mkdir -p /cgroup
if ! grep -q cgroup /etc/fstab; then
@@ -1316,10 +1385,6 @@
sudo mount /cgroup
fi
fi
- else
- ### FIXME(dtroyer): figure this out
- echo "RPM-based cgroup not implemented yet"
- yum_install libcgroup-tools
fi
fi
@@ -1414,8 +1479,6 @@
# ---------------
if is_service_enabled swift; then
- # Install memcached for swift.
- install_package memcached
# We make sure to kill all swift processes first
swift-init all stop || true
diff --git a/stackrc b/stackrc
index 9ac17ac..3bbc475 100644
--- a/stackrc
+++ b/stackrc
@@ -1,6 +1,9 @@
# Find the other rc files
RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
+# Destination path for installation
+DEST=/opt/stack
+
# Specify which services to launch. These generally correspond to
# screen tabs. If you like to add other services that are not enabled
# by default you can append them in your ENABLED_SERVICES variable in
@@ -17,39 +20,43 @@
# Set the default Nova APIs to enable
NOVA_ENABLED_APIS=ec2,osapi_compute,osapi_volume,metadata
+# Base GIT Repo URL
+# Another option is http://review.openstack.org/p
+GIT_BASE=https://github.com
+
# volume service
-CINDER_REPO=https://github.com/openstack/cinder
+CINDER_REPO=${GIT_BASE}/openstack/cinder
CINDER_BRANCH=master
# volume client
-CINDERCLIENT_REPO=https://github.com/openstack/python-cinderclient
+CINDERCLIENT_REPO=${GIT_BASE}/openstack/python-cinderclient
CINDERCLIENT_BRANCH=master
# compute service
-NOVA_REPO=https://github.com/openstack/nova.git
+NOVA_REPO=${GIT_BASE}/openstack/nova.git
NOVA_BRANCH=master
# storage service
-SWIFT_REPO=https://github.com/openstack/swift.git
+SWIFT_REPO=${GIT_BASE}/openstack/swift.git
SWIFT_BRANCH=master
SWIFT3_REPO=https://github.com/fujita/swift3.git
SWIFT3_BRANCH=master
# python swift client library
-SWIFTCLIENT_REPO=https://github.com/openstack/python-swiftclient
+SWIFTCLIENT_REPO=${GIT_BASE}/openstack/python-swiftclient
SWIFTCLIENT_BRANCH=master
# image catalog service
-GLANCE_REPO=https://github.com/openstack/glance.git
+GLANCE_REPO=${GIT_BASE}/openstack/glance.git
GLANCE_BRANCH=master
# python glance client library
-GLANCECLIENT_REPO=https://github.com/openstack/python-glanceclient
+GLANCECLIENT_REPO=${GIT_BASE}/openstack/python-glanceclient
GLANCECLIENT_BRANCH=master
# unified auth system (manages accounts/tokens)
-KEYSTONE_REPO=https://github.com/openstack/keystone.git
+KEYSTONE_REPO=${GIT_BASE}/openstack/keystone.git
KEYSTONE_BRANCH=master
# a websockets/html5 or flash powered VNC console for vm instances
@@ -57,39 +64,39 @@
NOVNC_BRANCH=master
# django powered web control panel for openstack
-HORIZON_REPO=https://github.com/openstack/horizon.git
+HORIZON_REPO=${GIT_BASE}/openstack/horizon.git
HORIZON_BRANCH=master
# python client library to nova that horizon (and others) use
-NOVACLIENT_REPO=https://github.com/openstack/python-novaclient.git
+NOVACLIENT_REPO=${GIT_BASE}/openstack/python-novaclient.git
NOVACLIENT_BRANCH=master
# Shared openstack python client library
-OPENSTACKCLIENT_REPO=https://github.com/openstack/python-openstackclient.git
+OPENSTACKCLIENT_REPO=${GIT_BASE}/openstack/python-openstackclient.git
OPENSTACKCLIENT_BRANCH=master
# python keystone client library to nova that horizon uses
-KEYSTONECLIENT_REPO=https://github.com/openstack/python-keystoneclient
+KEYSTONECLIENT_REPO=${GIT_BASE}/openstack/python-keystoneclient
KEYSTONECLIENT_BRANCH=master
# quantum service
-QUANTUM_REPO=https://github.com/openstack/quantum
+QUANTUM_REPO=${GIT_BASE}/openstack/quantum
QUANTUM_BRANCH=master
# quantum client
-QUANTUM_CLIENT_REPO=https://github.com/openstack/python-quantumclient
+QUANTUM_CLIENT_REPO=${GIT_BASE}/openstack/python-quantumclient
QUANTUM_CLIENT_BRANCH=master
# Tempest test suite
-TEMPEST_REPO=https://github.com/openstack/tempest.git
+TEMPEST_REPO=${GIT_BASE}/openstack/tempest.git
TEMPEST_BRANCH=master
# melange service
-MELANGE_REPO=https://github.com/openstack/melange.git
+MELANGE_REPO=${GIT_BASE}/openstack/melange.git
MELANGE_BRANCH=master
# python melange client library
-MELANGECLIENT_REPO=https://github.com/openstack/python-melangeclient.git
+MELANGECLIENT_REPO=${GIT_BASE}/openstack/python-melangeclient.git
MELANGECLIENT_BRANCH=master
# Specify a comma-separated list of uec images to download and install into glance.
diff --git a/tools/build_bm.sh b/tools/build_bm.sh
index b2d4c36..ab0ba0e 100755
--- a/tools/build_bm.sh
+++ b/tools/build_bm.sh
@@ -5,6 +5,13 @@
# Build an OpenStack install on a bare metal machine.
set +x
+# Keep track of the current directory
+TOOLS_DIR=$(cd $(dirname "$0") && pwd)
+TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
+
+# Import common functions
+source $TOP_DIR/functions
+
# Source params
source ./stackrc
diff --git a/tools/configure_tempest.sh b/tools/configure_tempest.sh
index b858d0e..456b3c0 100755
--- a/tools/configure_tempest.sh
+++ b/tools/configure_tempest.sh
@@ -155,6 +155,9 @@
NETWORK_CATALOG_TYPE=network
NETWORK_API_VERSION=2.0
+# Volume API test configuration
+VOLUME_CATALOG_TYPE=volume
+
sed -e "
s,%IDENTITY_USE_SSL%,$IDENTITY_USE_SSL,g;
s,%IDENTITY_HOST%,$IDENTITY_HOST,g;
@@ -198,6 +201,7 @@
s,%IDENTITY_ADMIN_TENANT_NAME%,$IDENTITY_ADMIN_TENANT_NAME,g;
s,%NETWORK_CATALOG_TYPE%,$NETWORK_CATALOG_TYPE,g;
s,%NETWORK_API_VERSION%,$NETWORK_API_VERSION,g;
+ s,%VOLUME_CATALOG_TYPE%,$VOLUME_CATALOG_TYPE,g;
" -i $TEMPEST_CONF
echo "Created tempest configuration file:"