IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2010, 11:33:14 AM (16 years ago)
Author:
bills
Message:

Enable the postage stamp server to generate stamps from cleaned up data.
"Works" for chip and warp stages. diff and maybe stack to do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pstamp.pro

    r27187 r27751  
    1313$pstampFin_DB = 0
    1414$pstampRev_DB = 0
     15$pstampDep_DB = 0
    1516
    1617# set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config
     
    2829    book init pstampJob
    2930    book init pstampFinish
     31    book init pstampDependent
    3032end
    3133
    3234pstamp.reset
    33 
    3435
    3536macro pstamp.on
     
    6061        active true
    6162    end
     63    task pstamp.dependent.load
     64        active true
     65    end
    6266end
    6367
     
    8892    task pstamp.job.revert
    8993        active false
     94    end
     95    task pstamp.dependent.load
     96        active true
    9097    end
    9198end
     
    208215        book getword pstampRequest $pageName uri -var URI
    209216        book getword pstampRequest $pageName ds_outProduct -var PRODUCT
     217        book getword pstampRequest $pageName label -var LABEL
    210218
    211219        host anyhost
    212220
    213         $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --redirect-output
     221        $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --label $LABEL --redirect-output
    214222
    215223        add_standard_args run
     
    512520end
    513521
     522task pstamp.dependent.load
     523    host        local
     524
     525    periods     -poll $LOADPOLL
     526    # XXX: create a macro for this
     527    periods     -exec 30
     528#    periods     -exec $LOADEXEC
     529    periods     -timeout 30
     530    npending    1
     531
     532    task.exec
     533        stdout $LOGSUBDIR/pstamp.dependent.load.log
     534        stderr $LOGSUBDIR/pstamp.dependent.load.log
     535        $run = pstamptool -pendingdependent
     536        if ($DB:n == 0)
     537            option DEFAULT
     538        else
     539            option $DB:$pstampDep_DB
     540            $run = $run -dbname $DB:$pstampDep_DB $PS_DBSERVER
     541            $pstampDep_DB ++
     542            if ($pstampDep_DB >= $DB:n) set pstampDep_DB = 0
     543        end
     544        add_poll_args run
     545        add_poll_labels run
     546        command $run
     547    end
     548
     549    task.exit $EXIT_SUCCESS
     550        ipptool2book stdout pstampDependent -key dep_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     551
     552        book npages pstampDependent -var N
     553        if ($VERBOSE > 2)
     554            book listbook pstampDependent
     555        end
     556
     557        # delete existing entries in the appropriate pantaskStates
     558        process_cleanup pstampDependent
     559    end
     560
     561    task.exit   crash
     562        showcommand crash
     563    end
     564
     565    task.exit   timeout
     566        showcommand timeout
     567    end
     568
     569    task.exit   default
     570        showcommand failure
     571    end
     572
     573end
     574
     575task pstamp.dependent.run
     576    periods     -poll $RUNPOLL
     577    periods     -exec $RUNEXEC
     578    periods     -timeout 300
     579
     580    task.exec
     581#        stdout $LOGSUBDIR/pstamp.dependent.run.log
     582#        stderr $LOGSUBDIR/pstamp.dependent.run.log
     583        book npages pstampDependent -var N
     584        if ($N == 0)
     585            periods -exec $RUNEXEC
     586            break
     587        end
     588        periods -exec 0.05
     589       
     590        book getpage pstampDependent 0 -var pageName -key pantaskState INIT
     591        if ("$pageName" == "NULL") break
     592
     593        #echo pageName: $pageName
     594
     595        book setword pstampDependent $pageName pantaskState RUN
     596        book getword pstampDependent $pageName dep_id     -var DEP_ID
     597        book getword pstampDependent $pageName state      -var STATE
     598        book getword pstampDependent $pageName stage      -var STAGE
     599        book getword pstampDependent $pageName stage_id   -var STAGE_ID
     600        book getword pstampDependent $pageName component  -var COMPONENT
     601        book getword pstampDependent $pageName imagedb    -var IMAGEDB
     602        book getword pstampDependent $pageName rlabel     -var RLABEL
     603#        book getword pstampDependent $pageName output_base -var OUTPUT_BASE
     604        book getword pstampDependent $pageName need_magic -var NEED_MAGIC
     605        book getword pstampDependent $pageName dbname     -var DBNAME
     606
     607        if ($VERBOSE > 1)
     608            book listpage pstampDependent $pageName
     609        end
     610
     611        host anyhost
     612
     613        if ("$NEED_MAGIC" == "T")
     614            $NEED_MAGIC="--need_magic"
     615        else
     616            $NEED_MAGIC=""
     617        end
     618
     619        # XXX: use OUTPUT_BASE for this
     620        $LOGFILE = /data/ipp053.0/home/bills/pstamp/logs/pstampdep.$DEP_ID.log
     621#        echo logfile is $LOGFILE
     622#        stdout $LOGFILE
     623#        stderr $LOGFILE
     624
     625        $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC
     626        add_standard_args run
     627
     628        options $pageName
     629
     630        if ($VERBOSE > 1)
     631            echo command $run
     632        end
     633        command $run
     634    end
     635
     636
     637    task.exit $EXIT_SUCCESS
     638        if ($VERBOSE > 1)
     639            echo pstamp.dependent.run task.exit $DEP_ID status: $JOB_STATUS
     640        end
     641        process_exit pstampDependent $options:0 $JOB_STATUS
     642    end
     643    task.exit default
     644        if ($VERBOSE > 1)
     645            echo pstamp.job.run task.exit $DEP_ID status: $JOB_STATUS
     646        end
     647        showcommand failure
     648        process_exit pstampDependent $options:0 $JOB_STATUS
     649    end
     650
     651    task.exit crash
     652        echo pstamp.job.run task.crash $DEP_ID status: $JOB_STATUS
     653        process_exit pstampDependent $options:0 $JOB_STATUS
     654        showcommand crash
     655        book setword pstampDependent $options:0 pantaskState CRASH
     656    end
     657
     658    task.exit timeout
     659        echo pstamp.job.run task.timeout $DEP_ID status: $JOB_STATUS
     660        process_exit pstampDependent $options:0 $JOB_STATUS
     661        showcommand timeout
     662        book setword pstampDependent $options:0 pantaskState TIMEOUT
     663    end
     664end
     665
Note: See TracChangeset for help on using the changeset viewer.