IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2011, 2:34:55 PM (15 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/ipp-20110213/pstamp/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/pstamp/scripts/pstamp_checkdependent.pl

    r30676 r30812  
    2727my $IPP_DIFF_MODE_STACK_STACK = 4;
    2828
    29 my ($dep_id, $stage, $stage_id, $component, $imagedb, $rlabel, $need_magic, $fault_count, $max_fault_count);
     29my ($dep_id, $stage, $stage_id, $component, $imagedb, $rlabel, $need_magic, $fault_count, $max_fault_count, $logfile);
    3030my ($dbname, $ps_dbserver, $verbose, $save_temps, $no_update);
    3131
     
    4040    'fault_count=i' =>  \$fault_count,
    4141    'max_fault_count=i' =>  \$max_fault_count,
     42    'logfile=s'     =>  \$logfile,
    4243    'dbname=s'      =>  \$dbname,       # postage stamp server dbname
    4344    'dbserver=s'    =>  \$ps_dbserver,  # postage stamp server dbserver
     
    6869my $ipprc = PS::IPP::Config->new();
    6970
     71if ($logfile) {
     72   $ipprc->redirect_output($logfile);
     73}
     74
    7075if (!$ps_dbserver) {
    7176    $ps_dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
     
    314319    my $data_state = $metadata->{data_state};
    315320
     321    # The update system currently requires that data that has been magicked be destreaked
     322    # at chip stage so it needs magic even if the customer doesn't.
     323    if ($metadata->{magicked} != 0) {
     324        $need_magic = 1;
     325    }
     326
    316327    if (($state =~ /error/) or ($state =~ /purged/) or ($state =~ /scrubbed/) or ($state eq 'drop') or
    317328         ($data_state =~ /error/) or ($data_state =~ /purged/) or ($data_state =~ /scrubbed/) or ($data_state eq 'drop')) {
     
    350361    foreach my $chip (@$data) {
    351362        $chip_id = $chip->{chip_id};
    352         if (($chip->{data_state} ne 'full') or ($need_magic and ($chip->{magicked} <= 0))) {
     363
     364        # if chip has been magicked before require it to be magicked again
     365        # because the warp pending query requires it.
     366        if ($chip->{magicked} < 0) {
     367            print "Input has been destreaked so we must destreak before warping\n";
     368            $need_magic = 1
     369        }
     370
     371        if ($need_magic and ($chip->{magicked} eq 0)) {
     372            my_die("Client requires magic, but chip never magicked. How did this dependent get queued?", $PS_EXIT_PROG_ERROR);
     373        }
     374
     375        if (($chip->{data_state} ne 'full') or ($need_magic and ($chip->{magicked} < 0))) {
    353376            $chips_ready = 0;
    354377            $chip->{fault} = $chip->{chip_fault};
     
    399422    my $skycell = $metadata;
    400423    my $skycell_id = $skycell->{skycell_id};
     424
     425    # The update system currently requires that data that has been magicked be destreaked
     426    # at chip stage so it needs magic even if the customer doesn't.
     427    if ($metadata->{magicked} != 0) {
     428        $need_magic = 1;
     429    }
    401430
    402431    if ($diff_mode == $IPP_DIFF_MODE_WARP_STACK ) {
  • branches/eam_branches/ipp-20110213/pstamp/scripts/pstampparse.pl

    r30565 r30812  
    3131my $no_update;
    3232my $dest_requires_magic;
     33
     34# set this to true to disable update processing
     35my $no_updates_allowed = 0;
    3336
    3437GetOptions(
     
    424427                # and this user's data store destination is allowed uncensored stamps, so accept the request
    425428                $need_magic = 0;
     429
     430                # Since user can get unmagicked data "by coordinate" requests can go back in time
     431                # to dredge unusable data from the "dark days"...
     432                if ($req_type eq 'bycoord' and $mjd_min eq 0) {
     433                    # ... so unless the user sets mjd_min clamp it to 2009-04-01
     434                    # XXX: This value should live in the pstampProject table not be hardcoded here
     435                    $mjd_min = 54922;
     436                }
    426437            } else {
    427438                print STDERR "Error row $rownum: User not authorized to to request uncensored stamps.\n";
     
    465476    print "Time to locate_images for row $rownum $dtime_locate\n";
    466477
    467     # handle this XXX: what did I mean by this comment
     478    # handle this
     479    # XXX: what did I mean by that comment?
    468480    $row->{need_magic} = $need_magic;
    469481
    470482    $num_jobs += queueJobs($mode, \@rowList, $imageList);
    471483
    472     # if a row slipped through with no jobs add one
     484    # if a row slipped through with no jobs add a faulted one
    473485    foreach my $row (@rowList) {
    474486        if ($row->{job_num} == 0) {
     
    495507    my $option_mask = $row->{OPTION_MASK};
    496508    my $components = $row->{components};
     509
     510    $option_mask |= $PSTAMP_NO_WAIT_FOR_UPDATE if $no_updates_allowed;
    497511
    498512    my $roi_string;
     
    668682    my $rownum = $row->{ROWNUM};
    669683    my $option_mask = $row->{OPTION_MASK};
     684
     685    $option_mask |= $PSTAMP_NO_WAIT_FOR_UPDATE if $no_updates_allowed;
    670686
    671687    # For dist_bundle we need
  • branches/eam_branches/ipp-20110213/pstamp/scripts/pstampstopfaulted

    r29428 r30812  
     1#!/bin/bash
     2#
     3# script executed by the task pstamp.stopfaulted to stop proceessing of jobs
     4# and dependents that have fault_count >= some maximum value. That value is expected
     5# to be passed in as an argument otherwise the default in pstamptool is used
     6# All arguments are passed to pstamptool
    17
    2 # script executed by the task pstamp.stopfaulted to stop proceessing of jobs
    3 # and dependents that have faulted 5 or more times
    4 # all arguments to this script are passed to pstamptool
    5 
    6 # 25 is PSTAMP_NOT_AVAILABLE
     8# note: 25 is PSTAMP_NOT_AVAILABLE
    79fault_code=25
    8 fault_count=3
    910
    1011date
    1112echo stopping faulted dependent jobs
    12 pstamptool -stopdependentjob -set_fault $fault_code -fault_count $fault_count $*
     13cmd="pstamptool -stopdependentjob -set_fault $fault_code $*"
     14echo $cmd
     15$cmd
    1316
    1417echo stopping faulted jobs
    15 pstamptool -updatejob -state run -set_state stop -set_fault $fault_code -fault_count $fault_count $*
     18cmd="pstamptool -updatejob -state run -set_state stop -set_fault $fault_code $*"
     19echo $cmd
     20$cmd
Note: See TracChangeset for help on using the changeset viewer.