Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Naomi Aro 2011-11-29 15:30:30 +01:00
commit c17be6d938
10 changed files with 69 additions and 70 deletions

View File

@ -92,9 +92,9 @@ class LibraryController extends Zend_Controller_Action
'title' => 'Download');
if (Application_Model_Preference::GetUploadToSoundcloudOption()) {
$text = "Upload to Soundcloud";
$text = "Upload to SoundCloud";
if(!is_null($file->getSoundCloudId())){
$text = "Re-upload to Soundcloud";
$text = "Re-upload to SoundCloud";
}
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Library/upload-file-soundcloud/id/#id#',
'callback'=>"window['addProgressIcon']('$file_id')"),'title' => $text);

View File

@ -217,11 +217,11 @@ class ScheduleController extends Zend_Controller_Action
if(is_null($show->getSoundCloudFileId())){
$menu[] = array('action' => array('type' => 'fn',
'callback' => "window['uploadToSoundCloud']($id)"),
'title' => 'Upload to Soundcloud');
'title' => 'Upload to SoundCloud');
}else{
$menu[] = array('action' => array('type' => 'fn',
'callback' => "window['uploadToSoundCloud']($id)"),
'title' => 'Re-upload to Soundcloud');
'title' => 'Re-upload to SoundCloud');
}
}

View File

@ -51,7 +51,7 @@ def download_if_needed(vdi_dir, xml_dir, vm_name, vm_vdi_file, vm_xml_file):
local("wget %s/%s/%s -O %s"%(env.vm_download_url, vm_name, vm_xml_file, os.path.join(xml_dir, vm_xml_file)))
def create_fresh_os(vm_name, update_virtualenv=False, debian=False):
def create_fresh_os(vm_name, lucid=False, debian=False):
"""
remove known_hosts because if two virtual machines get the same ip address,
@ -66,27 +66,7 @@ def create_fresh_os(vm_name, update_virtualenv=False, debian=False):
vdi_snapshot_dir = os.path.expanduser('~/tmp/vms/%s/Snapshots'%vm_name)
xml_dir = os.path.expanduser('~/.VirtualBox')
vm_xml_path = os.path.join(xml_dir, vm_xml_file)
"""
if not os.path.exists("%s/vm_registered"%vdi_dir) and os.path.exists(vm_xml_path):
#vm_xml file exists, but it wasn't registered. Did something go wrong on a previous attempt?
#Let's attempt to correct this by completely removing the virtual machine.
dom = parse(vm_xml_path)
root = dom.childNodes[0]
rootChildren = root.childNodes
#manually remove all snapshots before removing virtual machine
for rc in rootChildren:
if rc.nodeType == Node.ELEMENT_NODE and rc.localName == "Machine":
snapshotNodes = rc.getElementsByTagName("Snapshot")
for sn in snapshotNodes:
local("VBoxManage snapshot %s delete %s"% (vm_name, sn.getAttribute("uuid")[1:-1]))
os.remove(vm_xml_path)
local("VBoxManage unregistervm %s --delete"% vm_name)
"""
download_if_needed(vdi_dir, xml_dir, vm_name, vm_vdi_file, vm_xml_file)
if not os.path.exists("%s/vm_registered"%vdi_dir):
@ -122,7 +102,7 @@ def create_fresh_os(vm_name, update_virtualenv=False, debian=False):
env.hosts.append(ip_addr)
env.host_string = ip_addr
if update_virtualenv:
if lucid:
print "Lucid detected - updating python virtualenv"
sudo('apt-get update')
sudo('apt-get install -y python-setuptools')
@ -130,16 +110,20 @@ def create_fresh_os(vm_name, update_virtualenv=False, debian=False):
sudo('dpkg -i python-virtualenv_1.4.9-3_all.deb')
#supress rabbitmq bug that makes an upgrade warning pop-up even though it hasn't been
#installed before.
sudo('echo "rabbitmq-server rabbitmq-server/upgrade_previous note" | debconf-set-selections')
if debian:
append('/etc/apt/sources.list', "deb http://www.debian-multimedia.org squeeze main non-free", use_sudo=True)
def ubuntu_lucid_32(fresh_os=True):
if (fresh_os):
create_fresh_os('Ubuntu_10.04_32', update_virtualenv=True)
create_fresh_os('Ubuntu_10.04_32', lucid=True)
def ubuntu_lucid_64(fresh_os=True):
if (fresh_os):
create_fresh_os('Ubuntu_10.04_64', update_virtualenv=True)
create_fresh_os('Ubuntu_10.04_64', lucid=True)
def ubuntu_maverick_32(fresh_os=True):
if (fresh_os):

View File

@ -3,10 +3,10 @@
exec 2>&1
target="airtime_git_branch"
#airtime_versions=("" "airtime_182_tar" "airtime_194_tar")
airtime_versions=("" "airtime_182_tar" "airtime_195_tar")
airtime_versions=("" "airtime_182_tar" "airtime_195_tar")
#airtime_versions=("")
ubuntu_versions=("ubuntu_lucid_32" "ubuntu_lucid_64" "ubuntu_maverick_32" "ubuntu_maverick_64" "ubuntu_natty_32" "ubuntu_natty_64" "debian_squeeze_32" "debian_squeeze_64")
#ubuntu_versions=("ubuntu_lucid_32" "ubuntu_lucid_64" "ubuntu_maverick_32" "ubuntu_maverick_64" "ubuntu_natty_32" "ubuntu_natty_64" "ubuntu_oneiric_32" "ubuntu_oneiric_64" "debian_squeeze_32" "debian_squeeze_64")
ubuntu_versions=("ubuntu_natty_32" "ubuntu_natty_64")
num1=${#ubuntu_versions[@]}
num2=${#airtime_versions[@]}
@ -15,6 +15,7 @@ mkdir -p ./upgrade_logs
for i in $(seq 0 $(($num1 -1)));
do
#echo fab -f fab_setup.py os_update shutdown
for j in $(seq 0 $(($num2 -1)));
do
echo fab -f fab_setup.py ${ubuntu_versions[$i]} ${airtime_versions[$j]} $target shutdown

View File

@ -7,9 +7,7 @@ if [ `whoami` != 'root' ]; then
exit 1
fi
export INSTALL_PYPO=1
export INSTALL_MEDIA_MONITOR=1
export INSTALL_SHOW_RECORDER=1
export WEB_ONLY=0
set +e
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
@ -30,6 +28,7 @@ set +e
DO_UPGRADE="0"
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-installed-check.php $@
result=$?
set -e
if [ "$result" -eq "1" ]; then
DO_UPGRADE="1"
@ -37,6 +36,8 @@ elif [ "$result" -eq "2" -o "$result" -eq "3" ]; then
exit 1
elif [ "$result" -eq "4" ]; then
exit 0
elif [ "$result" -eq "5" ]; then
WEB_ONLY=1
fi
#make DO_UPGRADE available in sub bash scripts
@ -58,7 +59,7 @@ virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
python $AIRTIMEROOT/python_apps/create-pypo-user.py
if [ "$DO_UPGRADE" = "1" ]; then
if [ "$DO_UPGRADE" -eq "1" ]; then
#do upgrade
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-upgrade.php $@
fi
@ -73,7 +74,7 @@ deactivate
echo -e "\n*** Verifying your system environment, running airtime-check-system ***"
sleep 10
airtime-check-system
airtime-check-system --no-color
echo -e "\n******************************* Install Complete *******************************"

View File

@ -487,7 +487,8 @@ class AirtimeInstall
'overwrite|o' => 'Overwrite any existing config files.',
'preserve|p' => 'Keep any existing config files.',
'no-db|n' => 'Turn off database install.',
'reinstall|r' => 'Force a fresh install of this Airtime Version'
'reinstall|r' => 'Force a fresh install of this Airtime Version',
'webonly|w' => 'Install only web files'
)
);
$opts->parse();

View File

@ -56,19 +56,13 @@ echo "$MIN $HOUR * * * root /usr/lib/airtime/utils/phone_home_stat" > /etc/cron.
echo "* Creating /usr/lib/airtime"
if [ "$INSTALL_PYPO" -eq "1" -o "$INSTALL_MEDIA_MONITOR" -eq "1" -o "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
if [ "$WEB_ONLY" -eq "0" ]; then
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_install.py
fi
if [ "$INSTALL_PYPO" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/pypo/install/pypo-copy-files.py
fi
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-copy-files.py
fi
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-copy-files.py
fi
cp -R $AIRTIMEROOT/utils /usr/lib/airtime
echo "* Creating symbolic links in /usr/bin"

View File

@ -30,13 +30,9 @@ if [ "$DO_UPGRADE" -eq "0" ]; then
fi
set -e
if [ "$INSTALL_PYPO" -eq "1" ]; then
if [ "$WEB_ONLY" -eq "0" ]; then
python $AIRTIMEROOT/python_apps/pypo/install/pypo-initialize.py
fi
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-initialize.py
fi
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-initialize.py
fi
@ -51,14 +47,10 @@ fi
sleep 1
set +e
if [ "$INSTALL_PYPO" -eq "1" ]; then
if [ "$WEB_ONLY" -eq "0" ]; then
monit monitor airtime-playout
monit monitor airtime-liquidsoap
fi
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
monit monitor airtime-media-monitor
fi
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
monit monitor airtime-show-recorder
fi

View File

@ -13,6 +13,7 @@
* Returns 2 if the same version of Airtime is installed
* Returns 3 if a version of Airtime that we can't upgrade from is installed.
* Returns 4 if we need to print help message.
* Returns 5 if we need should only install apache files (web-only).
*/
require_once(dirname(__FILE__).'/AirtimeInstall.php');
require_once(__DIR__.'/airtime-constants.php');
@ -20,8 +21,9 @@ require_once(__DIR__.'/airtime-constants.php');
AirtimeInstall::ExitIfNotRoot();
$opts = AirtimeInstall::getOpts();
if ($opts == NULL) {
exit(4);
if (is_null($opts)) {
exit(0);
}
if (isset($opts->h)) {
@ -29,6 +31,11 @@ if (isset($opts->h)) {
exit(4);
}
//install media-monitor
if (isset($opts->w)){
exit(5);
}
$version = AirtimeInstall::GetVersionInstalled();
// The current version is already installed.
echo "* Checking for existing install of Airtime...".PHP_EOL;

View File

@ -125,17 +125,36 @@ class AirtimeCheck {
$p_status = json_decode($p_status);
$data = $p_status->status;
self::output_status("KERNEL_VERSION", $data->platform->release);
self::output_status("MACHINE_ARCHITECTURE", $data->platform->machine);
self::output_status("TOTAL_MEMORY_MBYTES", $data->platform->memory);
self::output_status("TOTAL_SWAP_MBYTES", $data->platform->swap);
self::output_status("AIRTIME_VERSION", $data->airtime_version);
if (isset($p_status->status)) {
$data = $p_status->status;
} else {
$data = array();
}
if (isset($data->platform)) {
self::output_status("KERNEL_VERSION", $data->platform->release);
self::output_status("MACHINE_ARCHITECTURE", $data->platform->machine);
self::output_status("TOTAL_MEMORY_MBYTES", $data->platform->memory);
self::output_status("TOTAL_SWAP_MBYTES", $data->platform->swap);
self::output_status("AIRTIME_VERSION", $data->airtime_version);
} else {
self::output_status("KERNEL_VERSION", "UNKNOWN");
self::output_status("MACHINE_ARCHITECTURE", "UNKNOWN");
self::output_status("TOTAL_MEMORY_MBYTES", "UNKNOWN");
self::output_status("TOTAL_SWAP_MBYTES", "UNKNOWN");
self::output_status("AIRTIME_VERSION", "UNKNOWN");
}
self::output_status("OS", self::CheckOsTypeVersion());
self::output_status("CPU", self::GetCpuInfo());
self::output_status("WEB_SERVER", self::GetServerType());
if ($data->services->pypo){
if (isset($data->services)) {
$services = $data->services;
} else {
$services = array();
}
if (isset($services->pypo)) {
self::output_status("PLAYOUT_ENGINE_PROCESS_ID", $data->services->pypo->process_id);
self::output_status("PLAYOUT_ENGINE_RUNNING_SECONDS", $data->services->pypo->uptime_seconds);
self::output_status("PLAYOUT_ENGINE_MEM_PERC", $data->services->pypo->memory_perc);
@ -146,7 +165,7 @@ class AirtimeCheck {
self::output_status("PLAYOUT_ENGINE_MEM_PERC", "0%");
self::output_status("PLAYOUT_ENGINE_CPU_PERC", "0%");
}
if (isset($data->services->liquidsoap)){
if (isset($services->liquidsoap)) {
self::output_status("LIQUIDSOAP_PROCESS_ID", $data->services->liquidsoap->process_id);
self::output_status("LIQUIDSOAP_RUNNING_SECONDS", $data->services->liquidsoap->uptime_seconds);
self::output_status("LIQUIDSOAP_MEM_PERC", $data->services->liquidsoap->memory_perc);
@ -157,7 +176,7 @@ class AirtimeCheck {
self::output_status("LIQUIDSOAP_MEM_PERC", "0%");
self::output_status("LIQUIDSOAP_CPU_PERC", "0%");
}
if (isset($data->services->media_monitor)){
if (isset($services->media_monitor)) {
self::output_status("MEDIA_MONITOR_PROCESS_ID", $data->services->media_monitor->process_id);
self::output_status("MEDIA_MONITOR_RUNNING_SECONDS", $data->services->media_monitor->uptime_seconds);
self::output_status("MEDIA_MONITOR_MEM_PERC", $data->services->media_monitor->memory_perc);
@ -168,7 +187,7 @@ class AirtimeCheck {
self::output_status("MEDIA_MONITOR_MEM_PERC", "0%");
self::output_status("MEDIA_MONITOR_CPU_PERC", "0%");
}
if (isset($data->services->show_recorder)){
if (isset($services->show_recorder)) {
self::output_status("SHOW_RECORDER_PROCESS_ID", $data->services->show_recorder->process_id);
self::output_status("SHOW_RECORDER_RUNNING_SECONDS", $data->services->show_recorder->uptime_seconds);
self::output_status("SHOW_RECORDER_MEM_PERC", $data->services->show_recorder->memory_perc);
@ -179,7 +198,7 @@ class AirtimeCheck {
self::output_status("SHOW_RECORDER_MEM_PERC", "0%");
self::output_status("SHOW_RECORDER_CPU_PERC", "0%");
}
if (isset($data->services->rabbitmq)){
if (isset($services->rabbitmq)) {
self::output_status("RABBITMQ_PROCESS_ID", $data->services->rabbitmq->process_id);
self::output_status("RABBITMQ_RUNNING_SECONDS", $data->services->rabbitmq->uptime_seconds);
self::output_status("RABBITMQ_MEM_PERC", $data->services->rabbitmq->memory_perc);