IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24038 for trunk/ippTasks


Ignore:
Timestamp:
May 1, 2009, 5:28:52 PM (17 years ago)
Author:
bills
Message:

on receive side of distribution, optionally create a fileset in a status data store
defer {$stage}tool -importrun until all of the files have been downloaded
in the dist.queuruns task queue rcruns

Location:
trunk/ippTasks
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/dist.pro

    r24001 r24038  
    4242    active true
    4343  end
     44  task dist.queueruns
     45    active true
     46  end
    4447end
    4548macro dist.off
    … …  
    5457  end
    5558  task dist.advance.run
     59    active false
     60  end
     61  task dist.queueruns
    5662    active false
    5763  end
    … …  
    298304
    299305  periods      -poll $RUNPOLL
    300   periods      -exec 10
     306  periods      -exec 30
    301307  periods      -timeout 45
    302308  npending     1
  • trunk/ippTasks/rcserver.pro

    r23912 r24038  
    173173
    174174  periods      -poll $LOADPOLL
    175   periods      -exec $LOADEXEC
     175#  periods      -exec $LOADEXEC
     176  periods      -exec 20
    176177  periods      -timeout 30
    177178  npending     1
  • trunk/ippTasks/receive.pro

    r23899 r24038  
    2020###
    2121### receivetool -revert: remove result after something goes wrong
     22###
     23### receivetool -toadvance: filesets for which all files have been downloaded and are ready
     24### to complete processing
    2225
    2326# test for required global variables
    … …  
    2730book init receiveFileset
    2831book init receiveFile
     32book init receiveAdvance
    2933
    3034macro receive.status
    … …  
    3236  book listbook receiveFileset
    3337  book listbook receiveFile
     38  book listbook receiveAdvance
    3439end
    3540
    … …  
    3843  book init receiveFileset
    3944  book init receiveFile
     45  book init receiveAdvance
    4046end
    4147
    … …  
    5965    active true
    6066  end
     67  task receive.advance.load
     68    active true
     69  end
     70  task receive.advance.run
     71    active true
     72  end
    6173end
    6274
    … …  
    8092    active false
    8193  end
     94  task receive.advance.load
     95    active false
     96  end
     97  task receive.advance.run
     98    active false
     99  end
    82100end
    83101
    … …  
    85103# this variable will cycle through the known database names
    86104$receive_DB = 0
     105$receive_Advance_DB = 0
    87106
    88107task           receive.source.load
    … …  
    380399    book getword receiveFile $pageName product -var PRODUCT
    381400    book getword receiveFile $pageName fileset -var FILESET
     401    book getword receiveFile $pageName fileset_id -var FILESET_ID
    382402    book getword receiveFile $pageName file -var FILE
    383403    book getword receiveFile $pageName workdir -var WORKDIR
    … …  
    388408    stderr $LOGDIR/receive.file.log
    389409
    390     $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --file $FILE --workdir $WORKDIR
     410    $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --fileset_id $FILESET_ID --file $FILE --workdir $WORKDIR
    391411    add_standard_args run
    392412
    … …  
    419439  end
    420440end
     441
     442task           receive.advance.load
     443  host         local
     444
     445  periods      -poll $LOADPOLL
     446  periods      -exec $LOADEXEC
     447  periods      -timeout 30
     448  npending     1
     449
     450  stdout NULL
     451  stderr $LOGDIR/receive.advance.log
     452
     453  task.exec
     454    $run = receivetool -toadvance
     455    if ($DB:n == 0)
     456      option DEFAULT
     457    else
     458      # save the DB name for the exit tasks
     459      option $DB:$receive_Advance_DB
     460      $run = $run -dbname $DB:$receive_Advance_DB
     461      $receive_Advance_DB ++
     462      if ($receive_Advance_DB >= $DB:n) set receive_Advance_DB = 0
     463    end
     464    add_poll_args run
     465    command $run
     466  end
     467
     468  # success
     469  task.exit    0
     470    # convert 'stdout' to book format
     471    ipptool2book stdout receiveAdvance -key fileset_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     472    if ($VERBOSE > 2)
     473      book listbook receiveAdvance
     474    end
     475
     476    # delete existing entries in the appropriate pantaskStates
     477    process_cleanup receiveAdvance
     478  end
     479
     480  # locked list
     481  task.exit    default
     482    showcommand failure
     483  end
     484
     485  task.exit    crash
     486    showcommand crash
     487  end
     488
     489  # operation times out?
     490  task.exit    timeout
     491    showcommand timeout
     492  end
     493end
     494
     495task           receive.advance.run
     496  periods      -poll $RUNPOLL
     497  periods      -exec $RUNEXEC
     498  periods      -timeout 60
     499
     500  task.exec
     501    book npages receiveAdvance -var N
     502    if ($N == 0) break
     503    if ($NETWORK == 0) break
     504   
     505    book getpage receiveAdvance 0 -var pageName -key pantaskState INIT
     506    if ("$pageName" == "NULL") break
     507
     508    book setword receiveAdvance $pageName pantaskState RUN
     509    book getword receiveAdvance $pageName fileset_id -var FILESET_ID
     510    book getword receiveAdvance $pageName fileset -var FILESET
     511    book getword receiveAdvance $pageName dbinfo_uri -var DBINFO_URI
     512    book getword receiveAdvance $pageName status_product -var STATUS_PRODUCT
     513    book getword receiveAdvance $pageName ds_dbname -var DS_DBNAME
     514    book getword receiveAdvance $pageName ds_dbhost -var DS_DBHOST
     515    book getword receiveAdvance $pageName dbname -var DBNAME
     516
     517    stdout $LOGDIR/receive.advance.log
     518    stderr $LOGDIR/receive.advance.log
     519
     520    $run = receive_advance.pl --fileset_id $FILESET_ID --fileset $FILESET --dbinfo_uri $DBINFO_URI --status_product $STATUS_PRODUCT --ds_dbname $DS_DBNAME --ds_dbhost $DS_DBHOST
     521    add_standard_args run
     522
     523    # save the pageName for future reference below
     524    options $pageName
     525
     526    # create the command line
     527    if ($VERBOSE > 1)
     528      echo command $run
     529    end
     530    command $run
     531  end
     532
     533  # default exit status
     534  task.exit    default
     535    process_exit receiveAdvance $options:0 $JOB_STATUS
     536  end
     537
     538  # locked list
     539  task.exit    crash
     540    showcommand crash
     541    echo "hostname: $JOB_HOSTNAME"
     542    book setword receiveAdvance $options:0 pantaskState CRASH
     543  end
     544
     545  # operation timed out?
     546  task.exit    timeout
     547    showcommand timeout
     548    book setword receiveAdvance $options:0 pantaskState TIMEOUT
     549  end
     550end
Note: See TracChangeset for help on using the changeset viewer.