IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38682 for trunk


Ignore:
Timestamp:
Aug 24, 2015, 5:35:11 PM (11 years ago)
Author:
watersc1
Message:

Commiting the run versions.

Location:
trunk/tools/stsci_disks
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/stsci_disks/p0_large.pl

    r38647 r38682  
    7676
    7777my $time = time();
    78 my $logDest = "neb://any/stsci_shuffle/large/${host}.${volume}/${dir}.log.${time}";
     78my $logDest = "neb://any/stsci_shuffle/sizes/${host}.${volume}/${dir}.log";
    7979my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n";
    8080$ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n";
     
    104104my $root = "/data/${host}.${volume}/nebulous/${dir}";
    105105my @subdirectories = <$root/*>;
     106my $size = 0;
     107my $limit = 10 * 1024 * 1024; # stat returns bytes, so 100 * meg * k
     108my ($size_ota,$size_pv1,$size_pv2,$size_md) = (0,0,0,0);
    106109foreach my $subdir (@subdirectories) {
    107110    my @files = <${subdir}/*>;
     
    110113       
    111114        my @stat = stat($f);
    112         my $limit = 10 * 1024 * 1024; # stat returns bytes, so 100 * meg * k
     115        $size += $stat[7];
    113116#       print "$f $stat[7]\n"; die;
    114         if ($stat[7] > $limit) {
    115             my $ins_id = $f;
    116             $ins_id =~ s/^$subdir\///;
    117             $ins_id =~ s/\..*//;
     117        if ($f =~ /ota/) { $size_ota += $stat[7]; }
     118        if ($f =~ /LAP.ThreePi.20120706/) { $size_pv1 += $stat[7]; }
     119        if ($f =~ /LAP.ThreePi.20130717/) { $size_pv2 += $stat[7]; }
     120        if ($f =~ /MD/) { $size_md += $stat[7]; }
    118121
    119             my $key = $f;
    120             $key =~  s/.*\/${ins_id}\.//;
    121             $key =~  s%:%/%g;
     122
     123#       if ($stat[7] > $limit) {
     124#           if (0) {
     125#               my $ins_id = $f;
     126#               $ins_id =~ s/^$subdir\///;
     127#               $ins_id =~ s/\..*//;
    122128               
    123             my $uris = $neb->find_instances($key);
    124             my $found = 0;
    125             foreach my $uri (@{ $uris }) {
    126                 if ($uri eq "file://${f}") {
    127                     $found = 1;
    128                 }
    129             }
    130             if ($#{ $uris } == -1) { # true orphan
    131                 if ($key =~ /ecliptic/) {
    132                     $key =~ s%/00hr%:00hr%;
    133                     $neb->replicate($key);
    134                     print "#replicate $key\n";
    135                 }
    136                 $found = -1;
    137             }
    138             print "$f $stat[7] $key $found\n";
    139             if ($found == 0) {
    140 #               print "rm $f\n";
    141                 unlink($f);
    142                 foreach my $rsync (@rsync_vols) {
    143                     my $test_f = $f;
    144                     $test_f =~ s%^/data/%%;
    145                     $test_f = "/data/${rsync}/stsci_shuffle/${test_f}";
    146                     if (-e $test_f) {
    147                         unlink($f);
    148 #                       print "rm $test_f\n";
    149                     }
    150                 }
    151             }
    152         }
     129#               my $key = $f;
     130#               $key =~  s/.*\/${ins_id}\.//;
     131#               $key =~  s%:%/%g;
     132               
     133#               my $uris = $neb->find_instances($key);
     134#               my $found = 0;
     135#               foreach my $uri (@{ $uris }) {
     136#                   if ($uri eq "file://${f}") {
     137#                       $found = 1;
     138#                   }
     139#               }
     140#               if ($#{ $uris } == -1) { # true orphan
     141#                   if ($key =~ /ecliptic/) {
     142#                       $key =~ s%/00hr%:00hr%;
     143#                       $neb->replicate($key);
     144#                       print "#replicate $key\n";
     145#                   }
     146#                   $found = -1;
     147#               }
     148#               print "$f $stat[7] $key $found\n";
     149#               if ($found == 0) {
     150# #             print "rm $f\n";
     151#                   unlink($f);
     152#                   foreach my $rsync (@rsync_vols) {
     153#                       my $test_f = $f;
     154#                       $test_f =~ s%^/data/%%;
     155#                       $test_f = "/data/${rsync}/stsci_shuffle/${test_f}";
     156#                       if (-e $test_f) {
     157#                           unlink($f);
     158# #                     print "rm $test_f\n";
     159#                       }
     160#                   }
     161#               }
     162#           }
     163#       }
    153164    }
    154 #    print STDERR "$subdir\n";
    155165}
     166my $Msize = $size / 1024 / 1024;
     167print "$root $size $Msize\n";
     168print "OTA $size_ota\n";
     169print "PV1 $size_pv1\n";
     170print "PV2 $size_pv2\n";
     171print "MD $size_md\n";
     172
  • trunk/tools/stsci_disks/p1_clear.pl

    r38364 r38682  
    5151    defined $host && defined $volume && defined $dir &&
    5252    defined $db && defined $dbhost && defined $dbuser && defined $dbpass;
     53
     54my $host_check = `hostname`;
     55chomp($host_check);
     56if ($host ne $host_check) {
     57    die "Required to run on $host.  not on $host_check\n";
     58}
    5359
    5460my $dbh = DBI->connect(
     
    125131            }
    126132
    127             $md5sums[$i] = local_md5sum($f);
     133            $md5sums[$i] = actual_local_md5sum($f);
    128134            unless (defined($md5sums[$i])) {
    129135                die("Failed to calculate md5sum locally. $f ");
     
    218224            if (defined($vols[$i])) {
    219225#               print "HERE: $keys[$i] $host $volume\n";
    220                 $neb->cull($keys[$i],$host . "." . $volume);
     226                eval {
     227                    $neb->cull($keys[$i],$host . "." . $volume);
     228                };
     229                warn "CULL ERROR: $@" if $@;
    221230            }
    222231            else {
     
    282291    };
    283292
     293    if (defined($vol_host)) {
     294        if ($vol_host eq 'ipp066') {
     295            $vol_host = get_volume($key);
     296            if ($vol_host eq 'ipp066') {
     297                # Really?
     298                $vol_host = get_volume($key);
     299#               if ($vol_host eq 'ipp066') {}  #fine.  Be that way.  Jerk.
     300#                 
     301            }
     302        }
     303    }
    284304    return($vol_host);
    285305}
     
    326346    return($sum);
    327347}
     348
     349sub actual_local_md5sum {
     350    my $filename = shift;
     351    my $response = `md5sum $filename`;
     352    chomp($response);
     353    my ($sum, undef) = split /\s+/, $response;
     354     unless(defined($sum)) {
     355         warn("Failed to calculate md5sum Actually locally. $filename $host $volume");
     356     }
     357    return($sum);
     358}
  • trunk/tools/stsci_disks/p2_check.pl

    r38475 r38682  
    327327    log_print("STOP $stage $stage_id $path_base");
    328328}
     329
    329330close(MANIFEST);   
    330    
     331log_print("END $stage $stage_id ${manifest_dir}/${stage}.${stage_id}.MANIFEST");   
    331332
    332333sub my_die {
     
    353354    my ($vol_id, $vol_host, $vol_path, $xattr, $forbidden_cabinet);   
    354355    my $max_used_space = 0.98;
    355     my $topfew_count = 15;
     356    my $topfew_count = 25;
    356357    eval {
    357358        my $rows;
  • trunk/tools/stsci_disks/p3_permcheck.pl

    r38680 r38682  
    7171
    7272my @volumes = ();
    73 for (my $i = 4; $i <= 4; $i++) {
    74     my $max = 3;
    75     if ($i == 4) { $max = 2; }
     73for (my $i = 4; $i <= 5; $i++) {
     74    my $max = 2;
    7675    for (my $j = 0; $j < $max; $j++) {
    7776        push @volumes, sprintf("ippb%02d.%1d",$i,$j);
     
    8382my $command;
    8483if ($stage eq 'raw') {
     84    $command = "regtool -processedimfile -data_state full -exp_id $stage_id -dbname $dbname";
     85}
     86elsif ($stage eq 'isp') {
     87    $command = "regtool -processedimfile -data_state full -exp_id $stage_id -dbname $dbname";
     88}
     89elsif ($stage eq 'ssp') {
    8590    $command = "regtool -processedimfile -data_state full -exp_id $stage_id -dbname $dbname";
    8691}
     
    99104my @keys = ();
    100105foreach my $stageEntry ( @{ $stageData } ) {
    101     if ($stage eq 'raw') {
    102         if ($stageEntry->{ignored}) { next; }
    103         push @keys, $stageEntry->{uri};
     106    if (($stage eq 'raw')||($stage eq 'ssp')||($stage eq 'isp')) {
     107        if ($stageEntry->{ignored}) { next; }
     108        push @keys, $stageEntry->{uri};
    104109    }
    105110    elsif ($stage eq 'cam') {
    106         push @keys, $stageEntry->{path_base} . ".smf";
    107         for (my $u = 0; $u < 8; $u++) {
    108             for (my $v = 0; $v < 8; $v++) {
    109                 if ((($u == 0)||($u == 7))&&
    110                     (($v == 0)||($v == 7))) { next; }
    111                 push @keys, $stageEntry->{path_base} . ".XY${u}${v}.mk.fits";
    112             }
    113         }
     111        push @keys, $stageEntry->{path_base} . ".smf";
     112        for (my $u = 0; $u < 8; $u++) {
     113            for (my $v = 0; $v < 8; $v++) {
     114                if ((($u == 0)||($u == 7))&&
     115                    (($v == 0)||($v == 7))) { next; }
     116                push @keys, $stageEntry->{path_base} . ".XY${u}${v}.mk.fits";
     117            }
     118        }
    114119    }
    115120}
     
    120125    my ($ipp_copies,$stsci_copies) = check_instances($key);
    121126    if ($stsci_copies != 0) {
    122         for (my $i = 0; $i < $stsci_copies; $i++) {
    123             $neb->replicate($key,$rand_vol);
    124         }
    125         print ">> REP: $key $rand_vol\n";
    126         sleep(5);
    127         my ($ipp_copies,$stsci_copies) = check_instances($key);
     127        for (my $i = 0; $i < $stsci_copies; $i++) {
     128            $neb->replicate($key,$rand_vol);
     129        }
     130        print ">> REP: $key $rand_vol\n";
     131        sleep(5);
     132        my ($ipp_copies,$stsci_copies) = check_instances($key);
    128133    }
    129     if ($ipp_copies == 1) {
    130         $neb->replicate($key,$rand_vol);
    131         print ">> REP: $key $rand_vol\n";
    132         sleep(5);
    133         my ($ipp_copies,$stsci_copies) = check_instances($key);
    134     }
    135     if ($ipp_copies >= 2) {
    136         $good ++;
     134#     if ($ipp_copies == 1) {
     135#         $neb->replicate($key,$rand_vol);
     136#         print ">> REP: $key $rand_vol\n";
     137#         sleep(5);
     138#         my ($ipp_copies,$stsci_copies) = check_instances($key);
     139#     }
     140    if ($ipp_copies >= 1) {
     141        $good ++;
    137142    }
    138143    else {
    139         print ">> $ipp_copies $stsci_copies\n";
    140         push @issues, $key;
     144        print ">> $ipp_copies $stsci_copies\n";
     145        push @issues, $key;
    141146    }
    142147    print "$key $good $#issues\n";
     
    146151if ($#issues != -1) {
    147152    foreach my $key (@issues) {
    148         my ($ipp_copies,$stsci_copies) = check_instances($key);
    149         if ($ipp_copies < 2) {
    150             print "CHECK: $key\n";
    151             $bad++;
    152         }
     153        my ($ipp_copies,$stsci_copies) = check_instances($key);
     154        if ($ipp_copies < 2) {
     155            print "CHECK: $key\n";
     156            $bad++;
     157        }
    153158    }
    154159}
     
    163168    my $ipp_copies = 0;
    164169    my $stsci_copies = 0;
    165     foreach my $uri (@{ $uris }) { 
    166         if ($uri =~ /file:...data.ipp/) {
    167             $ipp_copies++;
    168         }
    169         if ($uri =~ /file:...data.stsci/) {
    170             $stsci_copies++;
    171         }
     170    foreach my $uri (@{ $uris }) {
     171        if ($uri =~ /file:...data.ipp/) {
     172            $ipp_copies++;
     173        }
     174        if ($uri =~ /file:...data.stsci/) {
     175            $stsci_copies++;
     176        }
    172177    }
    173178    return($ipp_copies,$stsci_copies);
Note: See TracChangeset for help on using the changeset viewer.