IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/ippTasks/nightly_stacks.pro

    r26950 r27517  
    1212
    1313macro nightly.stacks.off
     14    ns.initday.off
     15    ns.registration.off
     16    ns.burntool.off
     17    ns.chips.off
     18    ns.stacks.off
     19end
     20
     21macro ns.on
     22    ns.initday.on
     23    ns.registration.on
     24    ns.burntool.on
     25    ns.chips.on
     26    ns.stacks.on
     27end
     28
     29macro ns.off
    1430    ns.initday.off
    1531    ns.registration.off
     
    107123
    108124book init nsData
     125book init nsBurntool
    109126#
    110127# Macros to control the book.
     
    122139       echo $date $state
    123140    end
     141    book npages nsBurntool -var Npages
    124142end
    125143
     
    265283    ipptool2book stdout nsData -uniq -key date
    266284
     285    # remove the burntool page if we're done with it.
     286    book getword nsData $options:0 nsState -var ns_STATE
     287    if ("$ns_STATE" == "QUEUECHIPS")
     288        book delpage nsBurntool $options:0
     289    end
     290
    267291    if ($VERBOSE > 2)
    268292        book listbook nsData
     
    310334
    311335     if ("$ns_STATE" != "QUEUECHIPS") break
     336     $BURNTOOLING = 0
    312337     $run = automate_stacks.pl --queue_chips --date $date
    313338     command $run
     
    427452    book delpage nsData $options:0
    428453# We've queued up stacking. We're done with this date, so don't reload the page.
    429 #    ipptool2book stdout nsData -uniq -key date
     454    ipptool2book stdout nsData -uniq -key date
    430455    if ($VERBOSE > 2)
    431456        book listbook nsData
     
    447472
    448473#
    449 # Generate a list of date ranges that need to be processed with burntool
     474# Generate a list of date ranges and chips that need to be processed with burntool
    450475#
    451476task              ns.burntool.load
     
    457482
    458483  task.exec
    459      stdout NULL
    460      stderr $LOGDIR/ns.burntool.log
    461 
    462      book getpage nsData $ns_burnPAGE -var date
    463      book getword nsData $date nsState -var ns_STATE
    464      book npages nsData -var Npages
    465 
    466     if ($VERBOSE > 5)
    467        echo "ns.burntool.load: " $ns_burnPAGE $date $ns_STATE $Npages
    468     end
    469 
    470      $ns_burnPAGE ++
    471      if ($ns_burnPAGE >= $Npages) set ns_burnPAGE = 0
    472      option $date
    473 
    474      if ("$ns_STATE" != "NEEDSBURNING") break
    475      $run = automate_stacks.pl --define_burntool --date $date
    476      command $run
    477    end
     484    stdout NULL
     485    stderr $LOGDIR/ns.burntool.log
     486
     487    book getpage nsData $ns_burnPAGE -var date
     488    book getword nsData $date nsState -var ns_STATE
     489    book npages nsData -var Npages
     490
     491    if ($VERBOSE > 5)
     492        echo "ns.burntool.load: " $ns_burnPAGE $date $ns_STATE $Npages
     493    end
     494
     495    $ns_burnPAGE ++
     496    if ($ns_burnPAGE >= $Npages) set ns_burnPAGE = 0
     497    option $date
     498   
     499    if ("$ns_STATE" != "NEEDSBURNING") break
     500
     501    $run = automate_stacks.pl --define_burntool --date $date
     502    command $run
     503  end
    478504  # success
    479505  task.exit   0
    480506#    convert 'stdout' to book format
    481     book delpage nsData $options:0
    482     ipptool2book stdout nsData -uniq -key date
     507#    book delpage nsBurntool $options:0
     508    ipptool2book stdout nsBurntool -uniq -key date
     509    book setword nsData $options:0 nsState "QUEUEBURNING"
     510
    483511    if ($VERBOSE > 2)
    484512        book listbook nsData
     
    500528
    501529#
    502 # Magically run burntool on the data, based on the time ranges stored in our book.
     530# Magically run burntool on the data, based on the information stored in our book.
    503531#
    504532task              ns.burntool.run
     
    506534  periods         -exec $LOADEXEC
    507535  periods         -timeout 10800
    508   npending        20
     536  npending        30
    509537  task.exec
    510538     stdout NULL
     
    516544
    517545    if ($VERBOSE > 5)
    518        echo "ns.burntool.run: " $ns_RburnPAGE $date $ns_STATE $Npages
    519     end
    520 
    521      $ns_RburnPAGE ++
    522      if ($ns_RburnPAGE >= $Npages) set ns_RburnPAGE = 0
    523 
    524      if ("$ns_STATE" != "QUEUEBURNING") break
    525         book getword nsData $date btN -var btN
    526         book getword nsData $date btNCounter -var btNcounter
    527 
    528         if ($btNcounter > $btN)
    529             book setword nsData $date nsState "BURNING"
    530             break
    531         end
    532 
    533         sprintf start_date_label "btBegin%d"   $btNcounter
    534         sprintf end_date_label   "btEnd%d"     $btNcounter
    535         sprintf counter_label    "btCounter%d" $btNcounter
    536 
    537         book getword nsData $date $start_date_label -var start_date
    538         book getword nsData $date $end_date_label -var end_date
    539         book getword nsData $date $counter_label -var chip_counter
     546        echo "ns.burntool.run: " $ns_RburnPAGE $date $ns_STATE $Npages
     547    end
     548
     549    $ns_RburnPAGE ++
     550    if ($ns_RburnPAGE >= $Npages) set ns_RburnPAGE = 0
     551    if (("$ns_STATE" != "QUEUEBURNING")&&("$ns_STATE" != "BURNING")) break
     552    $BURNTOOLING = 1
     553    # Find out where in the list of jobs we are
     554    book getword nsBurntool $date btN -var btN
     555    book getword nsBurntool $date btNCounter -var btNcounter
     556
     557    if ($VERBOSE > 5)
     558        echo "ns.burntool.run: Status: " $btNcounter $date
     559    end
     560
     561    if ("$ns_STATE" == "QUEUEBURNING")
     562        $new_state = "QUEUEBURNING"
     563    end
     564    if ("$ns_STATE" == "BURNING")
     565        $new_state = "BURNING"
     566    end
     567    if ($btNcounter + 1 > $btN)
     568        $new_state = "BURNING"
     569    end
     570    if ($btNcounter > $btN)
     571        $btNcounter = 0
     572    end
     573    if ($VERBOSE > 5)
     574        echo "ns.burntool.run: Status: " $btNcounter $new_state
     575    end
     576   
     577    # Increment the counter in the book for the next job.
     578    $counter_update = $btNcounter + 1
     579    book setword nsBurntool $date btNCounter $counter_update
     580#    book setword nsData $options:0 nsState $options:1
     581    book setword nsData $date nsState $new_state
     582
     583    # Get the current status of this job, and skip if it doesn't need to process.
     584    sprintf status_label     "bt%dStatus"  $btNcounter
     585    book getword nsBurntool $date $status_label   -var status
     586
     587    if ($VERBOSE > 5)
     588        echo "ns.burntool.run: Status: " $btNcounter $status $date $status_label
     589    end
     590    if (("$status" == "FINISHED")||("$status" == "RUN")) break 
     591   
     592    # Continue loading information to process this job
     593    sprintf start_date_label "bt%dBegin"   $btNcounter
     594    sprintf end_date_label   "bt%dEnd"     $btNcounter
     595    sprintf class_count_label "bt%dClass"   $btNcounter
     596
     597    book getword nsBurntool $date $start_date_label -var start_date
     598    book getword nsBurntool $date $end_date_label -var end_date
     599    book getword nsBurntool $date $class_count_label -var chip_counter
     600
     601    # Lookup class_id/host pairs
     602    list word -split $hostmatch:$chip_counter
     603    $class_id = $word:0
     604    $host = $word:1
     605    host $host
     606#    set.host.for.camera GPC1 $class_id
     607    $logfile = "burntool_logs/$class_id.$start_date.log"
     608
     609    $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile
    540610       
    541         list word -split $hostmatch:$chip_counter
    542         $class_id = $word:0
    543         $host = $word:1
    544         host $host
    545         $logfile = "burntool_logs/$class_id.$start_date.log"
    546 
    547         $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile
    548        
    549         echo "ns.burntool.run: " $date $btN $btNcounter $start_date $end_date $chip_counter $class_id $host $logfile $run
    550         $chip_counter ++
    551         if ($chip_counter >= $hostmatch:n)
    552            $chip_counter = 0
    553            $btNcounter ++
    554         end
    555         $new_state = "QUEUEBURNING"
    556         if ($btNcounter > $btN)
    557             $new_state = "BURNING"
    558         end
    559 
    560         echo "ns.burntool.run: " $date $btN $btNcounter $chip_counter $new_state
    561         book setword nsData $date $counter_label $chip_counter
    562         book setword nsData $date btNCounter $btNcounter
    563         option $date $new_state
    564        
    565         command $run
     611    echo "ns.burntool.run: " $date $btN $btNcounter $start_date $end_date $chip_counter $class_id $host $logfile $run
     612    echo "ns.burntool.run: " $date $btN $btNcounter $chip_counter $new_state
     613
     614    book setword nsBurntool $date $status_label RUN
     615    option $date $new_state $status_label
     616
     617    command $run
    566618#     command /bin/true
    567619   end
     
    569621  task.exit   0
    570622#    convert 'stdout' to book format
    571 #    book delpage nsData $options:0
    572 #    ipptool2book stdout nsData -uniq -key date
    573     book setword nsData $options:0 nsState $options:1
    574 
     623    # Set data state based on if we're queueing or waiting
     624    # Set the job state for success.
     625    book setword nsBurntool $options:0 $options:2 FINISHED
    575626    if ($VERBOSE > 2)
    576627        book listbook nsData
     
    580631  # locked list
    581632  task.exit    default
     633    book setword nsBurntool $options:0 $options:2 FAIL
    582634    showcommand failure
    583635  end
    584636  task.exit    crash
     637    book setword nsBurntool $options:0 $options:2 FAIL
    585638    showcommand crash
    586639  end
    587640  #operation times out?
    588641  task.exit    timeout
     642    book setword nsBurntool $options:0 $options:2 FAIL
    589643    showcommand timeout
    590644  end
Note: See TracChangeset for help on using the changeset viewer.