Admin/isatest/isatest-makedist
author wenzelm
Thu Aug 27 11:54:05 2009 +0200 (2009-08-27)
changeset 32418 030be5c12d96
parent 32336 e88b295aae35
child 32654 5f9127407430
permissions -rwxr-xr-x
avoid macbroy21 for now -- hardware problems;
kleing@22410
     1
#!/usr/bin/env bash
kleing@22410
     2
#
kleing@22410
     3
# Author: Gerwin Klein, TU Muenchen
kleing@22410
     4
#
kleing@22410
     5
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
kleing@22410
     6
kleing@22410
     7
## global settings
kleing@22411
     8
. ~/admin/isatest/isatest-settings
kleing@22410
     9
kleing@22410
    10
TMP=/tmp/isatest-makedist.$$
kleing@22410
    11
MAIL=$HOME/bin/pmail
kleing@22410
    12
wenzelm@28931
    13
MAKEDIST=$HOME/bin/makedist
kleing@22410
    14
MAKEALL=$HOME/bin/isatest-makeall
isatest@27084
    15
TAR=tar
kleing@22410
    16
kleing@22410
    17
SSH="ssh -f"
kleing@22410
    18
kleing@22410
    19
## diagnostics
kleing@22410
    20
kleing@22410
    21
PRG="$(basename "$0")"
kleing@22410
    22
kleing@22410
    23
function usage()
kleing@22410
    24
{
kleing@22410
    25
  echo
kleing@22410
    26
  echo "Usage: $PRG"
kleing@22410
    27
  echo
kleing@22410
    28
  echo "   Build distribution and run isatest-make for lots of platforms."
kleing@22410
    29
  echo
kleing@22410
    30
  exit 1
kleing@22410
    31
}
kleing@22410
    32
kleing@22410
    33
function fail()
kleing@22410
    34
{
kleing@22410
    35
  echo "$1" >&2
kleing@22410
    36
  exit 2
kleing@22410
    37
}
kleing@22410
    38
kleing@22410
    39
## main
kleing@22410
    40
kleing@22410
    41
# cleanup old error log and test-still-running files
kleing@22410
    42
rm -f $ERRORLOG
kleing@22410
    43
rm -f $ERRORDIR/isatest-*.log
kleing@22410
    44
rm -f $RUNNING/*.runnning
kleing@22410
    45
kleing@22410
    46
export DISTPREFIX
kleing@22410
    47
kleing@22410
    48
DATE=$(date "+%Y-%m-%d")
kleing@22410
    49
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
kleing@22410
    50
kleing@22410
    51
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
kleing@22410
    52
kleing@22410
    53
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
kleing@22410
    54
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
kleing@22410
    55
kleing@22410
    56
echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
kleing@22410
    57
rm -rf $HOME/isabelle-*
kleing@22410
    58
kleing@22410
    59
echo "### building distribution"  >> $DISTLOG 2>&1
kleing@22410
    60
mkdir -p $DISTPREFIX
kleing@28418
    61
$MAKEDIST >> $DISTLOG 2>&1
kleing@22410
    62
kleing@22410
    63
if [ $? -ne 0 ]
kleing@22410
    64
then
kleing@22410
    65
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
    66
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
kleing@28539
    67
    log "dist build FAILED, elapsed time $ELAPSED."
kleing@22410
    68
kleing@22410
    69
    echo "Could not build isabelle distribution. Log file available at" > $TMP
kleing@22410
    70
    echo "$HOSTNAME:$DISTLOG" >> $TMP
kleing@22410
    71
kleing@22410
    72
    for R in $MAILTO; do
kleing@22410
    73
        $MAIL "isabelle dist build failed" $R $TMP
kleing@22410
    74
    done
kleing@22410
    75
kleing@22410
    76
    rm $TMP
kleing@22410
    77
kleing@22410
    78
    exit 1
kleing@22410
    79
fi
kleing@22410
    80
kleing@22410
    81
cd $DISTPREFIX >> $DISTLOG 2>&1
kleing@22410
    82
$TAR xvzf `cat $DISTPREFIX/ISABELLE_DIST` >> $DISTLOG 2>&1
kleing@22410
    83
kleing@22410
    84
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
    85
kleing@22410
    86
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
kleing@28539
    87
log "dist build successful, elapsed time $ELAPSED."
kleing@22410
    88
kleing@22413
    89
## clean up var/running
kleing@22413
    90
rm -f $RUNNING/*
kleing@22410
    91
kleing@22410
    92
## spawn test runs
kleing@22410
    93
kleing@22410
    94
$SSH sunbroy2 "$MAKEALL $HOME/settings/sun-poly"
kleing@22410
    95
# give test some time to copy settings and start
kleing@28598
    96
sleep 15
wenzelm@32418
    97
$SSH macbroy22 "$MAKEALL $HOME/settings/at-poly"
kleing@28598
    98
sleep 15
isatest@26727
    99
$SSH macbroy20 "$MAKEALL $HOME/settings/at-poly-5.1-para-e"
kleing@28598
   100
sleep 15
kleing@27539
   101
#$SSH macbroy24 "$MAKEALL -l HOL proofterms $HOME/settings/at-sml-dev-p"
kleing@28598
   102
#sleep 15
wenzelm@32418
   103
$SSH macbroy21 "$MAKEALL $HOME/settings/at64-poly-5.1-para"
kleing@28598
   104
sleep 15
wenzelm@31652
   105
$SSH macbroy23 -l HOL images "$MAKEALL $HOME/settings/at-sml-dev-e"
kleing@28598
   106
sleep 15
kleing@25532
   107
$SSH atbroy101 "$MAKEALL $HOME/settings/at64-poly"
kleing@28598
   108
sleep 15
wenzelm@32336
   109
$SSH macbroy2 "$MAKEALL $HOME/settings/mac-poly-M4; $MAKEALL $HOME/settings/mac-poly-M8; $MAKEALL $HOME/settings/mac-poly64-M4; $MAKEALL $HOME/settings/mac-poly64-M8"
wenzelm@31581
   110
sleep 15
kleing@27488
   111
$SSH macbroy5 "$MAKEALL $HOME/settings/mac-poly"
kleing@28598
   112
sleep 15
wenzelm@32097
   113
#$SSH macbroy6 "$MAKEALL $HOME/settings/at-mac-poly-5.1-para"
wenzelm@32097
   114
#sleep 15
kleing@22640
   115
$SSH atbroy51 "$HOME/admin/isatest/isatest-annomaly"
kleing@22410
   116
kleing@22410
   117
echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
kleing@22410
   118
kleing@22410
   119
gzip -f $DISTLOG
kleing@22410
   120
kleing@22410
   121
## end