IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42411 for trunk/tools


Ignore:
Timestamp:
Mar 14, 2023, 3:08:37 PM (3 years ago)
Author:
eugene
Message:

more work on the rawfix scripts

Location:
trunk/tools/eam/rawfix.20230221/src
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/check.rawfix.sh

    r42406 r42411  
    6161  set mystate = $2
    6262
    63   if ($mystate == "new") goto good_state
    64   if ($mystate == "rsync") goto good_state
    65   if ($mystate == "md5sum.new") goto good_state
    66   if ($mystate == "md5sum.done") goto good_state
    67   if ($mystate == "md5sum.fail") goto good_state
    68   if ($mystate == "ckchip.new") goto good_state
    69   if ($mystate == "ckchip.done") goto good_state
    70   if ($mystate == "ckchip.fail") goto good_state
    71   if ($mystate == "fixchip.new") goto good_state
    72   if ($mystate == "fixchip.done") goto good_state
    73   if ($mystate == "fixchip.fail") goto good_state
     63  if ($mystate == "ckchip.new")    goto good_state
     64  if ($mystate == "ckchip.done")   goto good_state
     65  if ($mystate == "ckchip.fail")   goto good_state
     66  if ($mystate == "fixchip.new")   goto good_state
     67  if ($mystate == "fixchip.done")  goto good_state
     68  if ($mystate == "fixchip.fail")  goto good_state
     69  if ($mystate == "rsync_s1.new")  goto good_state
     70  if ($mystate == "rsync_s1.done") goto good_state
     71  if ($mystate == "rsync_s1.fail") goto good_state
     72  if ($mystate == "md5sum.new")    goto good_state
     73  if ($mystate == "md5sum.done")   goto good_state
     74  if ($mystate == "md5sum.fail")   goto good_state
     75  if ($mystate == "rsync_s2.new")  goto good_state
     76  if ($mystate == "rsync_s2.done") goto good_state
     77  if ($mystate == "rsync_s2.fail") goto good_state
     78  if ($mystate == "md5chk.new")    goto good_state
     79  if ($mystate == "md5chk.done")   goto good_state
     80  if ($mystate == "md5chk.fail")   goto good_state
    7481
    7582  echo "ERROR: unknown mode $mystate"
     
    7784
    7885  good_state:
    79   mysql $DBOPTS -e "select dateobs from nights where (state = '$mystate')"
     86  set t = `date +%T..%N`
     87  mysql $DBOPTS -e "select dateobs, curtime() as timestamp from nights where (state = '$mystate')" | awk -v T=$t '(NR == 1){print $0}(NR > 1){print $1, T}'
    8088  exit 0
    8189endif
  • trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl

    r42404 r42411  
    1818my @instlist = glob ("$dateword/*.inst.txt");
    1919my @md5slist = glob ("$dateword/*.md5s.txt");
     20
     21my $Nfail = 0;
    2022
    2123foreach my $instfile (@instlist) {
     
    3941
    4042    if ($md5match eq "NONE") {
    41         print STDERR "missing md5sum file for $instfile\n";
     43        print STDOUT "missing md5sum file for $instfile\n";
     44        $Nfail ++;
    4245        next;
    4346    }
     
    5760    my $N2 = @instdata;
    5861    if ($N1 != $N2) {
    59         print STDERR "inconsistent number of lines in $md5match : $N1 vs $N2\n";
     62        print STDOUT "inconsistent number of lines in $md5match : $N1 vs $N2\n";
     63        $Nfail ++;
    6064        next;
    6165    }
     
    7680
    7781        if ($md5tru ne $md5obs) {
    78             print STDERR "FAIL: $inst $state $md5tru $md5obs\n";
     82            print STDOUT "FAIL: $inst $state $md5tru $md5obs\n";
     83            $Nfail ++;
    7984        }
    8085    }
     86}
     87
     88if ($Nfail) {
     89    print STDOUT "ERROR: $Nfail errors\n";
     90    exit 1;
     91} else {
     92    print STDOUT "SUCCESS: $Nfail errors\n";
     93    exit 0;
    8194}
    8295
  • trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl

    r42404 r42411  
    44my $time = time();
    55
    6 use DBI;
    76use Carp;
    87use Pod::Usage qw( pod2usage );
  • trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip.pt

    r42406 r42411  
    3030  end
    3131
     32  # need to delete DONE entries here so the book is not repopulated
     33  # by already-running load tasks
    3234  task.exit 0
    3335    # convert the stdout 'queue' to entries in a book
    3436    # fields in the table will become words in the page
    3537    queue2book -raw-columns -key dateobs -uniq -setword pantaskState INIT -setword pantasksQuality OK stdout ckchip.book
     38    book delpage ckchip.book -key pantaskState DONE
    3639  end
    3740
     
    9194    # fields in the table will become words in the page
    9295    # use the queuesize (Nhosts) to track how many jobs are done / to be done
     96    book setword ckchip.book $options:0 pantaskState DONE
    9397    exec update.rawfix.sh $options:0 ckchip.done
    94     book delpage ckchip.book $options:0
    9598  end
    9699
  • trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt

    r42406 r42411  
    3535    # fields in the table will become words in the page
    3636    queue2book -raw-columns -key dateobs -uniq -setword pantaskState INIT -setword pantasksQuality OK stdout fixchip.book
     37    book delpage fixchip.book -key pantaskState DONE
    3738  end
    3839
     
    9192    # fields in the table will become words in the page
    9293    # use the queuesize (Nhosts) to track how many jobs are done / to be done
     94    book setword fixchip.book $options:0 pantaskState DONE
    9395    exec update.rawfix.sh $options:0 fixchip.done
    9496    book delpage fixchip.book $options:0
  • trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt

    r42405 r42411  
    3535    # fields in the table will become words in the page
    3636    queue2book -raw-columns -key dateobs -uniq -setword pantaskState INIT -setword pantasksQuality OK stdout md5sum.book
     37    book delpage md5sum.book -key pantaskState DONE
    3738  end
    3839
     
    210211   
    211212    # look for completed nights in md5sum.book (pantaskState == DONE)
    212     book getpage md5sum.book 0 -var pageName -key pantaskState DONE
     213    book getpage md5sum.book 0 -var pageName -key pantaskState STOP
    213214    if ("$pageName" == "NULL") break
    214215
     
    232233    # now that the entry is set to done in the db, remove the pantasks book entry
    233234    echo "cleaning this page: $options:0"
    234     book delpage md5sum.book $options:0
     235    book setword md5sum.book $options:0 pantaskState DONE
    235236  end
    236237
     
    274275  end
    275276  if ($Ndone == $Nhosts)
    276     book setword md5sum.book $options:1 pantaskState DONE
     277    book setword md5sum.book $options:1 pantaskState STOP
    277278  end
    278279  book delpage md5host.book $options:0
  • trunk/tools/eam/rawfix.20230221/src/rawfix.pt

    r42406 r42411  
    1616end
    1717
     18# these are listed in stage order, but the
     19# order is this file is not determinative, only the
     20# change of state from STAGE1.new -> STAGE1.done -> STAGE2.new
    1821input rawfix.ckchip.pt
    19 # input rawfix.md5sum.pt
     22input rawfix.fixchip.pt
     23input rawfix.rsync_s1.pt
     24input rawfix.md5sum.pt
     25input rawfix.rsync_s2.pt
     26input rawfix.md5chk.pt
    2027
    2128######################### UTILITIES #################################
Note: See TracChangeset for help on using the changeset viewer.