Skip to content

Commit d4b5448

Browse files
committed
Upstream merge dcbaf1c. Full Gentoo build pass.
1 parent 3785009 commit d4b5448

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+5764
-2430
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ files/*.gz
1010
files/images
1111
stack-screenrc
1212
*.pem
13+
accrc
14+
.stackenv

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Aaron Lee <[email protected]>
22
Aaron Rosen <[email protected]>
33
Adam Gandelman <[email protected]>
4+
Akihiro MOTOKI <[email protected]>
45
Andrew Laski <[email protected]>
56
Andy Smith <[email protected]>
67
Anthony Young <[email protected]>
@@ -18,6 +19,7 @@ Gabriel Hurley <[email protected]>
1819
Gary Kotton <[email protected]>
1920
Hengqing Hu <[email protected]>
2021
Hua ZHANG <[email protected]>
22+
Isaku Yamahata <[email protected]>
2123
Jake Dahn <[email protected]>
2224
James E. Blair <[email protected]>
2325
Jason Cannavale <[email protected]>
@@ -34,6 +36,7 @@ Matt Joyce <[email protected]>
3436
Osamu Habuka <[email protected]>
3537
Russell Bryant <[email protected]>
3638
Scott Moser <[email protected]>
39+
Sumit Naiksatam <[email protected]>
3740
Thierry Carrez <[email protected]>
3841
Todd Willey <[email protected]>
3942
Tres Henry <[email protected]>

HACKING.rst

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ https://github.com/openstack-dev/devstack.git. Besides the master branch that
1515
tracks the OpenStack trunk branches a separate branch is maintained for all
1616
OpenStack releases starting with Diablo (stable/diablo).
1717

18+
Contributing code to DevStack follows the usual OpenStack process as described
19+
in `How To Contribute`__ in the OpenStack wiki. `DevStack's LaunchPad project`__
20+
contains the usual links for blueprints, bugs, tec.
21+
22+
__ contribute_
23+
.. _contribute: http://wiki.openstack.org/HowToContribute.
24+
25+
__ lp_
26+
.. _lp: https://launchpad.net/~devstack
27+
1828
The primary script in DevStack is ``stack.sh``, which performs the bulk of the
1929
work for DevStack's use cases. There is a subscript ``functions`` that contains
2030
generally useful shell functions and is used by a number of the scripts in
@@ -53,8 +63,8 @@ configuration of the user environment::
5363
source $TOP_DIR/openrc
5464

5565
``stack.sh`` is a rather large monolithic script that flows through from beginning
56-
to end. The process of breaking it down into project-level sub-scripts has begun
57-
with the introduction of ``lib/cinder`` and ``lib/ceilometer``.
66+
to end. The process of breaking it down into project-level sub-scripts is nearly
67+
complete and should make ``stack.sh`` easier to read and manage.
5868

5969
These library sub-scripts have a number of fixed entry points, some of which may
6070
just be stubs. These entry points will be called by ``stack.sh`` in the
@@ -71,6 +81,36 @@ There is a sub-script template in ``lib/templates`` to be used in creating new
7181
service sub-scripts. The comments in ``<>`` are meta comments describing
7282
how to use the template and should be removed.
7383

84+
In order to show the dependencies and conditions under which project functions
85+
are executed the top-level conditional testing for things like ``is_service_enabled``
86+
should be done in ``stack.sh``. There may be nested conditionals that need
87+
to be in the sub-script, such as testing for keystone being enabled in
88+
``configure_swift()``.
89+
90+
91+
stackrc
92+
-------
93+
94+
``stackrc`` is the global configuration file for DevStack. It is responsible for
95+
calling ``localrc`` if it exists so configuration can be overridden by the user.
96+
97+
The criteria for what belongs in ``stackrc`` can be vaguely summarized as
98+
follows:
99+
100+
* All project respositories and branches (for historical reasons)
101+
* Global configuration that may be referenced in ``localrc``, i.e. ``DEST``, ``DATA_DIR``
102+
* Global service configuration like ``ENABLED_SERVICES``
103+
* Variables used by multiple services that do not have a clear owner, i.e.
104+
``VOLUME_BACKING_FILE_SIZE`` (nova-volumes and cinder) or ``PUBLIC_NETWORK_NAME``
105+
(nova-network and quantum)
106+
* Variables that can not be cleanly declared in a project file due to
107+
dependency ordering, i.e. the order of sourcing the project files can
108+
not be changed for other reasons but the earlier file needs to dereference a
109+
variable set in the later file. This should be rare.
110+
111+
Also, variable declarations in ``stackrc`` do NOT allow overriding (the form
112+
``FOO=${FOO:-baz}``); if they did then they can already be changed in ``localrc``
113+
and can stay in the project file.
74114

75115
Documentation
76116
-------------

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ If the EC2 API is your cup-o-tea, you can create credentials and use euca2ools:
5757

5858
You can override environment variables used in `stack.sh` by creating file name `localrc`. 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.
5959

60+
# Database Backend
61+
62+
Multiple database backends are available. The available databases are defined in the lib/databases directory.
63+
To choose a database backend, add a line to your `localrc` like:
64+
65+
use_database postgresql
66+
67+
By default, the mysql database backend is used.
68+
6069
# RPC Backend
6170

6271
Multiple RPC backends are available. Currently, this

exercise.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ skips=""
2828

2929
# Loop over each possible script (by basename)
3030
for script in $basenames; do
31-
if [[ "$SKIP_EXERCISES" =~ $script ]] ; then
31+
if [[ ,$SKIP_EXERCISES, =~ ,$script, ]] ; then
3232
skips="$skips $script"
3333
else
3434
echo "====================================================================="

exerciserc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ export VOLUME_TIMEOUT=${VOLUME_TIMEOUT:-30}
2626

2727
# Max time to wait for a euca-delete command to propogate
2828
export VOLUME_DELETE_TIMEOUT=${SNAPSHOT_DELETE_TIMEOUT:-60}
29+
30+
# The size of the volume we want to boot from; some storage back-ends
31+
# do not allow a disk resize, so it's important that this can be tuned
32+
export DEFAULT_VOLUME_SIZE=${DEFAULT_VOLUME_SIZE:-1}

exercises/aggregates.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ META_DATA_1_KEY=asdf
9999
META_DATA_2_KEY=foo
100100
META_DATA_3_KEY=bar
101101

102-
#ensure no metadata is set
103-
nova aggregate-details $AGGREGATE_ID | grep {}
102+
#ensure no additional metadata is set
103+
nova aggregate-details $AGGREGATE_ID | egrep "{u'availability_zone': u'$AGGREGATE_A_ZONE'}|{}"
104104

105105
nova aggregate-set-metadata $AGGREGATE_ID ${META_DATA_1_KEY}=123
106106
nova aggregate-details $AGGREGATE_ID | grep $META_DATA_1_KEY
@@ -117,7 +117,7 @@ nova aggregate-details $AGGREGATE_ID | grep $META_DATA_3_KEY
117117
nova aggregate-details $AGGREGATE_ID | grep $META_DATA_2_KEY && die "ERROR metadata was not cleared"
118118

119119
nova aggregate-set-metadata $AGGREGATE_ID $META_DATA_3_KEY $META_DATA_1_KEY
120-
nova aggregate-details $AGGREGATE_ID | grep {}
120+
nova aggregate-details $AGGREGATE_ID | egrep "{u'availability_zone': u'$AGGREGATE_A_ZONE'}|{}"
121121

122122

123123
# Test aggregate-add/remove-host

exercises/boot_from_volume.sh

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ source $TOP_DIR/functions
3232
# Import configuration
3333
source $TOP_DIR/openrc
3434

35+
# Import quantum functions if needed
36+
if is_service_enabled quantum; then
37+
source $TOP_DIR/lib/quantum
38+
fi
39+
3540
# Import exercise configuration
3641
source $TOP_DIR/exerciserc
3742

38-
# If cinder or n-vol are not enabled we exit with exitcode 55 so that
43+
# If cinder is not enabled we exit with exitcode 55 so that
3944
# the exercise is skipped
40-
is_service_enabled cinder n-vol || exit 55
45+
is_service_enabled cinder || exit 55
4146

4247
# Boot this image, use first AMI image if unset
4348
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ami}
@@ -95,7 +100,7 @@ nova keypair-add $KEY_NAME > $KEY_FILE
95100
chmod 600 $KEY_FILE
96101

97102
# Delete the old volume
98-
nova volume-delete $VOL_NAME || true
103+
cinder delete $VOL_NAME || true
99104

100105
# Free every floating ips - setting FREE_ALL_FLOATING_IPS=True in localrc will make life easier for testers
101106
if [ "$FREE_ALL_FLOATING_IPS" = "True" ]; then
@@ -112,15 +117,15 @@ if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep -q $
112117
fi
113118

114119
# Create the bootable volume
115-
nova volume-create --display_name=$VOL_NAME --image-id $IMAGE 1
120+
cinder create --display_name=$VOL_NAME --image-id $IMAGE $DEFAULT_VOLUME_SIZE
116121

117122
# Wait for volume to activate
118-
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova volume-list | grep $VOL_NAME | grep available; do sleep 1; done"; then
123+
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! cinder list | grep $VOL_NAME | grep available; do sleep 1; done"; then
119124
echo "Volume $VOL_NAME not created"
120125
exit 1
121126
fi
122127

123-
VOLUME_ID=`nova volume-list | grep $VOL_NAME | get_field 1`
128+
VOLUME_ID=`cinder list | grep $VOL_NAME | get_field 1`
124129

125130
# Boot instance from volume! This is done with the --block_device_mapping param.
126131
# The format of mapping is:
@@ -139,16 +144,10 @@ fi
139144
nova add-floating-ip $VOL_VM_UUID $FLOATING_IP
140145

141146
# Test we can ping our floating ip within ASSOCIATE_TIMEOUT seconds
142-
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! ping -c1 -w1 $FLOATING_IP; do sleep 1; done"; then
143-
echo "Couldn't ping volume-backed server with floating ip"
144-
exit 1
145-
fi
147+
ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT
146148

147149
# Make sure our volume-backed instance launched
148-
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! ssh -o StrictHostKeyChecking=no -i $KEY_FILE ${DEFAULT_INSTANCE_USER}@$FLOATING_IP echo success ; do sleep 1; done"; then
149-
echo "server didn't become ssh-able!"
150-
exit 1
151-
fi
150+
ssh_check "$PUBLIC_NETWORK_NAME" $KEY_FILE $FLOATING_IP $DEFAULT_INSTANCE_USER $ACTIVE_TIMEOUT
152151

153152
# Remove floating ip from volume-backed instance
154153
nova remove-floating-ip $VOL_VM_UUID $FLOATING_IP
@@ -158,13 +157,13 @@ nova delete $VOL_INSTANCE_NAME || \
158157
die "Failure deleting instance volume $VOL_INSTANCE_NAME"
159158

160159
# Wait till our volume is no longer in-use
161-
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova volume-list | grep $VOL_NAME | grep available; do sleep 1; done"; then
160+
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! cinder list | grep $VOL_NAME | grep available; do sleep 1; done"; then
162161
echo "Volume $VOL_NAME not created"
163162
exit 1
164163
fi
165164

166165
# Delete the volume
167-
nova volume-delete $VOL_NAME || \
166+
cinder delete $VOL_NAME || \
168167
die "Failure deleting volume $VOLUME_NAME"
169168

170169
# De-allocate the floating ip

exercises/bundle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ IMAGE=bundle.img
5151
truncate -s 5M /tmp/$IMAGE
5252
euca-bundle-image -i /tmp/$IMAGE || die "Failure bundling image $IMAGE"
5353

54-
euca-upload-bundle -b $BUCKET -m /tmp/$IMAGE.manifest.xml || die "Failure uploading bundle $IMAGE to $BUCKET"
54+
euca-upload-bundle --debug -b $BUCKET -m /tmp/$IMAGE.manifest.xml || die "Failure uploading bundle $IMAGE to $BUCKET"
5555

5656
AMI=`euca-register $BUCKET/$IMAGE.manifest.xml | cut -f2`
5757
die_if_not_set AMI "Failure registering $BUCKET/$IMAGE"

exercises/euca.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ source $TOP_DIR/functions
3333
# Import EC2 configuration
3434
source $TOP_DIR/eucarc
3535

36+
# Import quantum functions if needed
37+
if is_service_enabled quantum; then
38+
source $TOP_DIR/lib/quantum
39+
fi
40+
3641
# Import exercise configuration
3742
source $TOP_DIR/exerciserc
3843

@@ -73,7 +78,7 @@ fi
7378

7479
# Volumes
7580
# -------
76-
if [[ "$ENABLED_SERVICES" =~ "n-vol" || "$ENABLED_SERVICES" =~ "c-vol" ]]; then
81+
if [[ "$ENABLED_SERVICES" =~ "c-vol" ]]; then
7782
VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
7883
die_if_not_set VOLUME_ZONE "Failure to find zone for volume"
7984

@@ -85,7 +90,7 @@ if [[ "$ENABLED_SERVICES" =~ "n-vol" || "$ENABLED_SERVICES" =~ "c-vol" ]]; then
8590
die_if_not_set VOLUME "Failure to get volume"
8691

8792
# Test volume has become available
88-
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
93+
if ! timeout $RUNNING_TIMEOUT sh -c "while ! euca-describe-volumes $VOLUME | grep -q available; do sleep 1; done"; then
8994
echo "volume didnt become available within $RUNNING_TIMEOUT seconds"
9095
exit 1
9196
fi
@@ -130,10 +135,7 @@ euca-authorize -P icmp -s 0.0.0.0/0 -t -1:-1 $SECGROUP || \
130135
die "Failure authorizing rule in $SECGROUP"
131136

132137
# Test we can ping our floating ip within ASSOCIATE_TIMEOUT seconds
133-
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! ping -c1 -w1 $FLOATING_IP; do sleep 1; done"; then
134-
echo "Couldn't ping server with floating ip"
135-
exit 1
136-
fi
138+
ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT
137139

138140
# Revoke pinging
139141
euca-revoke -P icmp -s 0.0.0.0/0 -t -1:-1 $SECGROUP || \
@@ -163,8 +165,11 @@ fi
163165
euca-terminate-instances $INSTANCE || \
164166
die "Failure terminating instance $INSTANCE"
165167

166-
# Assure it has terminated within a reasonable time
167-
if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q $INSTANCE; do sleep 1; done"; then
168+
# Assure it has terminated within a reasonable time. The behaviour of this
169+
# case changed with bug/836978. Requesting the status of an invalid instance
170+
# will now return an error message including the instance id, so we need to
171+
# filter that out.
172+
if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -ve \"\\\(InstanceNotFound\\\|InvalidInstanceID\[.\]NotFound\\\)\" | grep -q $INSTANCE; do sleep 1; done"; then
168173
echo "server didn't terminate within $TERMINATE_TIMEOUT seconds"
169174
exit 1
170175
fi

0 commit comments

Comments
 (0)