From f6705491868494fb3b78139dad23f35cd99f12c7 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Tue, 1 Nov 2011 16:04:14 -0700 Subject: [PATCH 01/64] move from exercise.sh to exercises/.. --- exercises/euca.sh | 37 ++++++++++++++++++++++++ exercise.sh => exercises/floating_ips.sh | 5 ---- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100755 exercises/euca.sh rename exercise.sh => exercises/floating_ips.sh (97%) diff --git a/exercises/euca.sh b/exercises/euca.sh new file mode 100755 index 0000000..faeffcf --- /dev/null +++ b/exercises/euca.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# **exercise.sh** - using the cloud can be fun + +# we will use the ``nova`` cli tool provided by the ``python-novaclient`` +# package +# + + +# This script exits on an error so that errors don't compound and you see +# only the first error that occured. +set -o errexit + +# Print the commands being run so that we can see the command that triggers +# an error. It is also useful for following allowing as the install occurs. +set -o xtrace + + +# Settings +# ======== + +# Use openrc + stackrc + localrc for settings +source ./openrc + +# Max time till the vm is bootable +BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} + +IMAGE=`euca-describe-images | grep machine | cut -f2` + +INSTANCE=`euca-run-instance $IMAGE | grep INSTANCE | cut -f2` + +if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then + echo "server didn't become active within $BOOT_TIMEOUT seconds" + exit 1 +fi + +euca-terminate-instances $INSTANCE diff --git a/exercise.sh b/exercises/floating_ips.sh similarity index 97% rename from exercise.sh rename to exercises/floating_ips.sh index 99b0f3b..06a2cd4 100755 --- a/exercise.sh +++ b/exercises/floating_ips.sh @@ -186,8 +186,3 @@ nova secgroup-delete $SECGROUP # FIXME: validate shutdown within 5 seconds # (nova show $NAME returns 1 or status != ACTIVE)? -# Testing Euca2ools -# ================== - -# make sure that we can describe instances -euca-describe-instances From 9f1863450e71e19bb8ff42e9a7c182c3f5f67c3d Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Tue, 1 Nov 2011 16:05:40 -0700 Subject: [PATCH 02/64] docs --- exercises/euca.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/euca.sh b/exercises/euca.sh index faeffcf..fc81af8 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash -# **exercise.sh** - using the cloud can be fun - -# we will use the ``nova`` cli tool provided by the ``python-novaclient`` -# package +# we will use the ``euca2ools`` cli tool that wraps the python boto +# library to test ec2 compatibility # - # This script exits on an error so that errors don't compound and you see # only the first error that occured. set -o errexit @@ -25,10 +22,13 @@ source ./openrc # Max time till the vm is bootable BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} +# find a machine image to boot IMAGE=`euca-describe-images | grep machine | cut -f2` +# launch it INSTANCE=`euca-run-instance $IMAGE | grep INSTANCE | cut -f2` +# assure it has booted within a reasonable time if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then echo "server didn't become active within $BOOT_TIMEOUT seconds" exit 1 From 787af01bddbaace8f83c65c273da6a62a9658a06 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Tue, 1 Nov 2011 16:44:19 -0700 Subject: [PATCH 03/64] fix sourcing of openrc --- exercises/euca.sh | 2 ++ exercises/floating_ips.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/exercises/euca.sh b/exercises/euca.sh index fc81af8..0cb5fea 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -17,7 +17,9 @@ set -o xtrace # ======== # Use openrc + stackrc + localrc for settings +pushd $(cd $(dirname "$0")/.. && pwd) source ./openrc +popd # Max time till the vm is bootable BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index 06a2cd4..edf784c 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -20,7 +20,9 @@ set -o xtrace # ======== # Use openrc + stackrc + localrc for settings +pushd $(cd $(dirname "$0")/.. && pwd) source ./openrc +popd # Get a token for clients that don't support service catalog # ========================================================== From 2599b3165ad35c9c62b5bfa543c03f2a3aecb4cd Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Fri, 4 Nov 2011 10:31:37 -0400 Subject: [PATCH 04/64] Wrap exercises with master script, with logs, and move common variables. --- exercise.sh | 24 ++++++++++++++++++++++++ exercises/euca.sh | 3 --- exercises/floating_ips.sh | 9 --------- openrc | 8 ++++++++ 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100755 exercise.sh diff --git a/exercise.sh b/exercise.sh new file mode 100755 index 0000000..de906f2 --- /dev/null +++ b/exercise.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Run everything in the exercises/ directory that isn't explicitly disabled + +# comma separated list of script basenames to skip +# to refrain from exercising euca.sh use SKIP_EXERCISES=euca +SKIP_EXERCISES=${SKIP_EXERCISES:-""} + +EXERCISE_DIR=$(dirname "$0")/exercises +basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done) + +for script in $basenames ; do + if [[ "$SKIP_EXERCISES" =~ $script ]] ; then + echo SKIPPING $script + else + echo Running $script + $EXERCISE_DIR/$script.sh 2> $script.log + if [[ $? -ne 0 ]] ; then + echo FAILED. See $script.log + else + rm $script.log + fi + fi +done diff --git a/exercises/euca.sh b/exercises/euca.sh index 0cb5fea..0d48c93 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -21,9 +21,6 @@ pushd $(cd $(dirname "$0")/.. && pwd) source ./openrc popd -# Max time till the vm is bootable -BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} - # find a machine image to boot IMAGE=`euca-describe-images | grep machine | cut -f2` diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index edf784c..5c38430 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -84,15 +84,6 @@ nova boot --flavor $FLAVOR --image $IMAGE $NAME --security_groups=$SECGROUP # Waiting for boot # ---------------- -# Max time to wait while vm goes from build to active state -ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-10} - -# Max time till the vm is bootable -BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} - -# Max time to wait for proper association and dis-association. -ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-10} - # check that the status is active within ACTIVE_TIMEOUT seconds if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova show $NAME | grep status | grep -q ACTIVE; do sleep 1; done"; then echo "server didn't become active!" diff --git a/openrc b/openrc index 324780b..db1a7d1 100644 --- a/openrc +++ b/openrc @@ -49,3 +49,11 @@ export EC2_SECRET_KEY=${ADMIN_PASSWORD:-secrete} # set log level to DEBUG (helps debug issues) # export NOVACLIENT_DEBUG=1 +# Max time till the vm is bootable +export BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} + +# Max time to wait while vm goes from build to active state +export ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-10} + +# Max time to wait for proper IP association and dis-association. +export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-10} From 9e9132ddaf77a4b858352e827da29ce214a6848d Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Fri, 4 Nov 2011 12:09:54 -0400 Subject: [PATCH 05/64] Exercises: euca bugfix, output cleanup. Don't log stderr per-exercise, because stdout is barfy anyway. Move the state of skip/pass/fail to the end of the exercise run. --- exercise.sh | 30 ++++++++++++++++++++++++++---- exercises/euca.sh | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/exercise.sh b/exercise.sh index de906f2..d776385 100755 --- a/exercise.sh +++ b/exercise.sh @@ -6,19 +6,41 @@ # to refrain from exercising euca.sh use SKIP_EXERCISES=euca SKIP_EXERCISES=${SKIP_EXERCISES:-""} +# Locate the scripts we should run EXERCISE_DIR=$(dirname "$0")/exercises basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done) +# Track the state of each script +passes="" +failures="" +skips="" + +# Loop over each possible script (by basename) for script in $basenames ; do if [[ "$SKIP_EXERCISES" =~ $script ]] ; then - echo SKIPPING $script + skips="$skips $script" else + echo ========================= echo Running $script - $EXERCISE_DIR/$script.sh 2> $script.log + echo ========================= + $EXERCISE_DIR/$script.sh if [[ $? -ne 0 ]] ; then - echo FAILED. See $script.log + failures="$failures $script" else - rm $script.log + passes="$passes $script" fi fi done + +# output status of exercise run +echo ========================= +echo ========================= +for script in $skips ; do + echo SKIP $script +done +for script in $passes ; do + echo PASS $script +done +for script in $failures ; do + echo FAILED $script +done diff --git a/exercises/euca.sh b/exercises/euca.sh index 0d48c93..bf6910d 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -25,7 +25,7 @@ popd IMAGE=`euca-describe-images | grep machine | cut -f2` # launch it -INSTANCE=`euca-run-instance $IMAGE | grep INSTANCE | cut -f2` +INSTANCE=`euca-run-instances $IMAGE | grep INSTANCE | cut -f2` # assure it has booted within a reasonable time if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then From 3e6ec236f01abaf80fe7dc8db73ecbfdf3532e89 Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Fri, 4 Nov 2011 12:23:35 -0400 Subject: [PATCH 06/64] Pull in swift testing from master. --- exercises/swift.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 exercises/swift.sh diff --git a/exercises/swift.sh b/exercises/swift.sh new file mode 100644 index 0000000..f7be099 --- /dev/null +++ b/exercises/swift.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Test swift via the command line tools that ship with it. + +# This script exits on an error so that errors don't compound and you see +# only the first error that occured. +set -o errexit + +# Print the commands being run so that we can see the command that triggers +# an error. It is also useful for following allowing as the install occurs. +set -o xtrace + + +# Settings +# ======== + +# Use openrc + stackrc + localrc for settings +pushd $(cd $(dirname "$0")/.. && pwd) +source ./openrc +popd + + +# Testing Swift +# ============= + +# Check if we have to swift via keystone +swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD stat + +# We start by creating a test container +swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD post testcontainer + +# add some files into it. +swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD upload testcontainer /etc/issue + +# list them +swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD list testcontainer + +# And we may want to delete them now that we have tested that +# everything works. +swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD delete testcontainer From 0367cf1585eb7359a6bc741aab06dc3a3750575a Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Sat, 5 Nov 2011 10:46:56 -0400 Subject: [PATCH 07/64] remove spacicolons. --- exercise.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercise.sh b/exercise.sh index d776385..7703f40 100755 --- a/exercise.sh +++ b/exercise.sh @@ -8,7 +8,7 @@ SKIP_EXERCISES=${SKIP_EXERCISES:-""} # Locate the scripts we should run EXERCISE_DIR=$(dirname "$0")/exercises -basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done) +basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done) # Track the state of each script passes="" @@ -16,7 +16,7 @@ failures="" skips="" # Loop over each possible script (by basename) -for script in $basenames ; do +for script in $basenames; do if [[ "$SKIP_EXERCISES" =~ $script ]] ; then skips="$skips $script" else @@ -35,12 +35,12 @@ done # output status of exercise run echo ========================= echo ========================= -for script in $skips ; do +for script in $skips; do echo SKIP $script done -for script in $passes ; do +for script in $passes; do echo PASS $script done -for script in $failures ; do +for script in $failures; do echo FAILED $script done From 9a3066f9fd4efae4ec838a673fe1517554e0e531 Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Sat, 5 Nov 2011 11:02:34 -0400 Subject: [PATCH 08/64] RUNNING_TIMEOUT = BOOT_TIMEOUT + ACTIVE_TIMEOUT --- exercises/euca.sh | 4 ++-- openrc | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/exercises/euca.sh b/exercises/euca.sh index bf6910d..9605ace 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -28,8 +28,8 @@ IMAGE=`euca-describe-images | grep machine | cut -f2` INSTANCE=`euca-run-instances $IMAGE | grep INSTANCE | cut -f2` # assure it has booted within a reasonable time -if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then - echo "server didn't become active within $BOOT_TIMEOUT seconds" +if ! timeout $RUNNING_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then + echo "server didn't become active within $RUNNING_TIMEOUT seconds" exit 1 fi diff --git a/openrc b/openrc index db1a7d1..4b36112 100644 --- a/openrc +++ b/openrc @@ -55,5 +55,8 @@ export BOOT_TIMEOUT=${BOOT_TIMEOUT:-15} # Max time to wait while vm goes from build to active state export ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-10} +# Max time from run instance command until it is running +export RUNNING_TIMEOUT=${RUNNING_TIMEOUT:-$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT))} + # Max time to wait for proper IP association and dis-association. export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-10} From 8b3eb5ffe31c6a112e9461f16c6955f303018f17 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 16:05:14 -0700 Subject: [PATCH 09/64] work towards simpiler uec --- tools/build_uec.sh | 198 ++++++++++++++++++++++++++++++++++++++++++++ tools/uec/meta-data | 19 +++++ tools/uec/user-data | 32 +++++++ 3 files changed, 249 insertions(+) create mode 100755 tools/build_uec.sh create mode 100644 tools/uec/meta-data create mode 100644 tools/uec/user-data diff --git a/tools/build_uec.sh b/tools/build_uec.sh new file mode 100755 index 0000000..aae4fb8 --- /dev/null +++ b/tools/build_uec.sh @@ -0,0 +1,198 @@ +#!/usr/bin/env bash + +# Make sure that we have the proper version of ubuntu +UBUNTU_VERSION=`cat /etc/lsb-release | grep CODENAME | sed 's/.*=//g'` +if [ ! "oneiric" = "$UBUNTU_VERSION" ]; then + if [ ! "natty" = "$UBUNTU_VERSION" ]; then + echo "This script only works with oneiric and natty" + exit 1 + fi +fi + +# exit on error to stop unexpected errors +set -o errexit + +# Keep track of the current directory +TOOLS_DIR=$(cd $(dirname "$0") && pwd) +TOP_DIR=`cd $TOOLS_DIR/..; pwd` + +# Abort if localrc is not set +if [ ! -e $TOP_DIR/localrc ]; then + echo "You must have a localrc with ALL necessary passwords defined before proceeding." + echo "See stack.sh for required passwords." + exit 1 +fi + +# Install deps if needed +dpkg -l kvm libvirt-bin kpartx || apt-get install -y --force-yes kvm libvirt-bin kpartx + +# Where to store files and instances +WORK_DIR=${WORK_DIR:-/opt/kvmstack} + +# Where to store images +IMAGES_DIR=$WORK_DIR/images + +# Original version of built image +DIST_NAME=${DIST_NAME:oneiric} +UEC_NAME=$DIST_NAME-server-cloudimg-amd64 +UEC_URL=http://uec-images.ubuntu.com/$DIST_NAME/current/$UEC_NAME-disk1.img +BASE_IMAGE=$IMAGES_DIR/$DIST_NAME.raw + +# download the base uec image if we haven't already +if [ ! -e $BASE_IMAGE ]; then + mkdir -p $IMAGES_DIR + curl $UEC_URL -O $BASE_IMAGE +fi + +cd $TOP_DIR + +# Source params +source ./stackrc + +# Configure the root password of the vm to be the same as ``ADMIN_PASSWORD`` +ROOT_PASSWORD=${ADMIN_PASSWORD:-password} + +# Name of our instance, used by libvirt +GUEST_NAME=${GUEST_NAME:-devstack} + +# Mop up after previous runs +virsh destroy $GUEST_NAME || true + +# Where this vm is stored +VM_DIR=$WORK_DIR/instances/$GUEST_NAME + +# Create vm dir and remove old disk +mkdir -p $VM_DIR +rm -f $VM_DIR/disk.img + +# Create a copy of the base image +qemu-img create -f qcow2 -b ${BASE_IMAGE} $VM_DIR/disk.img + +# Back to devstack +cd $TOP_DIR + +GUEST_NETWORK=${GUEST_NETWORK:-1} +GUEST_RECREATE_NET=${GUEST_RECREATE_NET:-yes} +GUEST_IP=${GUEST_IP:-192.168.$GUEST_NETWORK.50} +GUEST_CIDR=${GUEST_CIDR:-$GUEST_IP/24} +GUEST_NETMASK=${GUEST_NETMASK:-255.255.255.0} +GUEST_GATEWAY=${GUEST_GATEWAY:-192.168.$GUEST_NETWORK.1} +GUEST_MAC=${GUEST_MAC:-"02:16:3e:07:69:`printf '%02X' $GUEST_NETWORK`"} +GUEST_RAM=${GUEST_RAM:-1524288} +GUEST_CORES=${GUEST_CORES:-1} + +# libvirt.xml configuration +NET_XML=$VM_DIR/net.xml +cat > $NET_XML < + devstack-$GUEST_NETWORK + + + + +EOF + +if [[ "$GUEST_RECREATE_NET" == "yes" ]]; then + virsh net-destroy devstack-$GUEST_NETWORK || true + virsh net-create $VM_DIR/net.xml +fi + +# libvirt.xml configuration +LIBVIRT_XML=$VM_DIR/libvirt.xml +cat > $LIBVIRT_XML < + $GUEST_NAME + $GUEST_RAM + + hvm + + $VM_DIR/kernel + root=/dev/vda ro init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu + + + + + + $GUEST_CORES + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF + +# Create the instance +cd $VM_DIR && virsh create libvirt.xml + +# Tail the console log till we are done +WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1} +if [ "$WAIT_TILL_LAUNCH" = "1" ]; then + # Done creating the container, let's tail the log + echo + echo "=============================================================" + echo " -- YAY! --" + echo "=============================================================" + echo + echo "We're done launching the vm, about to start tailing the" + echo "stack.sh log. It will take a second or two to start." + echo + echo "Just CTRL-C at any time to stop tailing." + + while [ ! -e "$VM_DIR/console.log" ]; do + sleep 1 + done + + tail -F $VM_DIR/console.log & + + TAIL_PID=$! + + function kill_tail() { + kill $TAIL_PID + exit 1 + } + + # Let Ctrl-c kill tail and exit + trap kill_tail SIGINT + + set +o xtrace + + echo "Waiting stack.sh to finish..." + while ! cat $VM_DIR/console.log | grep -q 'All done' ; do + sleep 1 + done + + set -o xtrace + + kill $TAIL_PID + + if ! grep -q "^stack.sh completed in" $VM_DIR/console.log; then + exit 1 + fi + echo "" + echo "Finished - Zip-a-dee Doo-dah!" +fi diff --git a/tools/uec/meta-data b/tools/uec/meta-data new file mode 100644 index 0000000..d068195 --- /dev/null +++ b/tools/uec/meta-data @@ -0,0 +1,19 @@ +#ami-id: ami-fd4aa494 +#ami-launch-index: '0' +#ami-manifest-path: ubuntu-images-us/ubuntu-lucid-10.04-amd64-server-20100427.1.manifest.xml +#block-device-mapping: {ami: sda1, ephemeral0: sdb, ephemeral1: sdc, root: /dev/sda1} +hostname: smoser-sys +#instance-action: none +instance-id: i-87018aed +instance-type: m1.large +#kernel-id: aki-c8b258a1 +local-hostname: smoser-sys.mosers.us +#local-ipv4: 10.223.26.178 +#placement: {availability-zone: us-east-1d} +#public-hostname: ec2-184-72-174-120.compute-1.amazonaws.com +#public-ipv4: 184.72.174.120 +#public-keys: +# ec2-keypair.us-east-1: [ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCD9dlT00vOUC8Ttq6YH8RzUCVqPQl6HaSfWSTKYnZiVCpTBj1CaRZPLRLmkSB9Nziy4aRJa/LZMbBHXytQKnB1psvNknqC2UNlrXXMk+Vx5S4vg21MXYYimK4uZEY0Qz29QUiTyNsx18jpAaF4ocUpTpRhxPEBCcSCDmMbc27MU2XuTbasM2NjW/w0bBF3ZFhdH68dZICXdTxS2jUrtrCnc1D/QXVZ5kQO3jsmSyJg8E0nE+6Onpx2YRoVRSwjpGzVZ+BlXPnN5xBREBG8XxzhNFHJbek+RgK5TfL+k4yD4XhnVZuZu53cBAFhj+xPKhtisSd+YmaEq+Jt9uS0Ekd5 +# ec2-keypair.us-east-1, ''] +#reservation-id: r-e2225889 +#security-groups: default diff --git a/tools/uec/user-data b/tools/uec/user-data new file mode 100644 index 0000000..f9fa477 --- /dev/null +++ b/tools/uec/user-data @@ -0,0 +1,32 @@ +#cloud-config +#apt_update: false +#apt_upgrade: true +#packages: [ bzr, pastebinit, ubuntu-dev-tools, ccache, bzr-builddeb, vim-nox, git-core, lftp ] + +apt_sources: + - source: ppa:smoser/ppa + +disable_root: True + +mounts: + - [ ephemeral0, None ] + - [ swap, None ] + +ssh_import_id: [smoser ] + +sm_misc: + - &user_setup | + set -x; exec > ~/user_setup.log 2>&1 + echo "starting at $(date -R)" + echo "set -o vi" >> ~/.bashrc + cat >> ~/.profile < ~/runcmd.log' ] + - [ sudo, -Hu, ubuntu, sh, -c, 'read up sleep < /proc/uptime; echo $(date): runcmd up at $up | tee -a ~/runcmd.log' ] + - [ sudo, -Hu, ubuntu, sh, -c, *user_setup ] + +password: passw0rd +chpasswd: { expire: False } From 5f039326268cf452aa45c011b8ec4552fb49a578 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Sat, 5 Nov 2011 16:12:20 -0700 Subject: [PATCH 10/64] make some changes prepping for trunk branch --- files/nova-api-paste.ini | 127 +++++++++++++++++++++++++++++++++++++++ stack.sh | 34 ++++++----- 2 files changed, 145 insertions(+), 16 deletions(-) create mode 100644 files/nova-api-paste.ini diff --git a/files/nova-api-paste.ini b/files/nova-api-paste.ini new file mode 100644 index 0000000..0b56c9f --- /dev/null +++ b/files/nova-api-paste.ini @@ -0,0 +1,127 @@ +####### +# EC2 # +####### + +[composite:ec2] +use = egg:Paste#urlmap +/: ec2versions +/services/Cloud: ec2cloud +/services/Admin: ec2admin +/latest: ec2metadata +/2007-01-19: ec2metadata +/2007-03-01: ec2metadata +/2007-08-29: ec2metadata +/2007-10-10: ec2metadata +/2007-12-15: ec2metadata +/2008-02-01: ec2metadata +/2008-09-01: ec2metadata +/2009-04-04: ec2metadata +/1.0: ec2metadata + +[pipeline:ec2cloud] +pipeline = logrequest totoken authtoken keystonecontext cloudrequest authorizer ec2executor + +[pipeline:ec2admin] +pipeline = logrequest totoken authtoken keystonecontext adminrequest authorizer ec2executor + +[pipeline:ec2metadata] +pipeline = logrequest ec2md + +[pipeline:ec2versions] +pipeline = logrequest ec2ver + +[filter:logrequest] +paste.filter_factory = nova.api.ec2:RequestLogging.factory + +[filter:ec2lockout] +paste.filter_factory = nova.api.ec2:Lockout.factory + +[filter:totoken] +paste.filter_factory = keystone.middleware.ec2_token:EC2Token.factory + +[filter:ec2noauth] +paste.filter_factory = nova.api.ec2:NoAuth.factory + +[filter:authenticate] +paste.filter_factory = nova.api.ec2:Authenticate.factory + +[filter:cloudrequest] +controller = nova.api.ec2.cloud.CloudController +paste.filter_factory = nova.api.ec2:Requestify.factory + +[filter:adminrequest] +controller = nova.api.ec2.admin.AdminController +paste.filter_factory = nova.api.ec2:Requestify.factory + +[filter:authorizer] +paste.filter_factory = nova.api.ec2:Authorizer.factory + +[app:ec2executor] +paste.app_factory = nova.api.ec2:Executor.factory + +[app:ec2ver] +paste.app_factory = nova.api.ec2:Versions.factory + +[app:ec2md] +paste.app_factory = nova.api.ec2.metadatarequesthandler:MetadataRequestHandler.factory + +############# +# Openstack # +############# + +[composite:osapi] +use = egg:Paste#urlmap +/: osversions +/v1.0: openstackapi10 +/v1.1: openstackapi11 + +[pipeline:openstackapi10] +pipeline = faultwrap authtoken keystonecontext ratelimit osapiapp10 + +[pipeline:openstackapi11] +pipeline = faultwrap authtoken keystonecontext ratelimit extensions osapiapp11 + +[filter:faultwrap] +paste.filter_factory = nova.api.openstack:FaultWrapper.factory + +[filter:auth] +paste.filter_factory = nova.api.openstack.auth:AuthMiddleware.factory + +[filter:noauth] +paste.filter_factory = nova.api.openstack.auth:NoAuthMiddleware.factory + +[filter:ratelimit] +paste.filter_factory = nova.api.openstack.limits:RateLimitingMiddleware.factory + +[filter:extensions] +paste.filter_factory = nova.api.openstack.extensions:ExtensionMiddleware.factory + +[app:osapiapp10] +paste.app_factory = nova.api.openstack:APIRouterV10.factory + +[app:osapiapp11] +paste.app_factory = nova.api.openstack:APIRouterV11.factory + +[pipeline:osversions] +pipeline = faultwrap osversionapp + +[app:osversionapp] +paste.app_factory = nova.api.openstack.versions:Versions.factory + +########## +# Shared # +########## + +[filter:keystonecontext] +paste.filter_factory = keystone.middleware.nova_keystone_context:NovaKeystoneContext.factory + +[filter:authtoken] +paste.filter_factory = keystone.middleware.auth_token:filter_factory +service_protocol = http +service_host = 127.0.0.1 +service_port = 5000 +auth_host = 127.0.0.1 +auth_port = 35357 +auth_protocol = http +auth_uri = http://127.0.0.1:5000/ +admin_token = 999888777666 diff --git a/stack.sh b/stack.sh index 32b4539..da097bd 100755 --- a/stack.sh +++ b/stack.sh @@ -230,7 +230,7 @@ VLAN_INTERFACE=${VLAN_INTERFACE:-$PUBLIC_INTERFACE} # Multi-host is a mode where each compute node runs its own network node. This # allows network operations and routing for a VM to occur on the server that is # running the VM - removing a SPOF and bandwidth bottleneck. -MULTI_HOST=${MULTI_HOST:-0} +MULTI_HOST=${MULTI_HOST:-False} # If you are using FlatDHCP on multiple hosts, set the ``FLAT_INTERFACE`` # variable but make sure that the interface doesn't already have an @@ -323,7 +323,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then # can never change. read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH." fi - + # Keystone # -------- @@ -567,8 +567,10 @@ if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then # required for nova to validate keystone tokens - except we need to switch # 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 + if [ ! -e $NOVA_DIR/bin/nova-api-paste.ini ]; then + cp $FILES/nova-api-paste.ini $NOVA_DIR/bin + sed -e "s,999888777666,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini + fi fi if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then @@ -650,13 +652,13 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then USER_GROUP=$(id -g) sudo mkdir -p ${SWIFT_DATA_LOCATION}/drives sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_LOCATION}/drives - + # We then create a loopback disk and format it to XFS. if [[ ! -e ${SWIFT_DATA_LOCATION}/drives/images/swift.img ]];then mkdir -p ${SWIFT_DATA_LOCATION}/drives/images sudo touch ${SWIFT_DATA_LOCATION}/drives/images/swift.img sudo chown $USER: ${SWIFT_DATA_LOCATION}/drives/images/swift.img - + dd if=/dev/zero of=${SWIFT_DATA_LOCATION}/drives/images/swift.img \ bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE} mkfs.xfs -f -i size=1024 ${SWIFT_DATA_LOCATION}/drives/images/swift.img @@ -673,9 +675,9 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then # We then create link to that mounted location so swift would know # where to go. for x in {1..4}; do sudo ln -sf ${SWIFT_DATA_LOCATION}/drives/sdb1/$x ${SWIFT_DATA_LOCATION}/$x; done - + # We now have to emulate a few different servers into one we - # create all the directories needed for swift + # create all the directories needed for swift tmpd="" for d in ${SWIFT_DATA_LOCATION}/drives/sdb1/{1..4} \ ${SWIFT_CONFIG_LOCATION}/{object,container,account}-server \ @@ -691,7 +693,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then # swift-init has a bug using /etc/swift until bug #885595 is fixed # we have to create a link sudo ln -s ${SWIFT_CONFIG_LOCATION} /etc/swift - + # Swift use rsync to syncronize between all the different # partitions (which make more sense when you have a multi-node # setup) we configure it with our version of rsync. @@ -727,7 +729,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then local bind_port=$2 local log_facility=$3 local node_number - + for node_number in {1..4};do node_path=${SWIFT_DATA_LOCATION}/${node_number} sed -e "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},;s,%USER%,$USER,;s,%NODE_PATH%,${node_path},;s,%BIND_PORT%,${bind_port},;s,%LOG_FACILITY%,${log_facility}," \ @@ -754,14 +756,14 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then # We then can start rsync. sudo /etc/init.d/rsync restart || : - + # Create our ring for the object/container/account. /usr/local/bin/swift-remakerings # And now we launch swift-startmain to get our cluster running # ready to be tested. /usr/local/bin/swift-startmain || : - + unset s swift_hash swift_auth_server tmpd fi @@ -828,12 +830,12 @@ add_nova_flag "--glance_api_servers=$GLANCE_HOSTPORT" if [ -n "$INSTANCES_PATH" ]; then add_nova_flag "--instances_path=$INSTANCES_PATH" fi -if [ -n "$MULTI_HOST" ]; then - add_nova_flag "--multi_host=$MULTI_HOST" - add_nova_flag "--send_arp_for_ha=1" +if [ "$MULTI_HOST" != "False" ]; then + add_nova_flag "--multi_host" + add_nova_flag "--send_arp_for_ha" fi if [ "$SYSLOG" != "False" ]; then - add_nova_flag "--use_syslog=1" + add_nova_flag "--use_syslog" fi # XenServer From 228f246a838ace75b620292f46f746aee1035c48 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 17:36:14 -0700 Subject: [PATCH 11/64] work towards booting --- tools/build_uec.sh | 69 +++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index aae4fb8..24422af 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash -# Make sure that we have the proper version of ubuntu +# Ubuntu distro to install +DIST_NAME=${DIST_NAME:-oneiric} + +# Make sure that we have the proper version of ubuntu (only works on natty/oneiric) UBUNTU_VERSION=`cat /etc/lsb-release | grep CODENAME | sed 's/.*=//g'` if [ ! "oneiric" = "$UBUNTU_VERSION" ]; then if [ ! "natty" = "$UBUNTU_VERSION" ]; then @@ -9,13 +12,14 @@ if [ ! "oneiric" = "$UBUNTU_VERSION" ]; then fi fi -# exit on error to stop unexpected errors -set -o errexit - # Keep track of the current directory TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=`cd $TOOLS_DIR/..; pwd` +# exit on error to stop unexpected errors +set -o errexit +set -o xtrace + # Abort if localrc is not set if [ ! -e $TOP_DIR/localrc ]; then echo "You must have a localrc with ALL necessary passwords defined before proceeding." @@ -30,18 +34,19 @@ dpkg -l kvm libvirt-bin kpartx || apt-get install -y --force-yes kvm libvirt-bin WORK_DIR=${WORK_DIR:-/opt/kvmstack} # Where to store images -IMAGES_DIR=$WORK_DIR/images +image_dir=$WORK_DIR/images/$DIST_NAME +mkdir -p $image_dir # Original version of built image -DIST_NAME=${DIST_NAME:oneiric} -UEC_NAME=$DIST_NAME-server-cloudimg-amd64 -UEC_URL=http://uec-images.ubuntu.com/$DIST_NAME/current/$UEC_NAME-disk1.img -BASE_IMAGE=$IMAGES_DIR/$DIST_NAME.raw +uec_url=http://uec-images.ubuntu.com/$DIST_NAME/current/$DIST_NAME-server-cloudimg-amd64.tar.gz +tarball=$image_dir/$(basename $UEC_URL) # download the base uec image if we haven't already -if [ ! -e $BASE_IMAGE ]; then - mkdir -p $IMAGES_DIR - curl $UEC_URL -O $BASE_IMAGE +if [ ! -f $tarball ]; then + curl $uec_url -o $tarball + tar -Sxvzf $tarball $image_dir + cp $image_dir/*.img $image_dir/disk + cp $image_dir/*-vmlinuz-virtual $image_dir/kernel fi cd $TOP_DIR @@ -59,14 +64,16 @@ GUEST_NAME=${GUEST_NAME:-devstack} virsh destroy $GUEST_NAME || true # Where this vm is stored -VM_DIR=$WORK_DIR/instances/$GUEST_NAME +vm_dir=$WORK_DIR/instances/$GUEST_NAME # Create vm dir and remove old disk -mkdir -p $VM_DIR -rm -f $VM_DIR/disk.img +mkdir -p $vm_dir +rm -f $vm_dir/disk # Create a copy of the base image -qemu-img create -f qcow2 -b ${BASE_IMAGE} $VM_DIR/disk.img +# qemu-img create -f qcow2 -b ${BASE_IMAGE} $vm_dir/disk +cp $image_dir/disk $vm_dir/disk +cp $image_dir/kernel $vm_dir/kernel # Back to devstack cd $TOP_DIR @@ -82,7 +89,7 @@ GUEST_RAM=${GUEST_RAM:-1524288} GUEST_CORES=${GUEST_CORES:-1} # libvirt.xml configuration -NET_XML=$VM_DIR/net.xml +NET_XML=$vm_dir/net.xml cat > $NET_XML < devstack-$GUEST_NETWORK @@ -94,20 +101,19 @@ EOF if [[ "$GUEST_RECREATE_NET" == "yes" ]]; then virsh net-destroy devstack-$GUEST_NETWORK || true - virsh net-create $VM_DIR/net.xml + virsh net-create $vm_dir/net.xml fi # libvirt.xml configuration -LIBVIRT_XML=$VM_DIR/libvirt.xml +LIBVIRT_XML=$vm_dir/libvirt.xml cat > $LIBVIRT_XML < $GUEST_NAME $GUEST_RAM - hvm - - $VM_DIR/kernel - root=/dev/vda ro init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu + hvm + $vm_dir/kernel + root=/dev/vda console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu @@ -117,7 +123,7 @@ cat > $LIBVIRT_XML < - + @@ -127,7 +133,7 @@ cat > $LIBVIRT_XML < - + @@ -147,11 +153,12 @@ cat > $LIBVIRT_XML < Date: Sat, 5 Nov 2011 17:37:33 -0700 Subject: [PATCH 12/64] uec_url should be underscore --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 24422af..53ada3e 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -39,7 +39,7 @@ mkdir -p $image_dir # Original version of built image uec_url=http://uec-images.ubuntu.com/$DIST_NAME/current/$DIST_NAME-server-cloudimg-amd64.tar.gz -tarball=$image_dir/$(basename $UEC_URL) +tarball=$image_dir/$(basename $uec_url) # download the base uec image if we haven't already if [ ! -f $tarball ]; then From 3b7685823ca62469499f6e4354cce8cfea6e8ee1 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 17:40:20 -0700 Subject: [PATCH 13/64] extract tarball in image dir --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 53ada3e..accc37b 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -44,7 +44,7 @@ tarball=$image_dir/$(basename $uec_url) # download the base uec image if we haven't already if [ ! -f $tarball ]; then curl $uec_url -o $tarball - tar -Sxvzf $tarball $image_dir + (cd $image_dir && tar -Sxvzf $tarball) cp $image_dir/*.img $image_dir/disk cp $image_dir/*-vmlinuz-virtual $image_dir/kernel fi From f5a76919b3da9a6a4c3a9a84b2455293b91e2711 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 17:47:50 -0700 Subject: [PATCH 14/64] closer to fine --- tools/build_uec.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index accc37b..5d93da3 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -71,9 +71,7 @@ mkdir -p $vm_dir rm -f $vm_dir/disk # Create a copy of the base image -# qemu-img create -f qcow2 -b ${BASE_IMAGE} $vm_dir/disk -cp $image_dir/disk $vm_dir/disk -cp $image_dir/kernel $vm_dir/kernel +qemu-img create -f qcow2 -b $image_dir/disk $vm_dir/disk # Back to devstack cd $TOP_DIR @@ -112,8 +110,8 @@ cat > $LIBVIRT_XML <$GUEST_RAM hvm - $vm_dir/kernel - root=/dev/vda console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu + $image_dir/kernel + root=/dev/vda ro console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu From a6282623449666f945d6a3e569513486513eb9cf Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 18:39:33 -0700 Subject: [PATCH 15/64] let dhcp work --- tools/build_uec.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 5d93da3..5f85486 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -93,7 +93,11 @@ cat > $NET_XML <devstack-$GUEST_NETWORK - + + + + + EOF From 63fa7abd561d401df613a9611ab125737895563e Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 18:49:36 -0700 Subject: [PATCH 16/64] tweaks --- tools/build_uec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 5f85486..7d344f0 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -95,7 +95,7 @@ cat > $NET_XML < - + @@ -155,7 +155,7 @@ cat > $LIBVIRT_XML < Date: Sat, 5 Nov 2011 22:15:50 -0700 Subject: [PATCH 17/64] simple metadata service --- tools/uec/meta.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/uec/meta.py diff --git a/tools/uec/meta.py b/tools/uec/meta.py new file mode 100644 index 0000000..5b845d8 --- /dev/null +++ b/tools/uec/meta.py @@ -0,0 +1,29 @@ +import sys +from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +from SimpleHTTPServer import SimpleHTTPRequestHandler + +def main(host, port, HandlerClass = SimpleHTTPRequestHandler, + ServerClass = HTTPServer, protocol="HTTP/1.0"): + """simple http server that listens on a give address:port""" + + server_address = (host, port) + + HandlerClass.protocol_version = protocol + httpd = ServerClass(server_address, HandlerClass) + + sa = httpd.socket.getsockname() + print "Serving HTTP on", sa[0], "port", sa[1], "..." + httpd.serve_forever() + +if __name__ == '__main__': + if sys.argv[1:]: + address = sys.argv[1] + else: + address = '0.0.0.0' + if ':' in address: + host, port = address.split(':') + else: + host = address + port = 8080 + + main(host, int(port)) From 9ed6bbd503469e23bbe03b4ec15c955a07a47e9d Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:28:46 -0700 Subject: [PATCH 18/64] attempt to run the metadata service --- tools/build_uec.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 7d344f0..9b67cf2 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -115,7 +115,7 @@ cat > $LIBVIRT_XML < hvm $image_dir/kernel - root=/dev/vda ro console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu + root=/dev/vda ro console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud-net;s=http://192.168.$GUEST.1:4567/ ubuntu-pass=ubuntu @@ -154,6 +154,10 @@ cat > $LIBVIRT_XML < EOF +cp -r $TOOLS_DIR/uec $vm_dir/uec + +(cd $vm_dir/uec; python meta.py 192.168.$GUEST_NETWORK.1:4567 &) + # Create the instance virsh create $vm_dir/libvirt.xml From f504e281c0e1563f7d2d1c6faa6c6f820a2982af Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:29:35 -0700 Subject: [PATCH 19/64] don't need to spawn a bash --- tools/build_uec.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 9b67cf2..4ef2d04 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -156,7 +156,8 @@ EOF cp -r $TOOLS_DIR/uec $vm_dir/uec -(cd $vm_dir/uec; python meta.py 192.168.$GUEST_NETWORK.1:4567 &) +cd $vm_dir/uec +python meta.py 192.168.$GUEST_NETWORK.1:4567 & # Create the instance virsh create $vm_dir/libvirt.xml From 438ea577c4a27570ff402087cfbede07b888e239 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:33:49 -0700 Subject: [PATCH 20/64] typo --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 4ef2d04..efae619 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -115,7 +115,7 @@ cat > $LIBVIRT_XML < hvm $image_dir/kernel - root=/dev/vda ro console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud-net;s=http://192.168.$GUEST.1:4567/ ubuntu-pass=ubuntu + root=/dev/vda ro console=ttyS0 init=/usr/lib/cloud-init/uncloud-init ds=nocloud-net;s=http://192.168.$GUEST_NETWORK.1:4567/ ubuntu-pass=ubuntu From e49f751aa9b495f7e2f19f5a82caff6aec27da18 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:34:45 -0700 Subject: [PATCH 21/64] force the uec to be recreated --- tools/build_uec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index efae619..0a82103 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -154,6 +154,7 @@ cat > $LIBVIRT_XML < EOF +rm -rf $vm_dir/uec cp -r $TOOLS_DIR/uec $vm_dir/uec cd $vm_dir/uec From ee34f62ba7b552062388df1520287d856d216c8d Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:41:57 -0700 Subject: [PATCH 22/64] kill the old metadata process --- tools/build_uec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 0a82103..b4052f2 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -157,6 +157,8 @@ EOF rm -rf $vm_dir/uec cp -r $TOOLS_DIR/uec $vm_dir/uec +# (re)start a metadata service +`lsof -i -n | grep 192.168.$GUEST_NETWORK.1:4567 | awk '{print $2}' | xargs -n1 kill -9` cd $vm_dir/uec python meta.py 192.168.$GUEST_NETWORK.1:4567 & From d7ce7afe0fc67e40ff5c711794ef31d3f7a3031c Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:47:28 -0700 Subject: [PATCH 23/64] set the hostname --- tools/build_uec.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index b4052f2..719d268 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -154,11 +154,20 @@ cat > $LIBVIRT_XML < EOF + rm -rf $vm_dir/uec cp -r $TOOLS_DIR/uec $vm_dir/uec +# set metadata +cat > $vm_dir/uec/meta-data< Date: Sat, 5 Nov 2011 22:49:51 -0700 Subject: [PATCH 24/64] switch lsof syntax --- tools/build_uec.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 719d268..61709ab 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -166,8 +166,7 @@ instance-type: m1.large EOF # (re)start a metadata service -#lsof -iTCP:4567 -sTCP:LISTEN -n -lsof -i -n | grep 192.168.$GUEST_NETWORK.1:4567 | awk '{print $2}' | xargs -n1 kill -9 +lsof -iTCP@192.168.$GUEST_NETWORK.1:4567 -n | awk '{print $2}' | xargs -n1 kill -9 cd $vm_dir/uec python meta.py 192.168.$GUEST_NETWORK.1:4567 & From 3ce79aa55bdadd4be53cee8ad9c0ef5da0ad3749 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:52:20 -0700 Subject: [PATCH 25/64] improve kill --- tools/build_uec.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 61709ab..b7567f6 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -166,7 +166,10 @@ instance-type: m1.large EOF # (re)start a metadata service -lsof -iTCP@192.168.$GUEST_NETWORK.1:4567 -n | awk '{print $2}' | xargs -n1 kill -9 +( + pid=`lsof -iTCP@192.168.$GUEST_NETWORK.1:4567 -n | awk '{print $2}' | tail -1` + [ "$pid" == "PID" ] || kill -9 $pid +) cd $vm_dir/uec python meta.py 192.168.$GUEST_NETWORK.1:4567 & From cc03cc8d58514a4c88579791fdfa0559569f9818 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 22:54:54 -0700 Subject: [PATCH 26/64] kill works --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index b7567f6..89d4661 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -168,7 +168,7 @@ EOF # (re)start a metadata service ( pid=`lsof -iTCP@192.168.$GUEST_NETWORK.1:4567 -n | awk '{print $2}' | tail -1` - [ "$pid" == "PID" ] || kill -9 $pid + [ ! -e $pid ] || kill -9 $pid ) cd $vm_dir/uec python meta.py 192.168.$GUEST_NETWORK.1:4567 & From 9645b0c9c9d862a585e8923cad79e916f7585b6e Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 23:05:33 -0700 Subject: [PATCH 27/64] kill ... --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 89d4661..f420d6b 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -168,7 +168,7 @@ EOF # (re)start a metadata service ( pid=`lsof -iTCP@192.168.$GUEST_NETWORK.1:4567 -n | awk '{print $2}' | tail -1` - [ ! -e $pid ] || kill -9 $pid + [ -z "$pid" ] || kill -9 $pid ) cd $vm_dir/uec python meta.py 192.168.$GUEST_NETWORK.1:4567 & From 7306f3bfc77e92657107c9ec17da35a6df2110f5 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 23:13:34 -0700 Subject: [PATCH 28/64] more metadata --- tools/build_uec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index f420d6b..87b7275 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -163,6 +163,7 @@ cat > $vm_dir/uec/meta-data< Date: Sat, 5 Nov 2011 23:16:53 -0700 Subject: [PATCH 29/64] more userdata --- tools/build_uec.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 87b7275..392427d 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -166,6 +166,14 @@ instance-type: m1.large local-hostname: $GUEST_NAME.local EOF +# set metadata +cat > $vm_dir/uec/user-data< Date: Sat, 5 Nov 2011 23:20:11 -0700 Subject: [PATCH 30/64] more userdata --- tools/build_uec.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 392427d..3b5e49f 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -172,6 +172,9 @@ cat > $vm_dir/uec/user-data< Date: Sat, 5 Nov 2011 23:30:22 -0700 Subject: [PATCH 31/64] git clone --- tools/build_uec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 3b5e49f..cd0f0e0 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -175,6 +175,8 @@ packages: [ vim-nox, git-core ] password: pass chpasswd: { expire: False } disable_root: false +runcmd: + - [ git, clone, https://github.com/cloudbuilders/devstack.git ] EOF # (re)start a metadata service From 446a3304bcdff585d0fcea487a89e247bbaa4f6b Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 23:36:29 -0700 Subject: [PATCH 32/64] another attempt at userdata --- tools/build_uec.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index cd0f0e0..d6de847 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -168,15 +168,18 @@ EOF # set metadata cat > $vm_dir/uec/user-data< localrc +echo ADMIN_PASSWORD=golfing >> localrc +echo MYSQL_PASSWORD=golfing >> localrc +echo RABBIT_PASSWORD=golfing >> localrc +echo SERVICE_TOKEN=123124123124 >> localrc +echo FLAT_INTERFACE=br100 >> localrc +./stack.sh EOF # (re)start a metadata service From 9102d454f6a892ebb9e000f34a1b515c49da3f8c Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 5 Nov 2011 23:49:08 -0700 Subject: [PATCH 33/64] resize the uec image --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index d6de847..e1d6447 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -45,7 +45,7 @@ tarball=$image_dir/$(basename $uec_url) if [ ! -f $tarball ]; then curl $uec_url -o $tarball (cd $image_dir && tar -Sxvzf $tarball) - cp $image_dir/*.img $image_dir/disk + resize-part-image $image_dir/*.img 10G $image_dir/disk cp $image_dir/*-vmlinuz-virtual $image_dir/kernel fi From 6b1c26e96194d8a20d25cf3b11674d2a2fe72136 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 00:13:30 -0700 Subject: [PATCH 34/64] use the provided localrc --- tools/build_uec.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index e1d6447..240ea78 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -173,12 +173,9 @@ apt-get update apt-get install git -y git clone https://github.com/cloudbuilders/devstack.git cd devstack -echo DASH_BRANCH=instance-overview > localrc -echo ADMIN_PASSWORD=golfing >> localrc -echo MYSQL_PASSWORD=golfing >> localrc -echo RABBIT_PASSWORD=golfing >> localrc -echo SERVICE_TOKEN=123124123124 >> localrc -echo FLAT_INTERFACE=br100 >> localrc +cat > localrc < Date: Sun, 6 Nov 2011 00:22:41 -0700 Subject: [PATCH 35/64] use the right devstack sha --- tools/build_uec.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 240ea78..cb1ce2d 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -173,6 +173,9 @@ apt-get update apt-get install git -y git clone https://github.com/cloudbuilders/devstack.git cd devstack +git remote set-url origin `cd $TOP_DIR; git remote show origin | grep Fetch | awk '{print $3}'` +git fetch +git checkout $GIT_COMMIT cat > localrc < Date: Sun, 6 Nov 2011 00:26:29 -0700 Subject: [PATCH 36/64] accidentally running stack.sh ... --- tools/build_uec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index cb1ce2d..98b39b9 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -176,9 +176,9 @@ cd devstack git remote set-url origin `cd $TOP_DIR; git remote show origin | grep Fetch | awk '{print $3}'` git fetch git checkout $GIT_COMMIT -cat > localrc < localrc < Date: Sun, 6 Nov 2011 00:32:21 -0700 Subject: [PATCH 37/64] use the right revision --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 98b39b9..2a69952 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -175,7 +175,7 @@ git clone https://github.com/cloudbuilders/devstack.git cd devstack git remote set-url origin `cd $TOP_DIR; git remote show origin | grep Fetch | awk '{print $3}'` git fetch -git checkout $GIT_COMMIT +git checkout `git rev-parse HEAD` cat > localrc < Date: Sun, 6 Nov 2011 00:42:11 -0700 Subject: [PATCH 38/64] sleep half a second to allow bash to start in screen --- stack.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/stack.sh b/stack.sh index 32b4539..bb26e44 100755 --- a/stack.sh +++ b/stack.sh @@ -909,6 +909,7 @@ function screen_it { NL=`echo -ne '\015'` if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then screen -S stack -X screen -t $1 + sleep 0.5 screen -S stack -p $1 -X stuff "$2$NL" fi } From 5f4ae107efbc481db5d3c30c90a63934a2664d51 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 07:47:09 -0800 Subject: [PATCH 39/64] chown should be to stack user, not root --- stack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index bb26e44..7b0c900 100755 --- a/stack.sh +++ b/stack.sh @@ -121,7 +121,7 @@ if [[ $EUID -eq 0 ]]; then echo "Copying files to stack user" STACK_DIR="$DEST/${PWD##*/}" cp -r -f "$PWD" "$STACK_DIR" - chown -R $USER "$STACK_DIR" + chown -R stack "$STACK_DIR" if [[ "$SHELL_AFTER_RUN" != "no" ]]; then exec su -c "set -e; cd $STACK_DIR; bash stack.sh; bash" stack else From 53d7533d1570a7fe536126c3b4e84ae4928931a1 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 07:54:11 -0800 Subject: [PATCH 40/64] pull DIST_NAME from source --- tools/build_uec.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 2a69952..a0c2788 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -# Ubuntu distro to install -DIST_NAME=${DIST_NAME:-oneiric} - # Make sure that we have the proper version of ubuntu (only works on natty/oneiric) UBUNTU_VERSION=`cat /etc/lsb-release | grep CODENAME | sed 's/.*=//g'` if [ ! "oneiric" = "$UBUNTU_VERSION" ]; then @@ -16,6 +13,14 @@ fi TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=`cd $TOOLS_DIR/..; pwd` +cd $TOP_DIR + +# Source params +source ./stackrc + +# Ubuntu distro to install +DIST_NAME=${DIST_NAME:-oneiric} + # exit on error to stop unexpected errors set -o errexit set -o xtrace @@ -49,10 +54,6 @@ if [ ! -f $tarball ]; then cp $image_dir/*-vmlinuz-virtual $image_dir/kernel fi -cd $TOP_DIR - -# Source params -source ./stackrc # Configure the root password of the vm to be the same as ``ADMIN_PASSWORD`` ROOT_PASSWORD=${ADMIN_PASSWORD:-password} From 00d6bc6529899326568f37375db77ac3cea008e1 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 07:56:18 -0800 Subject: [PATCH 41/64] Don't forget to echo so we can find it --- tools/build_uec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index a0c2788..bccddaf 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -181,6 +181,7 @@ cat > localrc < Date: Sun, 6 Nov 2011 08:00:28 -0800 Subject: [PATCH 42/64] should speed up by 20 seconds - sudo and no sleep --- stack.sh | 3 +-- tools/build_uec.sh | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stack.sh b/stack.sh index 7b0c900..33eb207 100755 --- a/stack.sh +++ b/stack.sh @@ -103,8 +103,7 @@ if [[ $EUID -eq 0 ]]; then # since this script runs as a normal user, we need to give that user # ability to run sudo - apt_get update - apt_get install sudo + dpkg -l sudo || apt_get update && apt_get install sudo if ! getent passwd stack >/dev/null; then echo "Creating a user called stack" diff --git a/tools/build_uec.sh b/tools/build_uec.sh index bccddaf..266356b 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -171,13 +171,14 @@ EOF cat > $vm_dir/uec/user-data< localrc < Date: Sun, 6 Nov 2011 08:09:03 -0800 Subject: [PATCH 43/64] Switch the way we check for completion --- tools/build_uec.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 266356b..44c8c0f 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -182,7 +182,6 @@ ROOTSLEEP=0 `cat $TOP_DIR/localrc` LOCAL_EOF ./stack.sh -echo "All done" EOF # (re)start a metadata service @@ -228,7 +227,7 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ]; then trap kill_tail SIGINT echo "Waiting stack.sh to finish..." - while ! cat $vm_dir/console.log | grep -q 'All done' ; do + while ! cat $vm_dir/console.log | grep -q '^stack.sh (completed|failed)' ; do sleep 1 done From d55a5159128a213789d9a7a6db3ed6225206eec3 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 08:16:42 -0800 Subject: [PATCH 44/64] egrep needed for parens --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 44c8c0f..ada6596 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -227,7 +227,7 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ]; then trap kill_tail SIGINT echo "Waiting stack.sh to finish..." - while ! cat $vm_dir/console.log | grep -q '^stack.sh (completed|failed)' ; do + while ! egrep -q '^stack.sh (completed|failed)' $vm_dir/console.log ; do sleep 1 done From b17c4f30eb6038f58e0186d8621406b68bf54914 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 09:25:55 -0800 Subject: [PATCH 45/64] make sure hostname resolves --- tools/build_uec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index ada6596..ee78192 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -170,6 +170,8 @@ EOF # set metadata cat > $vm_dir/uec/user-data< Date: Sun, 6 Nov 2011 09:35:13 -0800 Subject: [PATCH 46/64] run hostname on remote server --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index ee78192..cbcdad6 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -171,7 +171,7 @@ EOF cat > $vm_dir/uec/user-data< Date: Sun, 6 Nov 2011 10:29:10 -0800 Subject: [PATCH 47/64] increase the dhcp range --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index cbcdad6..a0997e0 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -96,7 +96,7 @@ cat > $NET_XML < - + From dca89009f5f5468f13158eec3b080ecb0bb5545f Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 6 Nov 2011 10:33:33 -0800 Subject: [PATCH 48/64] destroying the network isn't enough to delete the leases --- tools/build_uec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index a0997e0..3ee1e2f 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -104,6 +104,8 @@ EOF if [[ "$GUEST_RECREATE_NET" == "yes" ]]; then virsh net-destroy devstack-$GUEST_NETWORK || true + # destroying the network isn't enough to delete the leases + rm -f /var/lib/libvirt/dnsmasq/devstack-$GUEST_NETWORK.leases virsh net-create $vm_dir/net.xml fi From 9812ffb9980a7ed7c3512873d522ac6ee5f52742 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Sun, 6 Nov 2011 11:18:26 -0800 Subject: [PATCH 49/64] clean up service token --- files/nova-api-paste.ini | 2 +- stack.sh | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/files/nova-api-paste.ini b/files/nova-api-paste.ini index 0b56c9f..2c642f8 100644 --- a/files/nova-api-paste.ini +++ b/files/nova-api-paste.ini @@ -124,4 +124,4 @@ auth_host = 127.0.0.1 auth_port = 35357 auth_protocol = http auth_uri = http://127.0.0.1:5000/ -admin_token = 999888777666 +admin_token = %SERVICE_TOKEN% diff --git a/stack.sh b/stack.sh index da097bd..fd305e2 100755 --- a/stack.sh +++ b/stack.sh @@ -562,15 +562,12 @@ fi # ---- if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then - # We are going to use the sample http middleware configuration from the - # keystone project to launch nova. This paste config adds the configuration - # required for nova to validate keystone tokens - except we need to switch - # the config to use our service token instead (instead of the invalid token - # 999888777666). - if [ ! -e $NOVA_DIR/bin/nova-api-paste.ini ]; then - cp $FILES/nova-api-paste.ini $NOVA_DIR/bin - sed -e "s,999888777666,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini - fi + # We are going to use a sample http middleware configuration based on the + # one from the keystone project to launch nova. This paste config adds + # the configuration required for nova to validate keystone tokens. We add + # our own service token to the configuration. + cp $FILES/nova-api-paste.ini $NOVA_DIR/bin + sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini fi if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then From f0b41f3fb7c8802cfbd1576e10f268e20d5e1e7b Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Mon, 7 Nov 2011 09:51:15 -0800 Subject: [PATCH 50/64] update for why we sleep --- stack.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 33eb207..ca8ab41 100755 --- a/stack.sh +++ b/stack.sh @@ -908,7 +908,10 @@ function screen_it { NL=`echo -ne '\015'` if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then screen -S stack -X screen -t $1 - sleep 0.5 + # sleep to allow bash to be ready to be send the command - we are + # creating a new window in screen and then sends characters, so if + # bash isn't running by the time we send the command, nothing happens + sleep 1 screen -S stack -p $1 -X stuff "$2$NL" fi } From 955e5e73f2badc22532d8054bd0965e26510cab8 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Mon, 7 Nov 2011 10:29:05 -0800 Subject: [PATCH 51/64] don't need static uec meta/user data since we generate --- tools/uec/meta-data | 19 ------------------- tools/uec/user-data | 32 -------------------------------- 2 files changed, 51 deletions(-) delete mode 100644 tools/uec/meta-data delete mode 100644 tools/uec/user-data diff --git a/tools/uec/meta-data b/tools/uec/meta-data deleted file mode 100644 index d068195..0000000 --- a/tools/uec/meta-data +++ /dev/null @@ -1,19 +0,0 @@ -#ami-id: ami-fd4aa494 -#ami-launch-index: '0' -#ami-manifest-path: ubuntu-images-us/ubuntu-lucid-10.04-amd64-server-20100427.1.manifest.xml -#block-device-mapping: {ami: sda1, ephemeral0: sdb, ephemeral1: sdc, root: /dev/sda1} -hostname: smoser-sys -#instance-action: none -instance-id: i-87018aed -instance-type: m1.large -#kernel-id: aki-c8b258a1 -local-hostname: smoser-sys.mosers.us -#local-ipv4: 10.223.26.178 -#placement: {availability-zone: us-east-1d} -#public-hostname: ec2-184-72-174-120.compute-1.amazonaws.com -#public-ipv4: 184.72.174.120 -#public-keys: -# ec2-keypair.us-east-1: [ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCD9dlT00vOUC8Ttq6YH8RzUCVqPQl6HaSfWSTKYnZiVCpTBj1CaRZPLRLmkSB9Nziy4aRJa/LZMbBHXytQKnB1psvNknqC2UNlrXXMk+Vx5S4vg21MXYYimK4uZEY0Qz29QUiTyNsx18jpAaF4ocUpTpRhxPEBCcSCDmMbc27MU2XuTbasM2NjW/w0bBF3ZFhdH68dZICXdTxS2jUrtrCnc1D/QXVZ5kQO3jsmSyJg8E0nE+6Onpx2YRoVRSwjpGzVZ+BlXPnN5xBREBG8XxzhNFHJbek+RgK5TfL+k4yD4XhnVZuZu53cBAFhj+xPKhtisSd+YmaEq+Jt9uS0Ekd5 -# ec2-keypair.us-east-1, ''] -#reservation-id: r-e2225889 -#security-groups: default diff --git a/tools/uec/user-data b/tools/uec/user-data deleted file mode 100644 index f9fa477..0000000 --- a/tools/uec/user-data +++ /dev/null @@ -1,32 +0,0 @@ -#cloud-config -#apt_update: false -#apt_upgrade: true -#packages: [ bzr, pastebinit, ubuntu-dev-tools, ccache, bzr-builddeb, vim-nox, git-core, lftp ] - -apt_sources: - - source: ppa:smoser/ppa - -disable_root: True - -mounts: - - [ ephemeral0, None ] - - [ swap, None ] - -ssh_import_id: [smoser ] - -sm_misc: - - &user_setup | - set -x; exec > ~/user_setup.log 2>&1 - echo "starting at $(date -R)" - echo "set -o vi" >> ~/.bashrc - cat >> ~/.profile < ~/runcmd.log' ] - - [ sudo, -Hu, ubuntu, sh, -c, 'read up sleep < /proc/uptime; echo $(date): runcmd up at $up | tee -a ~/runcmd.log' ] - - [ sudo, -Hu, ubuntu, sh, -c, *user_setup ] - -password: passw0rd -chpasswd: { expire: False } From e3c47a351e869cd9026bc37879ccf7f9c709e285 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Mon, 7 Nov 2011 10:44:43 -0800 Subject: [PATCH 52/64] parameterize vm size, improve metadata, conditional for ubuntu version --- tools/build_uec.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 3ee1e2f..6bab526 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash # Make sure that we have the proper version of ubuntu (only works on natty/oneiric) -UBUNTU_VERSION=`cat /etc/lsb-release | grep CODENAME | sed 's/.*=//g'` -if [ ! "oneiric" = "$UBUNTU_VERSION" ]; then - if [ ! "natty" = "$UBUNTU_VERSION" ]; then - echo "This script only works with oneiric and natty" - exit 1 - fi +if ! egrep -q "oneiric|natty" /etc/lsb-release; then + echo "This script only works with ubuntu oneiric and natty" + exit 1 fi # Keep track of the current directory @@ -21,6 +18,9 @@ source ./stackrc # Ubuntu distro to install DIST_NAME=${DIST_NAME:-oneiric} +# Configure how large the VM should be +GUEST_SIZE=${GUEST_SIZE:-10G} + # exit on error to stop unexpected errors set -o errexit set -o xtrace @@ -33,7 +33,8 @@ if [ ! -e $TOP_DIR/localrc ]; then fi # Install deps if needed -dpkg -l kvm libvirt-bin kpartx || apt-get install -y --force-yes kvm libvirt-bin kpartx +DEPS="kvm libvirt-bin kpartx" +dpkg -l $DEPS || apt-get install -y --force-yes $DEPS # Where to store files and instances WORK_DIR=${WORK_DIR:-/opt/kvmstack} @@ -50,7 +51,7 @@ tarball=$image_dir/$(basename $uec_url) if [ ! -f $tarball ]; then curl $uec_url -o $tarball (cd $image_dir && tar -Sxvzf $tarball) - resize-part-image $image_dir/*.img 10G $image_dir/disk + resize-part-image $image_dir/*.img $GUEST_SIZE $image_dir/disk cp $image_dir/*-vmlinuz-virtual $image_dir/kernel fi @@ -164,8 +165,8 @@ cp -r $TOOLS_DIR/uec $vm_dir/uec # set metadata cat > $vm_dir/uec/meta-data< Date: Mon, 7 Nov 2011 14:06:15 -0500 Subject: [PATCH 53/64] Comment out log_file options in glance configs Comment out log_file options in glance config files to make log output appear in g-api and g-reg screen windows, like the other server daemons... --- files/glance-api.conf | 2 +- files/glance-registry.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/glance-api.conf b/files/glance-api.conf index 3499ff7..bb758af 100644 --- a/files/glance-api.conf +++ b/files/glance-api.conf @@ -24,7 +24,7 @@ registry_port = 9191 # Log to this file. Make sure you do not set the same log # file for both the API and registry servers! -log_file = %DEST%/glance/api.log +#log_file = %DEST%/glance/api.log # Send logs to syslog (/dev/log) instead of to file specified by `log_file` use_syslog = %SYSLOG% diff --git a/files/glance-registry.conf b/files/glance-registry.conf index 351b09f..1e04186 100644 --- a/files/glance-registry.conf +++ b/files/glance-registry.conf @@ -13,7 +13,7 @@ bind_port = 9191 # Log to this file. Make sure you do not set the same log # file for both the API and registry servers! -log_file = %DEST%/glance/registry.log +#log_file = %DEST%/glance/registry.log # Where to store images filesystem_store_datadir = %DEST%/glance/images From e7fa90934d3d0f1dc0a89fbf6f498e927f041d39 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 7 Nov 2011 16:10:59 -0600 Subject: [PATCH 54/64] script to warm apts/pips on a base image, to speed up performace of build_ scripts --- tools/warm_apts_and_pips.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tools/warm_apts_and_pips.sh diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh new file mode 100644 index 0000000..c0b02b9 --- /dev/null +++ b/tools/warm_apts_and_pips.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Keep track of the current directory +TOOLS_DIR=$(cd $(dirname "$0") && pwd) +TOP_DIR=`cd $TOOLS_DIR/..; pwd` + +# cd to top of devstack +cd $TOP_DIR + +# Echo usage +usage() { + echo "Cache OpenStack dependencies on a uec image to speed up performance." + echo "" + echo "Usage: $0 [full path to raw uec base image]" +} + +# Make sure this is a raw image +if ! qemu-img info $1 | grep -q "file format: raw"; then + usage + exit 1 +fi + +# Mount the image +STAGING_DIR=`mktemp -d uec.XXXXXXXXXX` +mkdir -p $STAGING_DIR +mount -t ext4 -o loop $1 $STAGING_DIR + +# Make sure that base requirements are installed +cp /etc/resolv.conf $STAGING_DIR/etc/resolv.conf + +# Perform caching on the base image to speed up subsequent runs +chroot $STAGING_DIR apt-get update +chroot $STAGING_DIR apt-get install -y --download-only `cat files/apts/* | grep NOPRIME | cut -d\# -f1` +chroot $STAGING_DIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1` +chroot $STAGING_DIR pip install `cat files/pips/*` +umount $STAGING_DIR && rm -rf $STAGING_DIR From 069f2f7a534b8ace5e9a6e68143c7951b65d4046 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 7 Nov 2011 16:13:03 -0600 Subject: [PATCH 55/64] +x --- tools/warm_apts_and_pips.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/warm_apts_and_pips.sh diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh old mode 100644 new mode 100755 From 8655bf0e6efdd3d87a5ed149be2ee5e3aa8473db Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 7 Nov 2011 16:37:00 -0600 Subject: [PATCH 56/64] more checks to make sure script is run as intended --- tools/warm_apts_and_pips.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh index c0b02b9..b20519f 100755 --- a/tools/warm_apts_and_pips.sh +++ b/tools/warm_apts_and_pips.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +# echo commands +set -o xtrace + +# exit on error to stop unexpected errors +set -o errexit + # Keep track of the current directory TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=`cd $TOOLS_DIR/..; pwd` @@ -20,6 +26,12 @@ if ! qemu-img info $1 | grep -q "file format: raw"; then exit 1 fi +# Make sure we are in the correct dir +if [ ! -d files/apts ]; then + echo "Please run this script from devstack/tools/" + exit 1 +fi + # Mount the image STAGING_DIR=`mktemp -d uec.XXXXXXXXXX` mkdir -p $STAGING_DIR From 208ae2f6aa0bf5dbc669c6fd4f2e4649c04ed039 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 7 Nov 2011 16:38:03 -0600 Subject: [PATCH 57/64] fix some comments --- tools/warm_apts_and_pips.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh index b20519f..10bd4af 100755 --- a/tools/warm_apts_and_pips.sh +++ b/tools/warm_apts_and_pips.sh @@ -1,16 +1,16 @@ #!/usr/bin/env bash -# echo commands +# Echo commands set -o xtrace -# exit on error to stop unexpected errors +# Exit on error to stop unexpected errors set -o errexit # Keep track of the current directory TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=`cd $TOOLS_DIR/..; pwd` -# cd to top of devstack +# Change dir to top of devstack cd $TOP_DIR # Echo usage From 7e436c212ea2ac7fe60bddedf49548729675111e Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 9 Nov 2011 00:12:00 -0800 Subject: [PATCH 58/64] use dhcp_release --- files/apts/nova | 1 + stack.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/files/apts/nova b/files/apts/nova index 405d53b..9eefed7 100644 --- a/files/apts/nova +++ b/files/apts/nova @@ -1,4 +1,5 @@ dnsmasq-base +dnsmasq-utils # for dhcp_release kpartx parted arping # used for send_arp_for_ha option in nova-network diff --git a/stack.sh b/stack.sh index 841cbb4..78851b9 100755 --- a/stack.sh +++ b/stack.sh @@ -826,6 +826,7 @@ add_nova_flag "--ec2_dmz_host=$EC2_DMZ_HOST" add_nova_flag "--rabbit_host=$RABBIT_HOST" add_nova_flag "--rabbit_password=$RABBIT_PASSWORD" add_nova_flag "--glance_api_servers=$GLANCE_HOSTPORT" +add_nova_flag "--force_dhcp_release" if [ -n "$INSTANCES_PATH" ]; then add_nova_flag "--instances_path=$INSTANCES_PATH" fi From e28f77565d0dd214db5fa01bdea41c88e52dbafc Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 9 Nov 2011 11:48:09 -0800 Subject: [PATCH 59/64] install cloud-utils, so that we have resize-part-image --- tools/build_uec.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index 6bab526..a15a18a 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Make sure that we have the proper version of ubuntu (only works on natty/oneiric) -if ! egrep -q "oneiric|natty" /etc/lsb-release; then +# Make sure that we have the proper version of ubuntu (only works on oneiric) +if ! egrep -q "oneiric" /etc/lsb-release; then echo "This script only works with ubuntu oneiric and natty" exit 1 fi @@ -33,7 +33,7 @@ if [ ! -e $TOP_DIR/localrc ]; then fi # Install deps if needed -DEPS="kvm libvirt-bin kpartx" +DEPS="kvm libvirt-bin kpartx cloud-utils" dpkg -l $DEPS || apt-get install -y --force-yes $DEPS # Where to store files and instances From 5605ec11446d70e466f4ff0a4a50292b8c3f633f Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 9 Nov 2011 12:40:01 -0800 Subject: [PATCH 60/64] now that we are using apt-get download this file doesn't speed things up that much --- files/apts/preseed | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 files/apts/preseed diff --git a/files/apts/preseed b/files/apts/preseed deleted file mode 100644 index 8712d5d..0000000 --- a/files/apts/preseed +++ /dev/null @@ -1,18 +0,0 @@ -# a collection of packages that speed up installation as they are dependencies -# of packages we can't install during bootstraping (rabbitmq-server, -# mysql-server, libvirt-bin) -# -# NOTE: only add packages to this file that aren't needed directly -mysql-common -mysql-client-5.1 -erlang-base -erlang-ssl -erlang-nox -erlang-inets -erlang-mnesia -libhtml-template-perl -gettext-base -libavahi-client3 -libxml2-utils -libpciaccess0 -libparted0debian1 From 593e9aa87a2f81b4e1ff03ca8b8ee1789164890b Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 9 Nov 2011 12:42:08 -0800 Subject: [PATCH 61/64] fix message - no natty support --- tools/build_uec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index a15a18a..d57cb29 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -2,7 +2,7 @@ # Make sure that we have the proper version of ubuntu (only works on oneiric) if ! egrep -q "oneiric" /etc/lsb-release; then - echo "This script only works with ubuntu oneiric and natty" + echo "This script only works with ubuntu oneiric." exit 1 fi From c1024d8987a9b35ef41f5a5615f9827d4b4e4468 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 9 Nov 2011 18:58:07 -0800 Subject: [PATCH 62/64] tweaks to warm script, add script to configure stack user --- tools/setup_stack_user.sh | 66 +++++++++++++++++++++++++++++++++++++ tools/warm_apts_and_pips.sh | 11 ++++--- 2 files changed, 73 insertions(+), 4 deletions(-) create mode 100755 tools/setup_stack_user.sh diff --git a/tools/setup_stack_user.sh b/tools/setup_stack_user.sh new file mode 100755 index 0000000..85d418e --- /dev/null +++ b/tools/setup_stack_user.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +# Echo commands +set -o xtrace + +# Exit on error to stop unexpected errors +set -o errexit + +# Keep track of the current directory +TOOLS_DIR=$(cd $(dirname "$0") && pwd) +TOP_DIR=`cd $TOOLS_DIR/..; pwd` + +# Change dir to top of devstack +cd $TOP_DIR + +# Echo usage +usage() { + echo "Add stack user and keys" + echo "" + echo "Usage: $0 [full path to raw uec base image]" +} + +# Make sure this is a raw image +if ! qemu-img info $1 | grep -q "file format: raw"; then + usage + exit 1 +fi + +# Mount the image +DEST=/opt/stack +STAGING_DIR=/tmp/`echo $1 | sed "s/\//_/g"`.stage.user +mkdir -p $STAGING_DIR +umount $STAGING_DIR || true +sleep 1 +mount -t ext4 -o loop $1 $STAGING_DIR +mkdir -p $STAGING_DIR/$DEST + +# Create a stack user that is a member of the libvirtd group so that stack +# is able to interact with libvirt. +chroot $STAGING_DIR groupadd libvirtd || true +chroot $STAGING_DIR useradd stack -s /bin/bash -d $DEST -G libvirtd || true + +# a simple password - pass +echo stack:pass | chroot $STAGING_DIR chpasswd + +# and has sudo ability (in the future this should be limited to only what +# stack requires) +echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers + +# Gracefully cp only if source file/dir exists +function cp_it { + if [ -e $1 ] || [ -d $1 ]; then + cp -pRL $1 $2 + fi +} + +# Copy over your ssh keys and env if desired +cp_it ~/.ssh $STAGING_DIR/$DEST/.ssh +cp_it ~/.ssh/id_rsa.pub $STAGING_DIR/$DEST/.ssh/authorized_keys +cp_it ~/.gitconfig $STAGING_DIR/$DEST/.gitconfig +cp_it ~/.vimrc $STAGING_DIR/$DEST/.vimrc +cp_it ~/.bashrc $STAGING_DIR/$DEST/.bashrc + +# Give stack ownership over $DEST so it may do the work needed +chroot $STAGING_DIR chown -R stack $DEST + diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh index 10bd4af..854a938 100755 --- a/tools/warm_apts_and_pips.sh +++ b/tools/warm_apts_and_pips.sh @@ -33,8 +33,10 @@ if [ ! -d files/apts ]; then fi # Mount the image -STAGING_DIR=`mktemp -d uec.XXXXXXXXXX` +STAGING_DIR=/tmp/`echo $1 | sed "s/\//_/g"`.stage mkdir -p $STAGING_DIR +umount $STAGING_DIR || true +sleep 1 mount -t ext4 -o loop $1 $STAGING_DIR # Make sure that base requirements are installed @@ -43,6 +45,7 @@ cp /etc/resolv.conf $STAGING_DIR/etc/resolv.conf # Perform caching on the base image to speed up subsequent runs chroot $STAGING_DIR apt-get update chroot $STAGING_DIR apt-get install -y --download-only `cat files/apts/* | grep NOPRIME | cut -d\# -f1` -chroot $STAGING_DIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1` -chroot $STAGING_DIR pip install `cat files/pips/*` -umount $STAGING_DIR && rm -rf $STAGING_DIR +chroot $STAGING_DIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1` || true +mkdir -p $STAGING_DIR/var/cache/pip +PIP_DOWNLOAD_CACHE=/var/cache/pip chroot $STAGING_DIR pip install `cat files/pips/*` || true +umount $STAGING_DIR From e228093ecda9300428a399600758580eff3b44fe Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 9 Nov 2011 22:29:22 -0800 Subject: [PATCH 63/64] some cleanup for utility scripts --- tools/setup_stack_user.sh | 10 +++++++++- tools/warm_apts_and_pips.sh | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/setup_stack_user.sh b/tools/setup_stack_user.sh index 85d418e..231a20f 100755 --- a/tools/setup_stack_user.sh +++ b/tools/setup_stack_user.sh @@ -40,9 +40,15 @@ mkdir -p $STAGING_DIR/$DEST chroot $STAGING_DIR groupadd libvirtd || true chroot $STAGING_DIR useradd stack -s /bin/bash -d $DEST -G libvirtd || true -# a simple password - pass +# Add a simple password - pass echo stack:pass | chroot $STAGING_DIR chpasswd +# Configure sudo +grep -q "^#includedir.*/etc/sudoers.d" $STAGING_DIR/etc/sudoers || + echo "#includedir /etc/sudoers.d" | sudo tee -a $STAGING_DIR/etc/sudoers +cp $TOP_DIR/files/sudo/* $STAGING_DIR/etc/sudoers.d/ +sed -e "s,%USER%,$USER,g" -i $STAGING_DIR/etc/sudoers.d/* + # and has sudo ability (in the future this should be limited to only what # stack requires) echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers @@ -64,3 +70,5 @@ cp_it ~/.bashrc $STAGING_DIR/$DEST/.bashrc # Give stack ownership over $DEST so it may do the work needed chroot $STAGING_DIR chown -R stack $DEST +# Unmount +umount $STAGING_DIR diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh index 854a938..ec7e916 100755 --- a/tools/warm_apts_and_pips.sh +++ b/tools/warm_apts_and_pips.sh @@ -48,4 +48,6 @@ chroot $STAGING_DIR apt-get install -y --download-only `cat files/apts/* | grep chroot $STAGING_DIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1` || true mkdir -p $STAGING_DIR/var/cache/pip PIP_DOWNLOAD_CACHE=/var/cache/pip chroot $STAGING_DIR pip install `cat files/pips/*` || true + +# Unmount umount $STAGING_DIR From b74b74a2b321adfc976590a58685b6a506e5db64 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Thu, 10 Nov 2011 11:47:34 -0800 Subject: [PATCH 64/64] permissions --- exercises/floating_ips.sh | 0 exercises/swift.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 exercises/floating_ips.sh mode change 100644 => 100755 exercises/swift.sh diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh old mode 100644 new mode 100755 diff --git a/exercises/swift.sh b/exercises/swift.sh old mode 100644 new mode 100755