Changeset 26030
- Timestamp:
- Nov 4, 2009, 11:34:42 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
- 1 moved
-
ippScripts/Build.PL (modified) (2 diffs)
-
ippScripts/scripts/dist_defineruns.pl (moved) (moved from trunk/ippScripts/scripts/dist_queue_runs.pl ) (5 diffs, 1 prop)
-
ippScripts/scripts/magic_destreak_defineruns.pl (added)
-
ippTasks/survey.pro (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/Build.PL
r25822 r26030 60 60 scripts/magic_destreak_revert.pl 61 61 scripts/magic_destreak_cleanup.pl 62 scripts/magic_destreak_defineruns.pl 62 63 scripts/ippdb.pl 63 64 scripts/ipp_cleanup.pl … … 87 88 scripts/dist_advancerun.pl 88 89 scripts/dist_make_fileset.pl 89 scripts/dist_ queue_runs.pl90 scripts/dist_defineruns.pl 90 91 scripts/receive_source.pl 91 92 scripts/receive_fileset.pl -
trunk/ippScripts/scripts/dist_defineruns.pl
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/czw_branch/cleanup/ippScripts/scripts/dist_queue_runs.pl merged eligible /branches/eam_branches/20090522/ippScripts/scripts/dist_queue_runs.pl merged eligible /branches/eam_branches/20090715/ippScripts/scripts/dist_queue_runs.pl merged eligible /branches/eam_branches/20090820/ippScripts/scripts/dist_queue_runs.pl merged eligible /branches/pap/ippScripts/scripts/dist_queue_runs.pl merged eligible /branches/pap_mops/ippScripts/scripts/dist_queue_runs.pl 25137-25255
r26023 r26030 1 1 #!/usr/bin/env perl 2 # 3 # dist_queue_runs.pl : run disttool -definebyquery for the various stages or one stage 4 # 2 5 3 6 use Carp; … … 40 43 my ($stage, $stage_limit, $dist_root, $no_magic); 41 44 my ($dbname, $save_temps, $verbose, $no_update, $logfile); 45 my @labels; 42 46 43 47 GetOptions( 48 'stage=s' => \$stage, # stage to queue 49 'label=s' => \@labels, # labels 50 'stage_limit=s' => \$stage_limit,# maximum number of runs queued for each stage 44 51 'dist_root=s' => \$dist_root, # root of distribution work area 45 'stage=s' => \$stage, # stage to queue 46 'stage_limit=s' => \$stage_limit,# maximum number of runs queued for each stage 47 'no_magic' => \$no_magic, # queue runs without requiring magic 52 'no_magic' => \$no_magic, # queue runs without requiring magic (for testing only) 48 53 'dbname=s' => \$dbname, # Database name 49 54 'verbose' => \$verbose, # Print stuff? … … 54 59 55 60 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 56 if (0) { 57 pod2usage( -msg => "Required options: --stage", 61 pod2usage( -msg => "Required options: --label", 58 62 -exitval => 3) unless 59 defined $stage; 60 } 63 (scalar @labels > 0); 61 64 62 65 $ipprc->redirect_output($logfile) if $logfile; … … 67 70 } 68 71 69 my ($day, $month, $year) = ( localtime)[3,4,5];72 my ($day, $month, $year) = (gmtime)[3,4,5]; 70 73 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day; 71 74 … … 82 85 } 83 86 84 # XXX: how shall we deal with labels?85 my $label = 'proc';86 87 87 foreach my $stage (@stages) { 88 my $command = "$disttool -definebyquery -stage $stage -workdir $workdir"; 89 $command .= " -no_magic" if $no_magic; 90 $command .= " -dry_run" if $no_update; 91 $command .= " -limit $stage_limit" if $stage_limit; 92 $command .= " -set_label $label"; 93 $command .= " -dbname $dbname" if defined $dbname; 94 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 95 run(command => $command, verbose => $verbose); 96 unless ($success) { 97 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 98 &my_die("Unable to perform $command error_code: $error_code", $error_code); 88 foreach my $label (@labels) { 89 my $command = "$disttool -definebyquery -stage $stage -workdir $workdir -label $label"; 90 $command .= " -no_magic" if $no_magic; 91 $command .= " -dry_run" if $no_update; 92 $command .= " -limit $stage_limit" if $stage_limit; 93 $command .= " -set_label $label"; 94 $command .= " -dbname $dbname" if defined $dbname; 95 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 96 run(command => $command, verbose => $verbose); 97 unless ($success) { 98 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 99 &my_die("Unable to perform $command error_code: $error_code", $error_code); 100 } 101 # display the output from the command 102 print STDERR join "", @$stdout_buf if $verbose; 99 103 } 100 # display the output from the command101 print STDERR join "", @$stdout_buf if $verbose;102 104 } 103 105 106 if (0) { 107 # notyet 104 108 # queue rcRuns for any distRuns that have completed and have interested destinations 105 {106 109 my $command = "$disttool -queuercrun"; 107 110 $command .= " -dbname $dbname" if defined $dbname; -
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/ippTasks/survey.pro
r25946 r26030 12 12 book create SURVEY_MAGIC 13 13 end 14 book getbook SURVEY_DESTREAK -var isBook 15 if ("$isBook" == "NULL") 16 book create SURVEY_DESTREAK 17 end 18 book getbook SURVEY_DIST -var isBook 19 if ("$isBook" == "NULL") 20 book create SURVEY_DIST 21 end 14 22 15 23 $SURVEY_DIFF_DB = 0 16 24 $SURVEY_MAGIC_DB = 0 25 $SURVEY_DESTREAK_DB = 0 26 $SURVEY_DIST_DB = 0 17 27 18 28 $SURVEY_EXEC = 120 … … 74 84 end 75 85 book listbook SURVEY_MAGIC 86 end 87 88 # user functions to manipulate destreak labels 89 macro survey.add.destreak 90 if ($0 != 3) 91 echo "USAGE: survey.add.destreak (label) (workdir base)" 92 break 93 end 94 book newpage SURVEY_DESTREAK $1 95 book setword SURVEY_DESTREAK $1 WORKDIR $2 96 book setword SURVEY_DESTREAK $1 STATE PENDING 97 end 98 99 macro survey.del.destreak 100 if ($0 != 2) 101 echo "USAGE: survey.del.destreak (label)" 102 break 103 end 104 book delpage SURVEY_DESTREAK $1 105 end 106 107 macro survey.show.destreak 108 if ($0 != 1) 109 echo "USAGE: survey.show.destreak" 110 break 111 end 112 book listbook SURVEY_DESTREAK 113 end 114 115 # user functions to manipulate dist labels 116 macro survey.add.dist 117 if ($0 != 2) 118 echo "USAGE: survey.add.dist (label)" 119 break 120 end 121 book newpage SURVEY_DIST $1 122 book setword SURVEY_DIST $1 STATE PENDING 123 end 124 125 macro survey.del.dist 126 if ($0 != 2) 127 echo "USAGE: survey.del.dist (label)" 128 break 129 end 130 book delpage SURVEY_DIST $1 131 end 132 133 macro survey.show.dist 134 if ($0 != 1) 135 echo "USAGE: survey.show.dist" 136 break 137 end 138 book listbook SURVEY_DIST 76 139 end 77 140 … … 229 292 end 230 293 294 task survey.destreak 295 host local 296 297 periods -poll $SURVEY_POLL 298 periods -exec $SURVEY_EXEC 299 periods -timeout $SURVEY_TIMEOUT 300 npending 1 301 302 active false 303 304 stdout $LOGDIR/survey.destreak.log 305 stderr $LOGDIR/survey.destreak.log 306 307 # generate destreak runs 308 task.exec 309 book npages SURVEY_DESTREAK -var N 310 if ($N == 0) 311 # echo "No labels for processing" 312 break 313 endif 314 315 book getpage SURVEY_DESTREAK 0 -var label -key STATE NEW 316 if ("$label" == "NULL") 317 # All labels have been done --- reset 318 # echo "Resetting labels" 319 for i 0 $N 320 book getpage SURVEY_DESTREAK $i -var label 321 book setword SURVEY_DESTREAK $label STATE NEW 322 end 323 book getpage SURVEY_DESTREAK 0 -var label -key STATE NEW 324 325 # Select different database 326 $SURVEY_DESTREAK_DB ++ 327 if ($SURVEY_DESTREAK_DB >= $DB:n) 328 set $SURVEY_DESTREAK_DB = 0 329 end 330 end 331 332 book setword SURVEY_DESTREAK $label STATE DONE 333 book getword SURVEY_DESTREAK $label WORKDIR -var workdir 334 335 $run = magic_destreak_defineruns.pl --label $label --workdir $workdir/$label/ 336 337 if ($DB:n == 0) 338 option DEFAULT 339 else 340 $run = $run -dbname $DB:$SURVEY_MAGIC_DB 341 option $DB:$SURVEY_MAGIC_DB 342 end 343 344 # echo $run 345 command $run 346 end 347 348 # success 349 task.exit 0 350 # echo "Success" 351 end 352 353 # locked list 354 task.exit default 355 showcommand failure 356 end 357 358 task.exit crash 359 showcommand crash 360 end 361 362 # operation times out? 363 task.exit timeout 364 showcommand timeout 365 end 366 end 367 368 task survey.dist 369 host local 370 371 periods -poll $SURVEY_POLL 372 periods -exec $SURVEY_EXEC 373 periods -timeout $SURVEY_TIMEOUT 374 npending 1 375 376 stdout $LOGDIR/survey.dist.log 377 stderr $LOGDIR/survey.dist.log 378 379 # generate distribution runs 380 task.exec 381 book npages SURVEY_DIST -var N 382 if ($N == 0) 383 # echo "No labels for processing" 384 break 385 endif 386 387 book getpage SURVEY_DIST 0 -var label -key STATE NEW 388 if ("$label" == "NULL") 389 # All labels have been done --- reset 390 # echo "Resetting labels" 391 for i 0 $N 392 book getpage SURVEY_DIST $i -var label 393 book setword SURVEY_DIST $label STATE NEW 394 end 395 book getpage SURVEY_DIST 0 -var label -key STATE NEW 396 397 # Select different database 398 $SURVEY_DIST_DB ++ 399 if ($SURVEY_DIST_DB >= $DB:n) 400 set $SURVEY_DIST_DB = 0 401 end 402 end 403 404 book setword SURVEY_DIST $label STATE DONE 405 406 # note workdir is set by the script based on site.config 407 $run = dist_defineruns.pl --label $label 408 409 if ($DB:n == 0) 410 option DEFAULT 411 else 412 $run = $run --dbname $DB:$SURVEY_DIST_DB 413 option $DB:$SURVEY_DIST_DB 414 end 415 416 # echo $run 417 command $run 418 end 419 420 # success 421 task.exit 0 422 # echo "Success" 423 end 424 425 # locked list 426 task.exit default 427 showcommand failure 428 end 429 430 task.exit crash 431 showcommand crash 432 end 433 434 # operation times out? 435 task.exit timeout 436 showcommand timeout 437 end 438 end
Note:
See TracChangeset
for help on using the changeset viewer.
