Merge branch 'master' of github.com:cloudbuilders/devstack into uec-image
This commit is contained in:
commit
5cc7ebde67
4 changed files with 52 additions and 22 deletions
49
stack.sh
49
stack.sh
|
@ -302,20 +302,31 @@ sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
|
||||||
# be owned by the installation user, we create the directory and change the
|
# be owned by the installation user, we create the directory and change the
|
||||||
# ownership to the proper user.
|
# ownership to the proper user.
|
||||||
function git_clone {
|
function git_clone {
|
||||||
# if there is an existing checkout, move it out of the way
|
|
||||||
if [[ "$RECLONE" == "yes" ]]; then
|
|
||||||
# FIXME(ja): if we were smarter we could speed up RECLONE by
|
|
||||||
# using the old git repo as the basis of our new clone...
|
|
||||||
if [ -d $2 ]; then
|
|
||||||
mv $2 /tmp/stack.`date +%s`
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $2 ]; then
|
GIT_REMOTE=$1
|
||||||
git clone $1 $2
|
GIT_DEST=$2
|
||||||
|
GIT_BRANCH=$3
|
||||||
|
|
||||||
|
# do a full clone only if the directory doesn't exist
|
||||||
|
if [ ! -d $GIT_DEST ]; then
|
||||||
|
git clone $GIT_REMOTE $GIT_DEST
|
||||||
cd $2
|
cd $2
|
||||||
# This checkout syntax works for both branches and tags
|
# This checkout syntax works for both branches and tags
|
||||||
git checkout $3
|
git checkout $GIT_BRANCH
|
||||||
|
elif [[ "$RECLONE" == "yes" ]]; then
|
||||||
|
# if it does exist then simulate what clone does if asked to RECLONE
|
||||||
|
cd $GIT_DEST
|
||||||
|
# set the url to pull from and fetch
|
||||||
|
git remote set-url origin $GIT_REMOTE
|
||||||
|
git fetch origin
|
||||||
|
# remove the existing ignored files (like pyc) as they cause breakage
|
||||||
|
# (due to the py files having older timestamps than our pyc, so python
|
||||||
|
# thinks the pyc files are correct using them)
|
||||||
|
sudo git clean -f -d
|
||||||
|
git checkout -f origin/$GIT_BRANCH
|
||||||
|
# a local branch might not exist
|
||||||
|
git branch -D $GIT_BRANCH || true
|
||||||
|
git checkout -b $GIT_BRANCH
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,11 +481,15 @@ fi
|
||||||
# Nova
|
# Nova
|
||||||
# ----
|
# ----
|
||||||
|
|
||||||
# We are going to use the sample http middleware configuration from the keystone
|
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
|
||||||
# project to launch nova. This paste config adds the configuration required
|
# We are going to use the sample http middleware configuration from the
|
||||||
# for nova to validate keystone tokens - except we need to switch the config
|
# keystone project to launch nova. This paste config adds the configuration
|
||||||
# to use our service token instead (instead of the invalid token 999888777666).
|
# required for nova to validate keystone tokens - except we need to switch
|
||||||
sudo sed -e "s,999888777666,$SERVICE_TOKEN,g" -i $KEYSTONE_DIR/examples/paste/nova-api-paste.ini
|
# the config to use our service token instead (instead of the invalid token
|
||||||
|
# 999888777666).
|
||||||
|
cp $KEYSTONE_DIR/examples/paste/nova-api-paste.ini $NOVA_DIR/bin
|
||||||
|
sed -e "s,999888777666,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then
|
||||||
|
|
||||||
|
@ -591,7 +606,7 @@ add_nova_flag "--libvirt_type=$LIBVIRT_TYPE"
|
||||||
add_nova_flag "--osapi_extensions_path=$OPENSTACKX_DIR/extensions"
|
add_nova_flag "--osapi_extensions_path=$OPENSTACKX_DIR/extensions"
|
||||||
add_nova_flag "--vncproxy_url=http://$HOST_IP:6080"
|
add_nova_flag "--vncproxy_url=http://$HOST_IP:6080"
|
||||||
add_nova_flag "--vncproxy_wwwroot=$NOVNC_DIR/"
|
add_nova_flag "--vncproxy_wwwroot=$NOVNC_DIR/"
|
||||||
add_nova_flag "--api_paste_config=$KEYSTONE_DIR/examples/paste/nova-api-paste.ini"
|
add_nova_flag "--api_paste_config=$NOVA_DIR/bin/nova-api-paste.ini"
|
||||||
add_nova_flag "--image_service=nova.image.glance.GlanceImageService"
|
add_nova_flag "--image_service=nova.image.glance.GlanceImageService"
|
||||||
add_nova_flag "--ec2_dmz_host=$EC2_DMZ_HOST"
|
add_nova_flag "--ec2_dmz_host=$EC2_DMZ_HOST"
|
||||||
add_nova_flag "--rabbit_host=$RABBIT_HOST"
|
add_nova_flag "--rabbit_host=$RABBIT_HOST"
|
||||||
|
|
|
@ -19,9 +19,6 @@ set -o xtrace
|
||||||
TOOLS_DIR=$(cd $(dirname "$0") && pwd)
|
TOOLS_DIR=$(cd $(dirname "$0") && pwd)
|
||||||
TOP_DIR=$TOOLS_DIR/..
|
TOP_DIR=$TOOLS_DIR/..
|
||||||
|
|
||||||
# Configure the root password of the vm
|
|
||||||
ROOT_PASSWORD=${ROOT_PASSWORD:-password}
|
|
||||||
|
|
||||||
# Where to store files and instances
|
# Where to store files and instances
|
||||||
KVMSTACK_DIR=${KVMSTACK_DIR:-/opt/kvmstack}
|
KVMSTACK_DIR=${KVMSTACK_DIR:-/opt/kvmstack}
|
||||||
|
|
||||||
|
@ -44,6 +41,10 @@ fi
|
||||||
# Source params
|
# Source params
|
||||||
source ./stackrc
|
source ./stackrc
|
||||||
|
|
||||||
|
# Configure the root password of the vm to be the same as ``ADMIN_PASSWORD``
|
||||||
|
ROOT_PASSWORD=${ADMIN_PASSWORD:-password}
|
||||||
|
|
||||||
|
|
||||||
# Base image (natty by default)
|
# Base image (natty by default)
|
||||||
DIST_NAME=${DIST_NAME:-natty}
|
DIST_NAME=${DIST_NAME:-natty}
|
||||||
IMAGE_FNAME=$DIST_NAME.raw
|
IMAGE_FNAME=$DIST_NAME.raw
|
||||||
|
@ -260,7 +261,7 @@ iface eth0 inet static
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# User configuration for the instance
|
# User configuration for the instance
|
||||||
chroot $ROOTFS groupadd libvirtd
|
chroot $ROOTFS groupadd libvirtd || true
|
||||||
chroot $ROOTFS useradd stack -s /bin/bash -d $DEST -G libvirtd
|
chroot $ROOTFS useradd stack -s /bin/bash -d $DEST -G libvirtd
|
||||||
cp -pr $TOOLS_DIR/.. $ROOTFS/$DEST/devstack
|
cp -pr $TOOLS_DIR/.. $ROOTFS/$DEST/devstack
|
||||||
echo "root:$ROOT_PASSWORD" | chroot $ROOTFS chpasswd
|
echo "root:$ROOT_PASSWORD" | chroot $ROOTFS chpasswd
|
||||||
|
@ -284,6 +285,15 @@ if [ "$COPYENV" = "1" ]; then
|
||||||
cp_it ~/.bashrc $ROOTFS/$DEST/.bashrc
|
cp_it ~/.bashrc $ROOTFS/$DEST/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# pre-cache uec images
|
||||||
|
for image_url in ${IMAGE_URLS//,/ }; do
|
||||||
|
IMAGE_FNAME=`basename "$image_url"`
|
||||||
|
if [ ! -f $IMAGES_DIR/$IMAGE_FNAME ]; then
|
||||||
|
wget -c $image_url -O $IMAGES_DIR/$IMAGE_FNAME
|
||||||
|
fi
|
||||||
|
cp $IMAGES_DIR/$IMAGE_FNAME $ROOTFS/$DEST/devstack/files
|
||||||
|
done
|
||||||
|
|
||||||
# Configure the runner
|
# Configure the runner
|
||||||
RUN_SH=$ROOTFS/$DEST/run.sh
|
RUN_SH=$ROOTFS/$DEST/run.sh
|
||||||
cat > $RUN_SH <<EOF
|
cat > $RUN_SH <<EOF
|
||||||
|
|
|
@ -301,6 +301,11 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
kill $TAIL_PID
|
kill $TAIL_PID
|
||||||
|
|
||||||
|
if grep -q "stack.sh failed" $ROOTFS/$DEST/run.sh.log; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Finished - Zip-a-dee Doo-dah!"
|
echo "Finished - Zip-a-dee Doo-dah!"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue