Browse code

add lib/stackforge to let us test wsme / pecan from git

wsme and pecan libraries have migrated to stackforge for
development. If we support them in devstack, we can use their git
version instead of the release version, which ensures that they
won't break the rest of OpenStack when they cut a new release.

This is similar to how oslo testing works. Long term we probably
want a more generic mechanism to handle this, but for now, this
should get us rolling, and get them gating.

Change-Id: Icf3475f433081c7c625864107d7e118e214396e1

Sean Dague authored on 2013/10/22 07:11:40
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,67 @@
0
+# lib/stackforge
1
+#
2
+# Functions to install stackforge libraries that we depend on so
3
+# that we can try their git versions during devstack gate.
4
+#
5
+# This is appropriate for python libraries that release to pypi and are
6
+# expected to be used beyond OpenStack like, but are requirements
7
+# for core services in global-requirements.
8
+#    * wsme
9
+#    * pecan
10
+#
11
+# This is not appropriate for stackforge projects which are early stage
12
+# OpenStack tools
13
+
14
+# Dependencies:
15
+# ``functions`` file
16
+
17
+# ``stack.sh`` calls the entry points in this order:
18
+#
19
+# install_stackforge
20
+
21
+# Save trace setting
22
+XTRACE=$(set +o | grep xtrace)
23
+set +o xtrace
24
+
25
+
26
+# Defaults
27
+# --------
28
+WSME_DIR=$DEST/wsme
29
+PECAN_DIR=$DEST/pecan
30
+
31
+# Entry Points
32
+# ------------
33
+
34
+# install_stackforge() - Collect source and prepare
35
+function install_stackforge() {
36
+    # TODO(sdague): remove this once we get to Icehouse, this just makes
37
+    # for a smoother transition of existing users.
38
+    cleanup_stackforge
39
+
40
+    git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH
41
+    setup_develop $WSME_DIR
42
+
43
+    git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH
44
+    setup_develop $PECAN_DIR
45
+}
46
+
47
+# cleanup_stackforge() - purge possibly old versions of stackforge libraries
48
+function cleanup_stackforge() {
49
+    # this means we've got an old version installed, lets get rid of it
50
+    # otherwise python hates itself
51
+    for lib in wsme pecan; do
52
+        if ! python -c "import $lib" 2>/dev/null; then
53
+            echo "Found old $lib... removing to ensure consistency"
54
+            local PIP_CMD=$(get_pip_command)
55
+            pip_install $lib
56
+            sudo $PIP_CMD uninstall -y $lib
57
+        fi
58
+    done
59
+}
60
+
61
+# Restore xtrace
62
+$XTRACE
63
+
64
+# Local variables:
65
+# mode: shell-script
66
+# End:
... ...
@@ -299,6 +299,7 @@ source $TOP_DIR/lib/apache
299 299
 source $TOP_DIR/lib/tls
300 300
 source $TOP_DIR/lib/infra
301 301
 source $TOP_DIR/lib/oslo
302
+source $TOP_DIR/lib/stackforge
302 303
 source $TOP_DIR/lib/horizon
303 304
 source $TOP_DIR/lib/keystone
304 305
 source $TOP_DIR/lib/glance
... ...
@@ -627,6 +628,9 @@ install_infra
627 627
 # Install oslo libraries that have graduated
628 628
 install_oslo
629 629
 
630
+# Install stackforge libraries for testing
631
+install_stackforge
632
+
630 633
 # Install clients libraries
631 634
 install_keystoneclient
632 635
 install_glanceclient
... ...
@@ -193,6 +193,16 @@ TROVE_BRANCH=${TROVE_BRANCH:-master}
193 193
 TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
194 194
 TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master}
195 195
 
196
+# stackforge libraries that are used by OpenStack core services
197
+# wsme
198
+WSME_REPO=${WSME_REPO:-${GIT_BASE}/stackforge/wsme.git}
199
+WSME_BRANCH=${WSME_BRANCH:-master}
200
+
201
+# pecan
202
+PECAN_REPO=${PECAN_REPO:-${GIT_BASE}/stackforge/pecan.git}
203
+PECAN_BRANCH=${PECAN_BRANCH:-master}
204
+
205
+
196 206
 # Nova hypervisor configuration.  We default to libvirt with **kvm** but will
197 207
 # drop back to **qemu** if we are unable to load the kvm module.  ``stack.sh`` can
198 208
 # also install an **LXC**, **OpenVZ** or **XenAPI** based system.  If xenserver-core