Browse code

revive working with subset of services

Change-Id: I645c5df457a2ac2c997ac32720d53cacc0fa109b

Jesse Andrews authored on 2011/11/21 02:55:44
Showing 10 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+Andy Smith <github@anarkystic.com>
1
+Anthony Young <sleepsonthefloor@gmail.com>
2
+Brad Hall <brad@nicira.com>
3
+Chmouel Boudjnah <chmouel@chmouel.com>
4
+Dean Troyer <dtroyer@gmail.com>
5
+Devin Carlen <devin.carlen@gmail.com>
6
+Eddie Hebert <edhebert@gmail.com>
7
+Jake Dahn <admin@jakedahn.com>
8
+James E. Blair <james.blair@rackspace.com>
9
+Jason Cannavale <jason.cannavale@rackspace.com>
10
+Jay Pipes <jaypipes@gmail.com>
11
+Jesse Andrews <anotherjesse@gmail.com>
12
+Justin Shepherd <galstrom21@gmail.com>
13
+Scott Moser <smoser@ubuntu.com>
14
+Todd Willey <xtoddx@gmail.com>
15
+Tres Henry <tres@treshenry.net>
16
+Vishvananda Ishaya <vishvananda@gmail.com>
17
+Yun Mao <yunmao@gmail.com>
... ...
@@ -2,7 +2,7 @@ Tool to quickly deploy openstack dev environments.
2 2
 
3 3
 # Goals
4 4
 
5
-* To quickly build dev openstack environments in clean natty environments
5
+* To quickly build dev openstack environments in clean oneiric environments
6 6
 * To describe working configurations of openstack (which code branches work together?  what do config files look like for those branches?)
7 7
 * To make it easier for developers to dive into openstack so that they can productively contribute without having to understand every part of the system at once
8 8
 * To make it easy to prototype cross-project features
... ...
@@ -20,12 +20,6 @@ If working correctly, you should be able to access openstack endpoints, like:
20 20
 * Horizon: http://myhost/
21 21
 * Keystone: http://myhost:5000/v2.0/
22 22
 
23
-# To start a dev cloud in an lxc container:
24
-
25
-    ./build_lxc.sh
26
-
27
-You will need to configure a bridge and network on your host machine (by default br0) before starting build_lxc.sh.  A sample host-only network configuration can be found in lxc_network_hostonlyplusnat.sh.
28
-
29 23
 # Customizing
30 24
 
31 25
 You can tweak environment variables by creating file name 'localrc' should you need to override defaults.  It is likely that you will need to do this to tweak your networking configuration should you need to access your cloud from a different host.
... ...
@@ -31,7 +31,7 @@ popd
31 31
 # returns a token and catalog of endpoints.  We use python to parse the token
32 32
 # and save it.
33 33
 
34
-TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$NOVA_USERNAME\", \"password\": \"$NOVA_API_KEY\"}}}" -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
34
+TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$NOVA_USERNAME\", \"password\": \"$NOVA_PASSWORD\"}}}" -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
35 35
 
36 36
 # Launching a server
37 37
 # ==================
... ...
@@ -1,5 +1,15 @@
1
-apache2
2
-libapache2-mod-wsgi
1
+apache2  # NOPRIME
2
+libapache2-mod-wsgi  # NOPRIME
3 3
 python-dateutil
4
+python-paste
5
+python-pastedeploy
4 6
 python-anyjson
5 7
 python-routes
8
+python-xattr
9
+python-sqlalchemy
10
+python-webob
11
+python-kombu
12
+pylint
13
+pep8
14
+python-eventlet
15
+python-nose
... ...
@@ -5,6 +5,8 @@ parted
5 5
 arping # used for send_arp_for_ha option in nova-network
6 6
 mysql-server # NOPRIME
7 7
 python-mysqldb
8
+python-xattr # needed for glance which is needed for nova --- this shouldn't be here
9
+python-lxml # needed for glance which is needed for nova --- this shouldn't be here
8 10
 kvm
9 11
 gawk
10 12
 iptables
... ...
@@ -36,8 +38,9 @@ python-suds
36 36
 python-lockfile
37 37
 python-m2crypto
38 38
 python-boto
39
+python-kombu
39 40
 
40 41
 # Stuff for diablo volumes
41
-iscsitarget
42
-iscsitarget-dkms
42
+iscsitarget  # NOPRIME
43
+iscsitarget-dkms  # NOPRIME
43 44
 lvm2
... ...
@@ -1,20 +1,9 @@
1
-nose==1.0.0
2 1
 Django==1.3
3 2
 django-nose==0.1.2
4 3
 django-mailer
5 4
 django-registration==0.7
6
-kombu
7 5
 python-cloudfiles
8
-python-dateutil
9
-webob
10
-sqlalchemy
11
-paste
12
-PasteDeploy
13 6
 sqlalchemy-migrate
14
-eventlet
15
-xattr
16
-pep8
17
-pylint
18 7
 
19 8
 -e git+https://github.com/jacobian/openstack.compute.git#egg=openstack
20 9
 
... ...
@@ -2,7 +2,7 @@ hardstatus on
2 2
 hardstatus alwayslastline
3 3
 hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G}%H %{..Y}%d/%m %c"
4 4
 
5
-defscrollback 1024
5
+defscrollback 10240
6 6
 
7 7
 vbell off
8 8
 startup_message off
... ...
@@ -18,7 +18,8 @@ export NOVA_PROJECT_ID=${TENANT:-demo}
18 18
 export NOVA_USERNAME=${USERNAME:-demo}
19 19
 
20 20
 # With Keystone you pass the keystone password instead of an api key.
21
-export NOVA_API_KEY=${ADMIN_PASSWORD:-secrete}
21
+# The most recent versions of novaclient use NOVA_PASSWORD instead of NOVA_API_KEY
22
+export NOVA_PASSWORD=${ADMIN_PASSWORD:-secrete}
22 23
 
23 24
 # With the addition of Keystone, to use an openstack cloud you should
24 25
 # authenticate against keystone, which returns a **Token** and **Service
... ...
@@ -10,22 +10,22 @@
10 10
 # shared settings for common resources (mysql, rabbitmq) and build a multi-node
11 11
 # developer install.
12 12
 
13
-# To keep this script simple we assume you are running on an **Ubuntu 11.04
14
-# Natty** machine.  It should work in a VM or physical server.  Additionally we
15
-# put the list of *apt* and *pip* dependencies and other configuration files in
16
-# this repo.  So start by grabbing this script and the dependencies.
13
+# To keep this script simple we assume you are running on an **Ubuntu 11.10
14
+# Oneiric** machine.  It should work in a VM or physical server.  Additionally
15
+# we put the list of *apt* and *pip* dependencies and other configuration files
16
+# in this repo.  So start by grabbing this script and the dependencies.
17 17
 
18 18
 # Learn more and get the most recent version at http://devstack.org
19 19
 
20 20
 # Sanity Check
21 21
 # ============
22 22
 
23
-# Warn users who aren't on natty, but allow them to override check and attempt
23
+# Warn users who aren't on oneiric, but allow them to override check and attempt
24 24
 # installation with ``FORCE=yes ./stack``
25 25
 DISTRO=$(lsb_release -c -s)
26 26
 
27
-if [[ ! ${DISTRO} =~ (natty|oneiric) ]]; then
28
-    echo "WARNING: this script has only been tested on natty and oneiric"
27
+if [[ ! ${DISTRO} =~ (oneiric) ]]; then
28
+    echo "WARNING: this script has only been tested on oneiric"
29 29
     if [[ "$FORCE" != "yes" ]]; then
30 30
         echo "If you wish to run this script anyway run with FORCE=yes"
31 31
         exit 1
... ...
@@ -66,10 +66,10 @@ fi
66 66
 # We try to have sensible defaults, so you should be able to run ``./stack.sh``
67 67
 # in most cases.
68 68
 #
69
-# We our settings from ``stackrc``.  This file is distributed with devstack and
70
-# contains locations for what repositories to use.  If you want to use other
71
-# repositories and branches, you can add your own settings with another file
72
-# called ``localrc``
69
+# We source our settings from ``stackrc``.  This file is distributed with devstack
70
+# and contains locations for what repositories to use.  If you want to use other
71
+# repositories and branches, you can add your own settings with another file called
72
+# ``localrc``
73 73
 #
74 74
 # If ``localrc`` exists, then ``stackrc`` will load those settings.  This is
75 75
 # useful for changing a branch or repository to test other versions.  Also you
... ...
@@ -113,7 +113,7 @@ if [[ $EUID -eq 0 ]]; then
113 113
     fi
114 114
 
115 115
     echo "Giving stack user passwordless sudo priviledges"
116
-    # natty uec images sudoers does not have a '#includedir'. add one.
116
+    # some uec images sudoers does not have a '#includedir'. add one.
117 117
     grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
118 118
         echo "#includedir /etc/sudoers.d" >> /etc/sudoers
119 119
     ( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" \
... ...
@@ -384,7 +384,7 @@ fi
384 384
 function get_packages() {
385 385
     local file_to_parse="general"
386 386
     local service
387
-    
387
+
388 388
     for service in ${ENABLED_SERVICES//,/ }; do
389 389
         if [[ $service == n-* ]]; then
390 390
             if [[ ! $file_to_parse =~ nova ]]; then
... ...
@@ -473,20 +473,26 @@ function git_clone {
473 473
 git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH
474 474
 # python client library to nova that horizon (and others) use
475 475
 git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
476
+
477
+# glance, swift middleware and nova api needs keystone middleware
478
+if [[ "$ENABLED_SERVICES" =~ "key" || 
479
+      "$ENABLED_SERVICES" =~ "g-api" || 
480
+      "$ENABLED_SERVICES" =~ "n-api" || 
481
+      "$ENABLED_SERVICES" =~ "swift" ]]; then
482
+    # unified auth system (manages accounts/tokens)
483
+    git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
484
+fi
476 485
 if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
477 486
     # storage service
478 487
     git_clone $SWIFT_REPO $SWIFT_DIR $SWIFT_BRANCH
479 488
     # swift + keystone middleware
480 489
     git_clone $SWIFT_KEYSTONE_REPO $SWIFT_KEYSTONE_DIR $SWIFT_KEYSTONE_BRANCH
481 490
 fi
482
-if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
491
+if [[ "$ENABLED_SERVICES" =~ "g-api" ||
492
+      "$ENABLED_SERVICES" =~ "n-api" ]]; then
483 493
     # image catalog service
484 494
     git_clone $GLANCE_REPO $GLANCE_DIR $GLANCE_BRANCH
485 495
 fi
486
-if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
487
-    # unified auth system (manages accounts/tokens)
488
-    git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
489
-fi
490 496
 if [[ "$ENABLED_SERVICES" =~ "n-vnc" ]]; then
491 497
     # a websockets/html5 or flash powered VNC console for vm instances
492 498
     git_clone $NOVNC_REPO $NOVNC_DIR $NOVNC_BRANCH
... ...
@@ -511,14 +517,18 @@ fi
511 511
 
512 512
 # setup our checkouts so they are installed into python path
513 513
 # allowing ``import nova`` or ``import glance.client``
514
-if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
514
+if [[ "$ENABLED_SERVICES" =~ "key" || 
515
+      "$ENABLED_SERVICES" =~ "g-api" || 
516
+      "$ENABLED_SERVICES" =~ "n-api" || 
517
+      "$ENABLED_SERVICES" =~ "swift" ]]; then
515 518
     cd $KEYSTONE_DIR; sudo python setup.py develop
516 519
 fi
517 520
 if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
518 521
     cd $SWIFT_DIR; sudo python setup.py develop
519 522
     cd $SWIFT_KEYSTONE_DIR; sudo python setup.py develop
520 523
 fi
521
-if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
524
+if [[ "$ENABLED_SERVICES" =~ "g-api" ||
525
+      "$ENABLED_SERVICES" =~ "n-api" ]]; then
522 526
     cd $GLANCE_DIR; sudo python setup.py develop
523 527
 fi
524 528
 cd $NOVACLIENT_DIR; sudo python setup.py develop
... ...
@@ -596,6 +606,9 @@ fi
596 596
 
597 597
 if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then
598 598
 
599
+    # Install apache2, which is NOPRIME'd
600
+    apt_get install apache2 libapache2-mod-wsgi
601
+
599 602
     # Horizon currently imports quantum even if you aren't using it.  Instead
600 603
     # of installing quantum we can create a simple module that will pass the
601 604
     # initial imports
... ...
@@ -720,7 +733,7 @@ if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then
720 720
     # virtual machines.  If there is a partition labeled nova-instances we
721 721
     # mount it (ext filesystems can be labeled via e2label).
722 722
     if [ -L /dev/disk/by-label/nova-instances ]; then
723
-        if ! mount -n | grep -q nova-instances; then
723
+        if ! mount -n | grep -q $NOVA_DIR/instances; then
724 724
             sudo mount -L nova-instances $NOVA_DIR/instances
725 725
             sudo chown -R `whoami` $NOVA_DIR/instances
726 726
         fi
... ...
@@ -876,7 +889,9 @@ if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then
876 876
     # invoking stack.sh.
877 877
     #
878 878
     # By default, the backing file is 2G in size, and is stored in /opt/stack.
879
-    #
879
+
880
+    apt_get install iscsitarget-dkms iscsitarget
881
+
880 882
     if ! sudo vgdisplay | grep -q $VOLUME_GROUP; then
881 883
         VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file}
882 884
         VOLUME_BACKING_FILE_SIZE=${VOLUME_BACKING_FILE_SIZE:-2052M}
... ...
@@ -897,7 +912,6 @@ function add_nova_flag {
897 897
 # (re)create nova.conf
898 898
 rm -f $NOVA_DIR/bin/nova.conf
899 899
 add_nova_flag "--verbose"
900
-add_nova_flag "--nodaemon"
901 900
 add_nova_flag "--allow_admin_api"
902 901
 add_nova_flag "--scheduler_driver=$SCHEDULER"
903 902
 add_nova_flag "--dhcpbridge_flagfile=$NOVA_DIR/bin/nova.conf"
... ...
@@ -944,6 +958,12 @@ if [ "$SYSLOG" != "False" ]; then
944 944
     add_nova_flag "--use_syslog"
945 945
 fi
946 946
 
947
+# You can define extra nova conf flags by defining the array EXTRA_FLAGS,
948
+# For Example: EXTRA_FLAGS=(--foo --bar=2)
949
+for I in "${EXTRA_FLAGS[@]}"; do
950
+    add_nova_flag $i
951
+done
952
+
947 953
 # XenServer
948 954
 # ---------
949 955
 
... ...
@@ -27,7 +27,7 @@ HORIZON_REPO=https://github.com/openstack/horizon.git
27 27
 HORIZON_BRANCH=stable/diablo
28 28
 
29 29
 # python client library to nova that horizon (and others) use
30
-NOVACLIENT_REPO=https://github.com/rackspace/python-novaclient.git
30
+NOVACLIENT_REPO=https://github.com/openstack/python-novaclient.git
31 31
 NOVACLIENT_BRANCH=master
32 32
 
33 33
 # openstackx is a collection of extensions to openstack.compute & nova