IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27874 for trunk/ippTasks


Ignore:
Timestamp:
May 6, 2010, 1:55:20 PM (16 years ago)
Author:
bills
Message:

Various changes to the postage stamp server and associated tables.
Implemented cleanup. Added pstampRequest.outdir changed spelling of out_dir
to outdir. various other cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pstamp.pro

    r27857 r27874  
    1414$pstampRev_DB = 0
    1515$pstampDep_DB = 0
     16$pstampCleanup_DB = 0
    1617
    1718# set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config
     
    3031    book init pstampFinish
    3132    book init pstampDependent
     33    book init pstampCleanup
    3234end
    3335
     
    5860        active true
    5961    end
    60     task pstamp.job.revert
    61         active true
    62     end
    6362    task pstamp.dependent.load
    6463        active true
     
    9493    end
    9594    task pstamp.dependent.load
    96         active true
     95        active false
     96    end
     97    task pstamp.dependent.run
     98        active false
    9799    end
    98100end
     
    105107macro pstamp.revert.off
    106108    task pstamp.job.revert
     109        active false
     110    end
     111end
     112macro pstamp.cleanup.on
     113    task pstamp.cleanup.load
     114        active true
     115    end
     116    task pstamp.cleanup.run
     117        active true
     118    end
     119end
     120macro pstamp.cleanup.off
     121    task pstamp.cleanup.run
     122        active false
     123    end
     124    task pstamp.cleanup.run
    107125        active false
    108126    end
     
    157175
    158176    task.exec
    159         stdout $LOGSUBDIR/pstamp.request.load.log
     177        stdout NULL
    160178        stderr $LOGSUBDIR/pstamp.request.load.log
    161179        $run = pstamptool -pendingreq
     
    200218    periods     -exec $RUNEXEC
    201219    periods     -timeout 300
    202     npending  6
    203 
    204     task.exec
    205         stdout $LOGSUBDIR/pstamp.request.run.log
     220
     221    task.exec
     222        stdout NULL
    206223        stderr $LOGSUBDIR/pstamp.request.run.log
    207224        book npages pstampRequest -var N
     
    216233        book getword pstampRequest $pageName uri -var URI
    217234        book getword pstampRequest $pageName ds_outProduct -var PRODUCT
     235        book getword pstampRequest $pageName outdir -var OUTDIR
    218236        book getword pstampRequest $pageName label -var LABEL
    219237
    220238        host anyhost
    221239
    222         $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --label $LABEL --redirect-output
     240        $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --outdir $OUTDIR --label $LABEL --redirect-output
    223241
    224242        add_standard_args run
     
    261279
    262280    task.exec
    263         stdout $LOGSUBDIR/pstamp.finish.load.log
     281        stdout NULL
    264282        stderr $LOGSUBDIR/pstamp.finish.load.log
    265283        $run = pstamptool  -completedreq
     
    306324
    307325    task.exec
    308         stdout $LOGSUBDIR/request.finish.run.log
     326        stdout NULL
    309327        stderr $LOGSUBDIR/request.finish.run.log
    310328        book npages pstampFinish -var N
     
    321339        book getword pstampFinish $pageName name -var REQ_NAME
    322340        book getword pstampFinish $pageName outProduct -var PRODUCT
    323 
    324         $run = request_finish.pl --req_id $REQ_ID --req_type $REQ_TYPE --req_file $URI --req_name $REQ_NAME --product $PRODUCT --redirect-output
     341        book getword pstampFinish $pageName outdir -var OUTDIR
     342
     343        $run = request_finish.pl --req_id $REQ_ID --req_type $REQ_TYPE --req_file $URI --req_name $REQ_NAME --product $PRODUCT --outdir $OUTDIR --redirect-output
    325344
    326345        add_standard_args run
     
    363382
    364383    task.exec
    365         stdout $LOGSUBDIR/pstamp.job.load.log
     384        stdout NULL
    366385        stderr $LOGSUBDIR/pstamp.job.load.log
    367386        $run = pstamptool -pendingjob
     
    411430
    412431    task.exec
    413         stdout $LOGSUBDIR/pstamp.job.run.log
     432        stdout NULL
    414433        stderr $LOGSUBDIR/pstamp.job.run.log
    415434        book npages pstampJob -var N
     
    489508
    490509    task.exec
    491         stdout $LOGSUBDIR/pstamp.job.revert.log
     510        stdout NULL
    492511        stderr $LOGSUBDIR/pstamp.job.revert.log
    493512        $run = pstamptool -revertjob -all
     
    532551
    533552    task.exec
    534         stdout $LOGSUBDIR/pstamp.dependent.load.log
     553        stdout NULL
    535554        stderr $LOGSUBDIR/pstamp.dependent.load.log
    536555        $run = pstamptool -pendingdependent
     
    660679end
    661680
     681task pstamp.cleanup.load
     682    host        local
     683
     684    periods     -poll $LOADPOLL
     685    periods     -exec $LOADEXEC
     686    periods     -timeout 300
     687    npending    1
     688
     689    task.exec
     690        stdout NULL
     691        stderr $LOGSUBDIR/pstamp.cleanup.load.log
     692        $run = pstamptool -pendingcleanup
     693        if ($DB:n == 0)
     694            option DEFAULT
     695        else
     696            option $DB:$pstampCleanup_DB
     697            $run = $run $PS_DBSERVER -dbname $DB:$pstampCleanup_DB
     698            $pstampCleanup_DB ++
     699            if ($pstampCleanup_DB >= $DB:n) set pstampCleanup_DB = 0
     700        end
     701        add_poll_args run
     702        add_poll_labels run
     703        command $run
     704    end
     705
     706    task.exit $EXIT_SUCCESS
     707        ipptool2book stdout pstampCleanup -key req_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     708        if ($VERBOSE > 2)
     709            echo starting request
     710            book listbook pstampCleanup
     711        end
     712
     713        process_cleanup pstampCleanup
     714    end
     715
     716    task.exit   default
     717        showcommand failure
     718    end
     719
     720    task.exit   crash
     721        showcommand crash
     722    end
     723
     724    task.exit   timeout
     725        showcommand timeout
     726    end
     727end
     728
     729task pstamp.cleanup.run
     730    periods     -poll $RUNPOLL
     731    periods     -exec $RUNEXEC
     732    periods     -timeout 300
     733    # since everything is on one file system keep npending low to avoid
     734    # overloading nfs
     735
     736    npending    10
     737
     738    task.exec
     739        book npages pstampCleanup -var N
     740        if ($N == 0)
     741            periods -exec $RUNEXEC
     742            break
     743        end
     744        periods -exec 0.05
     745       
     746        book getpage pstampCleanup 0 -var pageName -key pantaskState INIT
     747        if ("$pageName" == "NULL") break
     748
     749        book setword pstampCleanup $pageName pantaskState RUN
     750        book getword pstampCleanup $pageName req_id -var REQ_ID
     751        book getword pstampCleanup $pageName dbname -var DBNAME
     752        book getword pstampCleanup $pageName name -var NAME
     753        book getword pstampCleanup $pageName outdir -var OUTDIR
     754        book getword pstampCleanup $pageName uri -var URI
     755        book getword pstampCleanup $pageName reqType -var REQTYPE
     756        book getword pstampCleanup $pageName outProduct -var PRODUCT
     757
     758        # XXX: have the script set this up this
     759        $MYLOGFILE=/data/ippdb02.0/pstamp/work/logs/cleanup.$REQ_ID
     760        stdout $MYLOGFILE
     761        stderr $MYLOGFILE
     762
     763        host anyhost
     764
     765        $run = pstamp_cleanup.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --name $NAME --outdir $OUTDIR --reqType $REQTYPE
     766
     767        add_standard_args run
     768        options $pageName
     769
     770        if ($VERBOSE > 1)
     771            echo command $run
     772        end
     773        command $run
     774    end
     775
     776
     777    task.exit $EXIT_SUCCESS
     778        process_exit pstampCleanup $options:0 $JOB_STATUS
     779    end
     780
     781    task.exit default
     782        showcommand failure
     783        process_exit pstampCleanup $options:0 $JOB_STATUS
     784    end
     785
     786    task.exit crash
     787        showcommand crash
     788        book setword pstampCleanup $options:0 pantaskState CRASH
     789    end
     790
     791    task.exit timeout
     792        showcommand timeout
     793        book setword pstampCleanup $options:0 pantaskState TIMEOUT
     794    end
     795end
     796
Note: See TracChangeset for help on using the changeset viewer.