IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2011, 2:49:34 PM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20101205/ippTasks
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/ippTasks/diskbalance.pro

    r29631 r30579  
    194194    book getword balancePending $pageName source_name      -var SOURCE
    195195    book getword balancePending $pageName destination_name -var DESTINATION
    196    
     196    book getword balancePending $pageName destination_host -var DEST_HOST
    197197    # Fix this with multihost restriction when possible.
    198     set.host.for.balance $DESTINATION
     198    set.host.for.balance $DEST_HOST
    199199
    200200    stdout NULL
  • branches/eam_branches/ipp-20101205/ippTasks/dist.pro

    r30446 r30579  
    9595end
    9696
     97# This is now only used if we are not using a nebulous outroot
    9798macro get.host.for.component
    9899    if ($0 != 3)
     
    122123end
    123124
     125# This is now only used if we are not using a nebulous outroot
    124126macro set.dist.workdir.by.component
    125127    if ($0 != 5)
     
    139141    book getword ipphosts distribution count -var count
    140142    if ("$count" == "NULL")
    141         echo "ERROR: distributin hosts list is empty"
     143        echo "ERROR: distribution hosts list is empty"
    142144        break
    143145    end
     
    289291    end
    290292
    291 
    292     set.dist.workdir.by.component $DIST_STAGE_ID $COMPONENT $OUTDIR_TEMPLATE OUTDIR
    293     if ("$OUTDIR" == "NULL")
    294         echo ERROR failed to set workdir for $COMPONENT
    295         break
    296     end
    297 
    298293    substr $COMPONENT 0 3 COMP_HEAD
    299294    if ("$COMP_HEAD" == "sky")
    300295        set.host.for.skycell $COMPONENT
     296        set.workdir.by.skycell $COMPONENT $OUTDIR_TEMPLATE $default_host OUTDIR
    301297    else
    302         # assume component is a class_id, if not we will default to anyhost
     298        # assume component is a class_id, if  it is not we will default to
     299        # host "anyhost"
     300        # and volume "any"
    303301        set.host.for.camera $CAMERA $COMPONENT
     302        set.workdir.by.camera $CAMERA $COMPONENT $OUTDIR_TEMPLATE $default_host OUTDIR
     303    end
     304
     305    if ("$OUTDIR" == "NULL")
     306        echo ERROR failed to set workdir for $COMPONENT
     307        break
    304308    end
    305309
    306310    sprintf logfile "%s/dist.%s.%s.log" $OUTDIR $DIST_ID $COMPONENT
    307 #    stdout $logfile
    308 #    stderr $logfile
    309311
    310312    $run = dist_component.pl --dist_id $DIST_ID --camera $CAMERA --stage $DIST_STAGE --stage_id $DIST_STAGE_ID --component $COMPONENT --path_base $PATH_BASE --chip_path_base $CHIP_PATH_BASE --state $STATE --data_state $DATA_STATE $EXTRA_ARGS --outdir $OUTDIR --logfile $logfile
     
    401403    book getpage distToAdvance 0 -var pageName -key pantaskState INIT
    402404    if ("$pageName" == "NULL") break
     405
     406    # XXX the sql for disttool -toadvance does not include the camera:
     407    # hack around this for now
     408    $CAMERA = GPC1
    403409
    404410    book setword distToAdvance $pageName pantaskState RUN
     
    414420    end
    415421
    416     host anyhost
    417 
    418     # using $DIST_ID as the "component" works fine here since we only look
    419     # at the last two digits. But make sure that there 2 digits
    420     $fake_component = $STAGE_ID + 10
    421     set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR
     422    substr $OUTDIR_TEMPLATE 0 3 SCHEME
     423    if ("$SCHEME" == "neb")
     424        # XXX This does not work if workdir is not in nebulous
     425        # and $default_host == "any" because /data/any does not exist
     426        # use "dummy" as component. Result will be 'any'
     427        # set.workdir.by.camera $CAMERA dummy $OUTDIR_TEMPLATE $default_host OUTDIR
     428        set.workdir.by.camera GPC1 dummy $OUTDIR_TEMPLATE $default_host OUTDIR
     429    else
     430        # using $DIST_ID as the "component" works fine here since we only look
     431        # at the last two digits. But make sure that there 2 digits
     432        $fake_component = $STAGE_ID + 10
     433        set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR
     434    end
     435 
    422436    if ("$OUTDIR" == "NULL")
    423437        echo ERROR failed to set workdir for $DIST_ID
    424438        break
    425439    end
     440    host anyhost
    426441
    427442    sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID
    428 #    stdout $logfile
    429 #    stderr $logfile
    430 
    431     $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
     443
     444    $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --camera $CAMERA --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
    432445    add_standard_args run
    433446
  • branches/eam_branches/ipp-20101205/ippTasks/pstamp.pro

    r30446 r30579  
    1818$pstampStopFaulted_DB = 0
    1919
     20# give up on dependents with fault_count >= $PSTAMP_MAX_FAULT_COUNT
     21$PSTAMP_MAX_FAULT_COUNT = 5
     22macro set.max.fault.count
     23    $PSTAMP_MAX_FAULT_COUNT = $1
     24end
     25macro get.max.fault.count
     26    echo maximum fault count: $PSTAMP_MAX_FAULT_COUNT
     27end
     28$POLL_DEP = 500
     29
     30macro set.dependent.poll
     31    $POLL_DEP = $1
     32end
     33macro get.dependent.poll
     34    echo dependent poll limit: $POLL_DEP
     35end
     36
    2037# set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config
    2138# warning: no quotes around the two words. That causes the variable to get passed to pstamptool as one word
     
    137154    end
    138155end
     156
    139157macro pstamp.find.on
    140158    task pstamp.request.find
     
    143161end
    144162macro pstamp.find.off
    145     task pstamp.request.find.load
    146         active false
     163    task pstamp.request.find
     164        active false
     165    end
     166end
     167
     168macro pstamp.dependent.on
     169    task pstamp.dependent.load
     170        active true
     171    end
     172    task pstamp.dependent.run
     173        active true
     174    end
     175end
     176macro pstamp.dependent.off
     177    task pstamp.dependent.load
     178        active false
     179    end
     180    task pstamp.dependent.run
     181        active false
     182    end
     183end
     184
     185
     186macro pstamp.status.on
     187    task pstamp.save.status
     188        active true
     189    end
     190end
     191macro pstamp.status.off
     192    task pstamp.save.status
     193        active false
     194    end
     195end
     196
     197macro pstamp.status.set.exec
     198    task pstamp.save.status
     199        periods -exec $1
    147200    end
    148201end
     
    509562            echo pstamp.job.run task.exit $JOB_ID status: $JOB_STATUS
    510563        end
    511         showcommand failure
     564#        showcommand failure
    512565        process_exit pstampJob $options:0 $JOB_STATUS
    513566    end
     
    593646        add_poll_args run
    594647        add_poll_labels run
    595         command $run
     648        command $run -limit $POLL_DEP
    596649    end
    597650
     
    648701        book getword pstampDependent $pageName outdir     -var OUTDIR
    649702        book getword pstampDependent $pageName need_magic -var NEED_MAGIC
     703        book getword pstampDependent $pageName fault_count -var FAULT_COUNT
    650704        book getword pstampDependent $pageName dbname     -var DBNAME
    651705
     
    666720        stderr $MYLOGFILE
    667721
    668         $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC
     722        $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC --fault_count $FAULT_COUNT --max_fault_count $PSTAMP_MAX_FAULT_COUNT
    669723
    670724        add_standard_args run
     
    689743            echo pstamp.job.run task.exit $DEP_ID status: $JOB_STATUS
    690744        end
    691         showcommand failure
     745#        showcommand failure
    692746        process_exit pstampDependent $options:0 $JOB_STATUS
    693747    end
     
    905959    end
    906960end
     961
     962task pstamp.save.status
     963    host        local
     964
     965    periods     -poll $LOADPOLL
     966    periods     -exec 90
     967    periods     -timeout 20
     968    npending    1
     969
     970    task.exec
     971        stdout NULL
     972        stderr $LOGSUBDIR/pstamp.save.status.log
     973
     974        $run = pstamp_save_server_status.pl --update-link
     975        command $run
     976    end
     977
     978    task.exit $EXIT_SUCCESS
     979        # echo nothing to do
     980    end
     981
     982    task.exit   default
     983        showcommand failure
     984    end
     985
     986    task.exit   crash
     987        showcommand crash
     988    end
     989
     990    task.exit   timeout
     991        showcommand timeout
     992    end
     993end
  • branches/eam_branches/ipp-20101205/ippTasks/rcserver.pro

    r28792 r30579  
    4040    active false
    4141  end
    42   task rcserver.revert
    43     active false
    44   end
    4542end
    4643
     
    4845  task rcserver.revert
    4946    active true
     47  end
     48end
     49
     50macro rcserver.revert.off
     51  task rcserver.revert
     52    active false
    5053  end
    5154end
     
    136139
    137140    sprintf logfile "%s/makefs.%s.%s.log" $DIST_DIR $DIST_ID $DEST_ID
    138     stdout $logfile
    139     stderr $logfile
    140141
    141142    book setword rcPendingFS $pageName pantaskState RUN
    142143
    143     $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --data_group $DATA_GROUP --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
     144    $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --data_group $DATA_GROUP --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR --logfile $logfile
    144145
    145146    add_standard_args run
  • branches/eam_branches/ipp-20101205/ippTasks/register.pro

    r30446 r30579  
    105105
    106106macro register.add.date
    107   if ($0 != 2)
    108     echo "USAGE: register.add.date (YYYY-MM-DD)"
     107  if ($0 != 4)
     108    echo "USAGE: register.add.date (YYYY-MM-DD) (DBNAME) (VALID_BURNTOOL)"
    109109    break
    110110  end
     
    112112   book newpage regDates $1
    113113   book setword regDates $1 nsState NEW
    114    book setword regDates $1 dbname $DB:0
    115 end
    116 
    117 
    118 $valid_burntool_value = 14
     114   book setword regDates $1 dbname $2
     115   book setword regDates $1 valid_burntool $3
     116end
     117
     118
     119# $valid_burntool_value = 14
    119120$sunrise = 17:30:00
    120121$sunset  = 03:30:00
     
    565566     if ($Npages == 0)
    566567       $today = `date -u +%Y-%m-%d`
     568       $dbname = $DB:0
     569       $valid_burntool = 14
    567570     else
    568571       book getpage regDates $reg_datePAGE -var today
     572       book getword regDates $today dbname -var dbname
     573       book getword regDates $today valid_burntool -var valid_burntool
    569574       $reg_datePAGE ++
    570575       if ($reg_datePAGE >= $Npages) set reg_datePAGE = 0
     
    577582    $dateobs_begin = $today\T$sunset
    578583    $dateobs_end   = $today\T$sunrise
    579     $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool_value
    580     if ($DB:n == 0)
    581       option DEFAULT
    582     else
    583       # save the DB name for the exit tasks
    584       option $DB:$regPendingBurntoolImfile_DB
    585       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
    586       $regPendingBurntoolImfile_DB ++
    587       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
    588     end
     584    $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool
     585    $run = $run -dbname $dbname
     586    option $dbname
     587#     if ($DB:n == 0)
     588#       option DEFAULT
     589#     else
     590#       # save the DB name for the exit tasks
     591#       option $DB:$regPendingBurntoolImfile_DB
     592#       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
     593#       if ("$dbname" != "$DB:$regPendingBurntoolImfile_DB")
     594#         break
     595#       end
     596#       $regPendingBurntoolImfile_DB ++
     597#       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
     598#     end
    589599
    590600#    echo $run
     
    697707    book setword regDates $today nsState NEW
    698708    book setword regDates $today dbname $DB:0
     709    book setword regDates $today valid_burntool 14
    699710
    700711    command true
  • branches/eam_branches/ipp-20101205/ippTasks/survey.pro

    r30446 r30579  
    287287# user functions to manipulate dist labels
    288288macro survey.add.dist
    289   if ($0 != 2)
    290     echo "USAGE: survey.add.dist (label)"
     289  if ($0 != 3)
     290    echo "USAGE: survey.add.dist (label) (workdir)"
    291291    break
    292292  end
    293293  book newpage SURVEY_DIST $1
     294  book setword SURVEY_DIST $1 WORKDIR $2
    294295  book setword SURVEY_DIST $1 STATE PENDING
    295296end
     
    896897    end
    897898
     899    book getword SURVEY_DIST $label WORKDIR -var workdir_base
     900    $year = `date +%Y`
     901    $month = `date +%m`
     902    $day = `date +%d`
     903    $workdir = $workdir_base/$label/$year/$month/$day
     904
    898905    book setword SURVEY_DIST $label STATE DONE
    899906 
    900907    # note workdir is set by the script based on site.config
    901     $run = dist_defineruns.pl --label $label
     908    $run = dist_defineruns.pl --label $label --workdir $workdir
    902909
    903910    if ($DB:n == 0)
     
    908915    end
    909916   
    910 #    echo $run
     917    if ($VERBOSE > 1 )
     918        echo $run
     919    end
    911920    command $run
    912921  end
     
    11261135    end
    11271136   
    1128     echo $run
     1137    # echo $run
    11291138
    11301139    command $run
Note: See TracChangeset for help on using the changeset viewer.