- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTasks/nightly_stacks.pro (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/ippTasks/nightly_stacks.pro
r26950 r27517 12 12 13 13 macro nightly.stacks.off 14 ns.initday.off 15 ns.registration.off 16 ns.burntool.off 17 ns.chips.off 18 ns.stacks.off 19 end 20 21 macro ns.on 22 ns.initday.on 23 ns.registration.on 24 ns.burntool.on 25 ns.chips.on 26 ns.stacks.on 27 end 28 29 macro ns.off 14 30 ns.initday.off 15 31 ns.registration.off … … 107 123 108 124 book init nsData 125 book init nsBurntool 109 126 # 110 127 # Macros to control the book. … … 122 139 echo $date $state 123 140 end 141 book npages nsBurntool -var Npages 124 142 end 125 143 … … 265 283 ipptool2book stdout nsData -uniq -key date 266 284 285 # remove the burntool page if we're done with it. 286 book getword nsData $options:0 nsState -var ns_STATE 287 if ("$ns_STATE" == "QUEUECHIPS") 288 book delpage nsBurntool $options:0 289 end 290 267 291 if ($VERBOSE > 2) 268 292 book listbook nsData … … 310 334 311 335 if ("$ns_STATE" != "QUEUECHIPS") break 336 $BURNTOOLING = 0 312 337 $run = automate_stacks.pl --queue_chips --date $date 313 338 command $run … … 427 452 book delpage nsData $options:0 428 453 # We've queued up stacking. We're done with this date, so don't reload the page. 429 #ipptool2book stdout nsData -uniq -key date454 ipptool2book stdout nsData -uniq -key date 430 455 if ($VERBOSE > 2) 431 456 book listbook nsData … … 447 472 448 473 # 449 # Generate a list of date ranges that need to be processed with burntool474 # Generate a list of date ranges and chips that need to be processed with burntool 450 475 # 451 476 task ns.burntool.load … … 457 482 458 483 task.exec 459 stdout NULL 460 stderr $LOGDIR/ns.burntool.log 461 462 book getpage nsData $ns_burnPAGE -var date 463 book getword nsData $date nsState -var ns_STATE 464 book npages nsData -var Npages 465 466 if ($VERBOSE > 5) 467 echo "ns.burntool.load: " $ns_burnPAGE $date $ns_STATE $Npages 468 end 469 470 $ns_burnPAGE ++ 471 if ($ns_burnPAGE >= $Npages) set ns_burnPAGE = 0 472 option $date 473 474 if ("$ns_STATE" != "NEEDSBURNING") break 475 $run = automate_stacks.pl --define_burntool --date $date 476 command $run 477 end 484 stdout NULL 485 stderr $LOGDIR/ns.burntool.log 486 487 book getpage nsData $ns_burnPAGE -var date 488 book getword nsData $date nsState -var ns_STATE 489 book npages nsData -var Npages 490 491 if ($VERBOSE > 5) 492 echo "ns.burntool.load: " $ns_burnPAGE $date $ns_STATE $Npages 493 end 494 495 $ns_burnPAGE ++ 496 if ($ns_burnPAGE >= $Npages) set ns_burnPAGE = 0 497 option $date 498 499 if ("$ns_STATE" != "NEEDSBURNING") break 500 501 $run = automate_stacks.pl --define_burntool --date $date 502 command $run 503 end 478 504 # success 479 505 task.exit 0 480 506 # convert 'stdout' to book format 481 book delpage nsData $options:0 482 ipptool2book stdout nsData -uniq -key date 507 # book delpage nsBurntool $options:0 508 ipptool2book stdout nsBurntool -uniq -key date 509 book setword nsData $options:0 nsState "QUEUEBURNING" 510 483 511 if ($VERBOSE > 2) 484 512 book listbook nsData … … 500 528 501 529 # 502 # Magically run burntool on the data, based on the time rangesstored in our book.530 # Magically run burntool on the data, based on the information stored in our book. 503 531 # 504 532 task ns.burntool.run … … 506 534 periods -exec $LOADEXEC 507 535 periods -timeout 10800 508 npending 20536 npending 30 509 537 task.exec 510 538 stdout NULL … … 516 544 517 545 if ($VERBOSE > 5) 518 echo "ns.burntool.run: " $ns_RburnPAGE $date $ns_STATE $Npages 519 end 520 521 $ns_RburnPAGE ++ 522 if ($ns_RburnPAGE >= $Npages) set ns_RburnPAGE = 0 523 524 if ("$ns_STATE" != "QUEUEBURNING") break 525 book getword nsData $date btN -var btN 526 book getword nsData $date btNCounter -var btNcounter 527 528 if ($btNcounter > $btN) 529 book setword nsData $date nsState "BURNING" 530 break 531 end 532 533 sprintf start_date_label "btBegin%d" $btNcounter 534 sprintf end_date_label "btEnd%d" $btNcounter 535 sprintf counter_label "btCounter%d" $btNcounter 536 537 book getword nsData $date $start_date_label -var start_date 538 book getword nsData $date $end_date_label -var end_date 539 book getword nsData $date $counter_label -var chip_counter 546 echo "ns.burntool.run: " $ns_RburnPAGE $date $ns_STATE $Npages 547 end 548 549 $ns_RburnPAGE ++ 550 if ($ns_RburnPAGE >= $Npages) set ns_RburnPAGE = 0 551 if (("$ns_STATE" != "QUEUEBURNING")&&("$ns_STATE" != "BURNING")) break 552 $BURNTOOLING = 1 553 # Find out where in the list of jobs we are 554 book getword nsBurntool $date btN -var btN 555 book getword nsBurntool $date btNCounter -var btNcounter 556 557 if ($VERBOSE > 5) 558 echo "ns.burntool.run: Status: " $btNcounter $date 559 end 560 561 if ("$ns_STATE" == "QUEUEBURNING") 562 $new_state = "QUEUEBURNING" 563 end 564 if ("$ns_STATE" == "BURNING") 565 $new_state = "BURNING" 566 end 567 if ($btNcounter + 1 > $btN) 568 $new_state = "BURNING" 569 end 570 if ($btNcounter > $btN) 571 $btNcounter = 0 572 end 573 if ($VERBOSE > 5) 574 echo "ns.burntool.run: Status: " $btNcounter $new_state 575 end 576 577 # Increment the counter in the book for the next job. 578 $counter_update = $btNcounter + 1 579 book setword nsBurntool $date btNCounter $counter_update 580 # book setword nsData $options:0 nsState $options:1 581 book setword nsData $date nsState $new_state 582 583 # Get the current status of this job, and skip if it doesn't need to process. 584 sprintf status_label "bt%dStatus" $btNcounter 585 book getword nsBurntool $date $status_label -var status 586 587 if ($VERBOSE > 5) 588 echo "ns.burntool.run: Status: " $btNcounter $status $date $status_label 589 end 590 if (("$status" == "FINISHED")||("$status" == "RUN")) break 591 592 # Continue loading information to process this job 593 sprintf start_date_label "bt%dBegin" $btNcounter 594 sprintf end_date_label "bt%dEnd" $btNcounter 595 sprintf class_count_label "bt%dClass" $btNcounter 596 597 book getword nsBurntool $date $start_date_label -var start_date 598 book getword nsBurntool $date $end_date_label -var end_date 599 book getword nsBurntool $date $class_count_label -var chip_counter 600 601 # Lookup class_id/host pairs 602 list word -split $hostmatch:$chip_counter 603 $class_id = $word:0 604 $host = $word:1 605 host $host 606 # set.host.for.camera GPC1 $class_id 607 $logfile = "burntool_logs/$class_id.$start_date.log" 608 609 $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile 540 610 541 list word -split $hostmatch:$chip_counter 542 $class_id = $word:0 543 $host = $word:1 544 host $host 545 $logfile = "burntool_logs/$class_id.$start_date.log" 546 547 $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile 548 549 echo "ns.burntool.run: " $date $btN $btNcounter $start_date $end_date $chip_counter $class_id $host $logfile $run 550 $chip_counter ++ 551 if ($chip_counter >= $hostmatch:n) 552 $chip_counter = 0 553 $btNcounter ++ 554 end 555 $new_state = "QUEUEBURNING" 556 if ($btNcounter > $btN) 557 $new_state = "BURNING" 558 end 559 560 echo "ns.burntool.run: " $date $btN $btNcounter $chip_counter $new_state 561 book setword nsData $date $counter_label $chip_counter 562 book setword nsData $date btNCounter $btNcounter 563 option $date $new_state 564 565 command $run 611 echo "ns.burntool.run: " $date $btN $btNcounter $start_date $end_date $chip_counter $class_id $host $logfile $run 612 echo "ns.burntool.run: " $date $btN $btNcounter $chip_counter $new_state 613 614 book setword nsBurntool $date $status_label RUN 615 option $date $new_state $status_label 616 617 command $run 566 618 # command /bin/true 567 619 end … … 569 621 task.exit 0 570 622 # convert 'stdout' to book format 571 # book delpage nsData $options:0 572 # ipptool2book stdout nsData -uniq -key date 573 book setword nsData $options:0 nsState $options:1 574 623 # Set data state based on if we're queueing or waiting 624 # Set the job state for success. 625 book setword nsBurntool $options:0 $options:2 FINISHED 575 626 if ($VERBOSE > 2) 576 627 book listbook nsData … … 580 631 # locked list 581 632 task.exit default 633 book setword nsBurntool $options:0 $options:2 FAIL 582 634 showcommand failure 583 635 end 584 636 task.exit crash 637 book setword nsBurntool $options:0 $options:2 FAIL 585 638 showcommand crash 586 639 end 587 640 #operation times out? 588 641 task.exit timeout 642 book setword nsBurntool $options:0 $options:2 FAIL 589 643 showcommand timeout 590 644 end
Note:
See TracChangeset
for help on using the changeset viewer.
