Changeset 27839 for branches/simmosaic_branches/ippTasks/pstamp.pro
- Timestamp:
- May 3, 2010, 8:45:22 AM (16 years ago)
- Location:
- branches/simmosaic_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTasks/pstamp.pro (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simmosaic_branches
- Property svn:mergeinfo changed
-
branches/simmosaic_branches/ippTasks/pstamp.pro
r24831 r27839 1 2 #$VERBOSE = 3 1 # pstamp.pro : Postage Stamp Server tasks 2 3 check.globals 4 5 $LOGSUBDIR = $LOGDIR/pstamp 6 mkdir $LOGSUBDIR 3 7 4 8 # these variables wil cycle through the known database names … … 8 12 $pstampJob_DB = 0 9 13 $pstampFin_DB = 0 14 $pstampRev_DB = 0 15 $pstampDep_DB = 0 10 16 11 17 # set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config 12 # warning: no quotes around the two words. it cause itto get passed to pstamptool as one word13 # tricky to debug problem ensues18 # warning: no quotes around the two words. That causes the variable to get passed to pstamptool as one word 19 # and a tricky to debug problem ensues 14 20 # example: 15 # $PSDBSERVER = -dbserver hostname 16 $PS_DBSERVER = "" 21 # $PS_DBSERVER = -dbserver hostname 22 23 if ($?PS_DBSERVER == 0) 24 $PS_DBSERVER = "" 25 end 17 26 18 27 macro pstamp.reset … … 20 29 book init pstampJob 21 30 book init pstampFinish 31 book init pstampDependent 22 32 end 23 33 24 34 pstamp.reset 25 26 35 27 36 macro pstamp.on … … 49 58 active true 50 59 end 51 end 60 task pstamp.job.revert 61 active true 62 end 63 task pstamp.dependent.load 64 active true 65 end 66 end 67 52 68 53 69 macro pstamp.off … … 74 90 active false 75 91 end 92 task pstamp.job.revert 93 active false 94 end 95 task pstamp.dependent.load 96 active true 97 end 98 end 99 100 macro pstamp.revert.on 101 task pstamp.job.revert 102 active true 103 end 104 end 105 macro pstamp.revert.off 106 task pstamp.job.revert 107 active false 108 end 76 109 end 77 110 … … 81 114 periods -poll $LOADPOLL 82 115 periods -exec 10 83 periods -timeout 30116 periods -timeout 120 84 117 npending 1 85 118 86 119 task.exec 120 stdout NULL 121 stderr $LOGSUBDIR/pstamp.request.find.log 87 122 if ($DB:n == 0) 88 123 option DEFAULT … … 122 157 123 158 task.exec 159 stdout $LOGSUBDIR/pstamp.request.load.log 160 stderr $LOGSUBDIR/pstamp.request.load.log 124 161 $run = pstamptool -pendingreq 125 162 if ($DB:n == 0) … … 132 169 end 133 170 add_poll_args run 171 add_poll_labels run 134 172 command $run 135 173 end … … 164 202 165 203 task.exec 204 stdout $LOGSUBDIR/pstamp.request.run.log 205 stderr $LOGSUBDIR/pstamp.request.run.log 166 206 book npages pstampRequest -var N 167 207 if ($N == 0) break … … 175 215 book getword pstampRequest $pageName uri -var URI 176 216 book getword pstampRequest $pageName ds_outProduct -var PRODUCT 177 178 $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --redirect-output 217 book getword pstampRequest $pageName label -var LABEL 218 219 host anyhost 220 221 $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --label $LABEL --redirect-output 179 222 180 223 add_standard_args run … … 217 260 218 261 task.exec 262 stdout $LOGSUBDIR/pstamp.finish.load.log 263 stderr $LOGSUBDIR/pstamp.finish.load.log 264 $run = pstamptool -completedreq 219 265 if ($DB:n == 0) 220 266 option DEFAULT 221 command pstamptool -completedreq222 267 else 223 268 option $DB:$pstampFin_DB 224 command pstamptool -completedreq-dbname $DB:$pstampFin_DB $PS_DBSERVER269 $run = $run -dbname $DB:$pstampFin_DB $PS_DBSERVER 225 270 $pstampFin_DB ++ 226 271 if ($pstampFin_DB >= $DB:n) set pstampFin_DB = 0 227 272 end 273 add_poll_args run 274 add_poll_labels run 275 command $run 228 276 end 229 277 … … 253 301 periods -poll $RUNPOLL 254 302 periods -exec $RUNEXEC 255 periods -timeout 300 256 257 task.exec 303 periods -timeout 2400 304 host anyhost 305 306 task.exec 307 stdout $LOGSUBDIR/request.finish.run.log 308 stderr $LOGSUBDIR/request.finish.run.log 258 309 book npages pstampFinish -var N 259 310 if ($N == 0) break … … 311 362 312 363 task.exec 364 stdout $LOGSUBDIR/pstamp.job.load.log 365 stderr $LOGSUBDIR/pstamp.job.load.log 366 $run = pstamptool -pendingjob 313 367 if ($DB:n == 0) 314 368 option DEFAULT 315 command pstamptool -pendingjob -limit 10316 369 else 317 370 option $DB:$pstampJob_DB 318 command pstamptool -pendingjob -limit 10-dbname $DB:$pstampJob_DB $PS_DBSERVER371 $run = $run -dbname $DB:$pstampJob_DB $PS_DBSERVER 319 372 $pstampJob_DB ++ 320 373 if ($pstampJob_DB >= $DB:n) set pstampJob_DB = 0 321 374 end 375 add_poll_args run 376 add_poll_labels run 377 command $run 322 378 end 323 379 … … 334 390 end 335 391 392 task.exit crash 393 showcommand crash 394 end 395 396 task.exit timeout 397 showcommand timeout 398 end 399 336 400 task.exit default 337 401 showcommand failure 338 402 end 339 403 340 task.exit crash341 showcommand crash342 end343 344 task.exit timeout345 showcommand timeout346 end347 404 end 348 405 … … 353 410 354 411 task.exec 412 stdout $LOGSUBDIR/pstamp.job.run.log 413 stderr $LOGSUBDIR/pstamp.job.run.log 355 414 book npages pstampJob -var N 356 if ($N == 0) break 415 if ($N == 0) 416 periods -exec $RUNEXEC 417 break 418 end 419 periods -exec 0.05 357 420 358 421 book getpage pstampJob 0 -var pageName -key pantaskState INIT … … 363 426 book setword pstampJob $pageName pantaskState RUN 364 427 book getword pstampJob $pageName job_id -var JOB_ID 428 book getword pstampJob $pageName jobType -var JOB_TYPE 429 book getword pstampJob $pageName rownum -var ROWNUM 365 430 book getword pstampJob $pageName dbname -var DBNAME 366 431 book getword pstampJob $pageName outputBase -var OUTPUT_BASE 432 book getword pstampJob $pageName options -var OPTIONS 367 433 368 434 if ($VERBOSE > 1) … … 370 436 end 371 437 372 373 $run = pstamp_job_run.pl --job_id $JOB_ID --redirect-output --output_base $OUTPUT_BASE 438 host anyhost 439 440 $run = pstamp_job_run.pl --job_id $JOB_ID --job_type $JOB_TYPE --rownum $ROWNUM --output_base $OUTPUT_BASE --options $OPTIONS --redirect-output 374 441 add_standard_args run 375 442 … … 411 478 end 412 479 end 480 481 task pstamp.job.revert 482 host local 483 484 periods -poll $LOADPOLL 485 periods -exec 300 486 periods -timeout 300 487 npending 1 488 489 task.exec 490 stdout $LOGSUBDIR/pstamp.job.revert.log 491 stderr $LOGSUBDIR/pstamp.job.revert.log 492 $run = pstamptool -revertjob -all 493 if ($DB:n == 0) 494 option DEFAULT 495 else 496 $run = $run $PS_DBSERVER -dbname $DB:$pstampRev_DB 497 $pstampRev_DB ++ 498 if ($pstampRev_DB >= $DB:n) set pstampRev_DB = 0 499 end 500 add_poll_args run 501 add_poll_labels run 502 command $run 503 end 504 505 task.exit $EXIT_SUCCESS 506 # nothing to do 507 end 508 509 task.exit default 510 showcommand failure 511 end 512 513 task.exit crash 514 showcommand crash 515 end 516 517 task.exit timeout 518 showcommand timeout 519 end 520 end 521 522 task pstamp.dependent.load 523 host local 524 525 periods -poll $LOADPOLL 526 # XXX: create a macro for this time 527 periods -exec 10 528 # periods -exec $LOADEXEC 529 periods -timeout 300 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 573 end 574 575 task 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 664 end 665
Note:
See TracChangeset
for help on using the changeset viewer.
