Admin/isatest/isatest-makedist
author wenzelm
Fri, 17 Aug 2012 11:37:14 +0200
changeset 48836 90a0af19004c
parent 48832 ab9663b8734b
child 49004 3a324a3f4aea
permissions -rwxr-xr-x
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     1
#!/usr/bin/env bash
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     2
#
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     3
# Author: Gerwin Klein, TU Muenchen
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     4
#
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     5
# DESCRIPTION: Build distribution and run isatest-make for lots of platforms.
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     6
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     7
## global settings
22411
1956d895a4ed adjust paths
kleing
parents: 22410
diff changeset
     8
. ~/admin/isatest/isatest-settings
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
     9
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    10
TMP=/tmp/isatest-makedist.$$
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    11
MAIL=$HOME/bin/pmail
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    12
28931
498b63ba782c renamed makedist_mercurial to makedist, deleting the old version;
wenzelm
parents: 28607
diff changeset
    13
MAKEDIST=$HOME/bin/makedist
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    14
MAKEALL=$HOME/bin/isatest-makeall
27084
654bf12de98b switch from gtar to tar
isatest
parents: 26727
diff changeset
    15
TAR=tar
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    16
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    17
SSH="ssh -f"
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    18
48259
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
    19
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    20
## diagnostics
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    21
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    22
PRG="$(basename "$0")"
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    23
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    24
function usage()
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    25
{
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    26
  echo
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    27
  echo "Usage: $PRG"
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    28
  echo
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    29
  echo "   Build distribution and run isatest-make for lots of platforms."
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    30
  echo
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    31
  exit 1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    32
}
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    33
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    34
function fail()
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    35
{
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    36
  echo "$1" >&2
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    37
  exit 2
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    38
}
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    39
48259
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
    40
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    41
## main
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    42
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    43
# cleanup old error log and test-still-running files
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    44
rm -f $ERRORLOG
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    45
rm -f $ERRORDIR/isatest-*.log
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    46
rm -f $RUNNING/*.runnning
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    47
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    48
export DISTPREFIX
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    49
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    50
DATE=$(date "+%Y-%m-%d")
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    51
DISTLOG=$LOGPREFIX/isatest-makedist-$DATE.log
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    52
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    53
echo ------------------- preparing test release --- `date` --- $HOSTNAME > $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    54
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    55
echo "### cleaning up old dist directory"  >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    56
rm -rf $DISTPREFIX >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    57
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    58
echo "### cleaning up old isabelle-* directories" >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    59
rm -rf $HOME/isabelle-*
48210
08cb859c53cd removed switched-off atbroy102 from isatest; no cygwin test currently running, needs a working server somewhere
Gerwin Klein <gerwin.klein@nicta.com.au>
parents: 48209
diff changeset
    60
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    61
echo "### building distribution"  >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    62
mkdir -p $DISTPREFIX
48832
ab9663b8734b updated to jedit_build-20120813, pointing to another contrib directory as a change;
wenzelm
parents: 48790
diff changeset
    63
$MAKEDIST -j "/home/isabelle/contrib/jedit_build-20120813" >> $DISTLOG 2>&1
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    64
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    65
if [ $? -ne 0 ]
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    66
then
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    67
    echo ------------------- DIST BUILD FAILED --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    68
    ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
28539
bdb308737bfd do logging to MASTERLOG centrally (avoid multiple writers over NFS as
kleing
parents: 28418
diff changeset
    69
    log "dist build FAILED, elapsed time $ELAPSED."
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    70
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    71
    echo "Could not build isabelle distribution. Log file available at" > $TMP
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    72
    echo "$HOSTNAME:$DISTLOG" >> $TMP
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    73
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    74
    for R in $MAILTO; do
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    75
        $MAIL "isabelle dist build failed" $R $TMP
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    76
    done
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    77
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    78
    rm $TMP
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    79
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    80
    exit 1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    81
fi
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    82
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    83
cd $DISTPREFIX >> $DISTLOG 2>&1
40739
9c84b562620d recovered global "Isabelle" symlink for isatest (cf. 7f745e4b7cce);
wenzelm
parents: 37874
diff changeset
    84
ISABELLE_DIST=`cat $DISTPREFIX/ISABELLE_DIST`
9c84b562620d recovered global "Isabelle" symlink for isatest (cf. 7f745e4b7cce);
wenzelm
parents: 37874
diff changeset
    85
$TAR xvzf $ISABELLE_DIST >> $DISTLOG 2>&1
9c84b562620d recovered global "Isabelle" symlink for isatest (cf. 7f745e4b7cce);
wenzelm
parents: 37874
diff changeset
    86
ln -sf $(basename $ISABELLE_DIST .tar.gz) Isabelle
41967
6aa69999da8f isatest: fresh copy of settings avoids odd cumulative environment;
wenzelm
parents: 41599
diff changeset
    87
cp Isabelle/etc/settings Isabelle/etc/settings.orig
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    88
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    89
echo ------------------- prepared test successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    90
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    91
ELAPSED=$("$HOME/bin/showtime" "$SECONDS")
28539
bdb308737bfd do logging to MASTERLOG centrally (avoid multiple writers over NFS as
kleing
parents: 28418
diff changeset
    92
log "dist build successful, elapsed time $ELAPSED."
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    93
48259
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
    94
22413
3df5c44482e2 clean up var/running dir before spawning new tests
kleing
parents: 22411
diff changeset
    95
## clean up var/running
3df5c44482e2 clean up var/running dir before spawning new tests
kleing
parents: 22411
diff changeset
    96
rm -f $RUNNING/*
48211
12bbb9d4b6ed make sure var/running dir exists for isatest
Gerwin Klein <gerwin.klein@nicta.com.au>
parents: 48210
diff changeset
    97
mkdir -p $RUNNING
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
    98
48259
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
    99
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
   100
## spawn test runs
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
   101
48259
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
   102
$SSH lxbroy2 "
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
   103
  $MAKEALL $HOME/settings/at-poly;
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
   104
  $MAKEALL $HOME/settings/at-poly-test"
35398
aec00d4ec03d added at-poly-test, which is intended for performance tests of Poly/ML itself;
wenzelm
parents: 35245
diff changeset
   105
sleep 15
48259
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
   106
$SSH lxbroy3 "
1635298d8fe7 removed some old/unused stuff;
wenzelm
parents: 48258
diff changeset
   107
  $MAKEALL $HOME/settings/at64-poly;
48608
88ff12baccba updated isatest to isabelle build, which also includes doc-src sessions;
wenzelm
parents: 48259
diff changeset
   108
  $MAKEALL -l HOL-Library $HOME/settings/at-sml-dev-e"
28598
cb5f98e2e187 give more time to do inital loggin and settings read
kleing
parents: 28539
diff changeset
   109
sleep 15
48209
67f13db5d273 prefer lxbroy[23] as standard test machines;
wenzelm
parents: 48158
diff changeset
   110
$SSH macbroy23 "$MAKEALL $HOME/settings/at-poly-e"
28598
cb5f98e2e187 give more time to do inital loggin and settings read
kleing
parents: 28539
diff changeset
   111
sleep 15
46004
484ef66bc3a1 more selective target "full" -- avoid failure of HOL-Datatype_Benchmark on 32bit platforms;
wenzelm
parents: 45913
diff changeset
   112
$SSH macbroy2 "
48635
bfce940c6f38 clarified ISABELLE_FULL_TEST;
wenzelm
parents: 48608
diff changeset
   113
  $MAKEALL $HOME/settings/mac-poly64-M4;
bfce940c6f38 clarified ISABELLE_FULL_TEST;
wenzelm
parents: 48608
diff changeset
   114
  $MAKEALL $HOME/settings/mac-poly64-M8;
46004
484ef66bc3a1 more selective target "full" -- avoid failure of HOL-Datatype_Benchmark on 32bit platforms;
wenzelm
parents: 45913
diff changeset
   115
  $MAKEALL $HOME/settings/mac-poly-M4;
484ef66bc3a1 more selective target "full" -- avoid failure of HOL-Datatype_Benchmark on 32bit platforms;
wenzelm
parents: 45913
diff changeset
   116
  $MAKEALL $HOME/settings/mac-poly-M8"
31581
907616b9536c more isatests;
wenzelm
parents: 31385
diff changeset
   117
sleep 15
44978
a04f3eb3943c isatest settings for macbroy6 (Mac OS X Lion);
wenzelm
parents: 43506
diff changeset
   118
$SSH macbroy6 "$MAKEALL $HOME/settings/mac-poly64-M2"
a04f3eb3943c isatest settings for macbroy6 (Mac OS X Lion);
wenzelm
parents: 43506
diff changeset
   119
sleep 15
42423
5a7217f098bd migrated macbroy6 to macbroy30, which is the new "mobile" server (2 cores, 4 GB, Mac OS 10.5);
wenzelm
parents: 41967
diff changeset
   120
$SSH macbroy30 "sleep 10800; $MAKEALL $HOME/settings/mac-poly-M2"
48210
08cb859c53cd removed switched-off atbroy102 from isatest; no cygwin test currently running, needs a working server somewhere
Gerwin Klein <gerwin.klein@nicta.com.au>
parents: 48209
diff changeset
   121
22410
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
   122
echo ------------------- spawned tests successfully --- `date` --- $HOSTNAME >> $DISTLOG 2>&1
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
   123
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
   124
gzip -f $DISTLOG
da313b67a04d moved all isatest/cron job related files to own directory
kleing
parents:
diff changeset
   125