From 527e341b74a5a28f13a0b760549436b32474f2d8 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 27 Sep 2011 15:05:37 -0700 Subject: [PATCH 1/7] changes to support the new nova-vnc wsproxy --- stack.sh | 2 +- stackrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stack.sh b/stack.sh index 7ecbc83..98e26cf 100755 --- a/stack.sh +++ b/stack.sh @@ -462,7 +462,7 @@ screen_it n-cpu "cd $NOVA_DIR && echo $NOVA_DIR/bin/nova-compute | newgrp libvir screen_it n-net "cd $NOVA_DIR && $NOVA_DIR/bin/nova-network" screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler" # nova-vncproxy binds a privileged port, and so needs sudo -screen_it n-vnc "cd $NOVA_DIR && sudo $NOVA_DIR/bin/nova-vncproxy" +screen_it n-vnc "cd $NOVNC_DIR && ./utils/nova-wsproxy.py 6080 --web ." screen_it dash "cd $DASH_DIR && sudo /etc/init.d/apache2 restart; sudo tail -f /var/log/apache2/error.log" # Install Images diff --git a/stackrc b/stackrc index 2d265d3..993bca8 100644 --- a/stackrc +++ b/stackrc @@ -12,7 +12,7 @@ KEYSTONE_BRANCH=diablo # a websockets/html5 or flash powered VNC console for vm instances NOVNC_REPO=https://github.com/cloudbuilders/noVNC.git -NOVNC_BRANCH=master +NOVNC_BRANCH=nova-vncproxy-redux # django powered web control panel for openstack DASH_REPO=https://github.com/cloudbuilders/openstack-dashboard.git From 87bb5c00877c0f58501173dff0f08b709c3b4afc Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 27 Sep 2011 16:20:20 -0700 Subject: [PATCH 2/7] add missing dep --- files/apts/novnc | 1 + 1 file changed, 1 insertion(+) create mode 100644 files/apts/novnc diff --git a/files/apts/novnc b/files/apts/novnc new file mode 100644 index 0000000..24ce15a --- /dev/null +++ b/files/apts/novnc @@ -0,0 +1 @@ +numpy From 0154ee8f35687c3922bb2ef7ebd5cb0e7c9345c1 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 27 Sep 2011 16:27:19 -0700 Subject: [PATCH 3/7] correct package name --- files/apts/novnc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/apts/novnc b/files/apts/novnc index 24ce15a..c8722b9 100644 --- a/files/apts/novnc +++ b/files/apts/novnc @@ -1 +1 @@ -numpy +python-numpy From 8f3e28cec1f81b1aa21066155cca3ce8193e9a41 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Tue, 27 Sep 2011 18:26:27 -0700 Subject: [PATCH 4/7] use the current user instead of stack for dash --- files/000-default.template | 6 +++--- stack.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/files/000-default.template b/files/000-default.template index cb4585b..4e4b5c4 100644 --- a/files/000-default.template +++ b/files/000-default.template @@ -1,8 +1,8 @@ WSGIScriptAlias / %DASH_DIR%/openstack-dashboard/dashboard/wsgi/django.wsgi - WSGIDaemonProcess dashboard user=stack group=stack processes=3 threads=10 - SetEnv APACHE_RUN_USER stack - SetEnv APACHE_RUN_GROUP stack + WSGIDaemonProcess dashboard user=%USER% group=%USER% processes=3 threads=10 + SetEnv APACHE_RUN_USER %USER% + SetEnv APACHE_RUN_GROUP %USER% WSGIProcessGroup dashboard DocumentRoot %DASH_DIR%/.blackhole/ diff --git a/stack.sh b/stack.sh index 7ecbc83..4c16bfa 100755 --- a/stack.sh +++ b/stack.sh @@ -241,6 +241,7 @@ if [[ "$ENABLED_SERVICES" =~ "dash" ]]; then ## Configure apache's 000-default to run dashboard sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default + sudo sed -e "s,%USER%,$USER,g" -i /etc/apache2/sites-enabled/000-default sudo sed -e "s,%DASH_DIR%,$DASH_DIR,g" -i /etc/apache2/sites-enabled/000-default fi From ba89a26e4ff3af9c4902ee5b258c031e8cf43909 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 27 Sep 2011 19:01:08 -0700 Subject: [PATCH 5/7] remove old comment --- stack.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/stack.sh b/stack.sh index 5c102fa..f21b371 100755 --- a/stack.sh +++ b/stack.sh @@ -462,7 +462,6 @@ fi screen_it n-cpu "cd $NOVA_DIR && echo $NOVA_DIR/bin/nova-compute | newgrp libvirtd" screen_it n-net "cd $NOVA_DIR && $NOVA_DIR/bin/nova-network" screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler" -# nova-vncproxy binds a privileged port, and so needs sudo screen_it n-vnc "cd $NOVNC_DIR && ./utils/nova-wsproxy.py 6080 --web ." screen_it dash "cd $DASH_DIR && sudo /etc/init.d/apache2 restart; sudo tail -f /var/log/apache2/error.log" From 0f6787cb3f49166dd692c1dedaa0e6c54ade683b Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 27 Sep 2011 19:39:13 -0700 Subject: [PATCH 6/7] point noVNC back to master --- stackrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackrc b/stackrc index 993bca8..2d265d3 100644 --- a/stackrc +++ b/stackrc @@ -12,7 +12,7 @@ KEYSTONE_BRANCH=diablo # a websockets/html5 or flash powered VNC console for vm instances NOVNC_REPO=https://github.com/cloudbuilders/noVNC.git -NOVNC_BRANCH=nova-vncproxy-redux +NOVNC_BRANCH=master # django powered web control panel for openstack DASH_REPO=https://github.com/cloudbuilders/openstack-dashboard.git From d31c4ea07ba1cf0a562ba11b48a6b3a5c751e81f Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 28 Sep 2011 02:30:57 -0700 Subject: [PATCH 7/7] multiple step version of building a ramdisk pxeboot installer --- build_pxe_ramdisk.sh | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 build_pxe_ramdisk.sh diff --git a/build_pxe_ramdisk.sh b/build_pxe_ramdisk.sh new file mode 100755 index 0000000..0f598f8 --- /dev/null +++ b/build_pxe_ramdisk.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +if [ ! "$#" -eq "1" ]; then + echo "$0 builds a gziped natty openstack install" + echo "usage: $0 dest" + exit 1 +fi + +# Source params +source ./stackrc + +# clean install of natty +if [ ! -d natty-base ]; then + debootstrap natty natty-base + # copy kernel modules... + # NOTE(ja): is there a better way to do this? + cp -pr /lib/modules/`uname -r` proto/lib/modules + cp files/sources.list natty-base/etc/apt/sources.list + chroot natty-base apt-get update +fi + +# prime natty with as many apt/pips as we can +if [ ! -d primed ]; then + rsync -azH natty-base/ primed/ + chroot primed apt-get install -y `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"` + chroot primed pip install `cat files/pips/*` + + # Create a stack user that is a member of the libvirtd group so that stack + # is able to interact with libvirt. + chroot primed groupadd libvirtd + chroot primed useradd stack -s /bin/bash -d /opt -G libvirtd + + # a simple password - pass + echo stack:pass | chroot primed chpasswd + + # and has sudo ability (in the future this should be limited to only what + # stack requires) + echo "stack ALL=(ALL) NOPASSWD: ALL" >> primed/etc/sudoers +fi + +# clone git repositories onto the system +# ====================================== + +if [ ! -d cloned ]; then + rsync -azH primed/ cloned/ +fi + +# git clone only if directory doesn't exist already. Since ``DEST`` might not +# be owned by the installation user, we create the directory and change the +# ownership to the proper user. +function git_clone { + + # clone new copy or fetch latest changes + CHECKOUT=cloned$2 + if [ ! -d $CHECKOUT ]; then + mkdir -p $CHECKOUT + git clone $1 $CHECKOUT + else + pushd $CHECKOUT + git fetch + popd + fi + + # FIXME(ja): checkout specified version (should works for branches and tags) + + pushd $CHECKOUT + # checkout the proper branch/tag + git checkout $3 + # force our local version to be the same as the remote version + git reset --hard origin/$3 + popd + + # give ownership to the stack user + chroot cloned/ chown -R stack $2 +} + +git_clone $NOVA_REPO /opt/stack/nova $NOVA_BRANCH +git_clone $GLANCE_REPO /opt/stack/glance $GLANCE_BRANCH +git_clone $KEYSTONE_REPO /opt/stack/keystone $KEYSTONE_BRANCH +git_clone $NOVNC_REPO /opt/stack/novnc $NOVNC_BRANCH +git_clone $DASH_REPO /opt/stack/dash $DASH_BRANCH +git_clone $NIXON_REPO /opt/stack/nixon $NIXON_BRANCH +git_clone $NOVACLIENT_REPO /opt/stack/python-novaclient $NOVACLIENT_BRANCH +git_clone $OPENSTACKX_REPO /opt/stack/openstackx $OPENSTACKX_BRANCH +git_clone $MUNIN_REPO /opt/stack/openstack-munin $MUNIN_BRANCH + +# build a new image +BASE=build.$$ +IMG=$BASE.img +MNT=$BASE/ + +# create a 2GB blank filesystem +dd if=/dev/zero of=$IMG bs=1024k count=2048 +# force it to be initialized as ext2 +mkfs.ext2 -F $IMG + +# mount blank image loopback and load it +mkdir -p $MNT +mount -o loop $IMG $MNT +rsync -azH cloned/ $MNT + +# umount and cleanup +umount $MNT +rmdir $MNT + +# gzip into final location +gzip -1 $IMG -c > $1 +