Changeset 26015
- Timestamp:
- Nov 3, 2009, 1:02:08 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/dist.md (modified) (2 diffs)
-
ippScripts/scripts/dist_advancerun.pl (modified) (1 diff)
-
ippScripts/scripts/dist_component.pl (modified) (1 diff)
-
ippScripts/scripts/dist_make_fileset.pl (modified) (5 diffs)
-
ippTasks/dist.pro (modified) (5 diffs)
-
ippTasks/ipphosts.mhpcc.config (modified) (1 diff)
-
ippTasks/rcserver.pro (modified) (1 diff)
-
ippTools/share/disttool_pendingfileset.sql (modified) (1 diff)
-
ippTools/share/disttool_processedcomponent.sql (modified) (1 diff)
-
ippTools/share/pxadmin_create_tables.sql (modified) (2 diffs)
-
ippTools/src/disttool.c (modified) (4 diffs)
-
ippTools/src/disttoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/changes.txt
r25929 r26015 1424 1424 ALTER TABLE publishClient ADD COLUMN active TINYINT DEFAULT 0 AFTER client_id; 1425 1425 1426 1427 1428 -- UPDATE dbversion set schema_version = '1.1.57', updated= CURRENT_TIMESTAMP(); 1426 # add outdir to allow spreading files over multiple hosts 1427 ALTER TABLE distRun ADD COLUMN outdir VARCHAR(255) AFTER outroot; 1428 ALTER TABLE distComponent ADD COLUMN outdir VARCHAR(255) AFTER state; 1429 1430 # populate the existing runs (except for bills' test runs) 1431 UPDATE distRun SET outdir = CONCAT_WS('.', outroot, dist_id) WHERE outroot not like '%@HOST@%'; 1432 UPDATE distRun join distComponent using(dist_id) SET distComponent.outdir = CONCAT_WS('.', distRun.outroot, dist_id); 1433 1434 UPDATE dbversion set schema_version = '1.1.57', updated= CURRENT_TIMESTAMP(); 1435 1436 -- Vesion 1.1.58 1437 -- UPDATE dbversion set schema_version = '1.1.58', updated= CURRENT_TIMESTAMP(); -
trunk/dbconfig/dist.md
r25835 r26015 17 17 label STR 64 # Key 18 18 outroot STR 255 19 outdir STR 255 19 20 clean BOOL f 20 21 no_magic BOOL f … … 31 32 md5sum STR 32 32 33 state STR 64 # Key 34 outdir STR 255 33 35 name STR 255 34 36 fault S16 0 -
trunk/ippScripts/scripts/dist_advancerun.pl
r24433 r26015 181 181 { 182 182 my $command = "$disttool -updaterun -dist_id $dist_id -set_state full"; 183 $command .= " -set_outdir $outdir"; 183 184 $command .= " -dbname $dbname" if defined $dbname; 184 185 -
trunk/ippScripts/scripts/dist_component.pl
r25942 r26015 307 307 } 308 308 { 309 my $command = "$disttool -addprocessedcomponent -dist_id $dist_id -component $component ";309 my $command = "$disttool -addprocessedcomponent -dist_id $dist_id -component $component -outdir $outdir"; 310 310 $command .= " -name $file_name -bytes $bytes -md5sum $md5sum"; 311 311 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/dist_make_fileset.pl
r25850 r26015 53 53 'label=s' => \$label, 54 54 'dist_group=s' => \$dist_group, 55 'filter=s' => \$filter,55 'filter=s' => \$filter, 56 56 'ds_dbhost=s' => \$ds_dbhost, # database host for the datastore database 57 57 'ds_dbname=s' => \$ds_dbname, # database name for the datastore database … … 94 94 95 95 # make sure that the database info file for this run exists 96 my $dbinfo_file = " dbinfo.$stage.$stage_id.mdc";97 if (! -e "$d ist_dir/$dbinfo_file" ) {96 my $dbinfo_file = "$dist_dir/dbinfo.$stage.$stage_id.mdc"; 97 if (! -e "$dbinfo_file" ) { 98 98 &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR); 99 99 } … … 101 101 102 102 # make sure that the dirinfo file for this run exists 103 my $dirinfo_file = " dirinfo.$stage.$stage_id.mdc";104 if (! -e "$di st_dir/$dirinfo_file" ) {103 my $dirinfo_file = "$dist_dir/dirinfo.$stage.$stage_id.mdc"; 104 if (! -e "$dirinfo_file" ) { 105 105 &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR); 106 106 } … … 142 142 my $md5sum = $component->{md5sum}; 143 143 # name of the file 144 my $ name = $component->{name};144 my $file_name = $component->{name}; 145 145 # component id (class_is or skycell_id) 146 my $comp_dir = $component->{outdir}; 146 147 my $comp_name = $component->{component}; 147 148 148 149 # XXX: if tarfile is not always the right type we need to add a type to distComponent 149 print $listFile "$ name|$size|$md5sum|tgz|$comp_name|\n";150 print $listFile "$comp_dir/$file_name|$size|$md5sum|tgz|$comp_name|\n"; 150 151 } 151 152 … … 156 157 157 158 # the data store will refer to the distribution bundle via symlinks back to distRun.outdir 158 $command .= " --datapath $dist_dir --link"; 159 # $command .= " --datapath $dist_dir --link"; 160 $command .= " --abspath --link"; 159 161 160 162 # set the product specific columns in product list -
trunk/ippTasks/dist.pro
r25462 r26015 70 70 active false 71 71 end 72 end 73 74 macro set.dist.workdir.by.component 75 # component template default varname 76 if ($0 != 5) 77 echo "USAGE: set.workdir.by.component (componentID) (template) (default) (varname)" 78 break 79 end 80 local host component default template varname length start count component_id 81 $component = $1 82 $template = $2 83 $default = $3 84 $varname = $4 85 if ("$template" == "NULL") 86 echo "ERROR: WORKDIR template not set." 87 break 88 end 89 book getword ipphosts distribution count -var count 90 if ("$count" == "NULL") 91 echo "ERROR: disthosts is empty" 92 break 93 end 94 # take last two letters of component id 95 # treat it as an integer and use modulous of length of distribution hosts 96 # to compute a host 97 strlen $component length 98 $start = $length - 2 99 substr $component $start 2 index 100 $component_id = $index % $count 101 102 book getword ipphosts distribution $component_id -var host 103 if ("$host" == "NULL") 104 echo "ERROR: failed to find host for $component" 105 $host = $default 106 end 107 108 strsub $template @HOST@ $host -var $varname 72 109 end 73 110 … … 165 202 book getword distToProcess $pageName no_magic -var NO_MAGIC 166 203 book getword distToProcess $pageName magicked -var MAGICKED 167 book getword distToProcess $pageName outdir -var OUTDIR 204 book getword distToProcess $pageName outdir -var OUTDIR_TEMPLATE 168 205 book getword distToProcess $pageName dbname -var DBNAME 169 206 … … 187 224 # set.workdir.by.camera $CAMERA $MAGIC_ID $WORKDIR_TEMPLATE $default_host WORKDIR 188 225 # host anyhost 226 227 set.dist.workdir.by.component $COMPONENT $OUTDIR_TEMPLATE ipp049 OUTDIR 228 if ("$OUTDIR" == "NULL") 229 echo ERROR failed to set workdir for $COMPONENT 230 break 231 end 189 232 190 233 substr $COMPONENT 0 3 COMP_HEAD … … 294 337 book getword distToAdvance $pageName stage -var STAGE 295 338 book getword distToAdvance $pageName stage_id -var STAGE_ID 296 book getword distToAdvance $pageName outdir -var OUTDIR 339 book getword distToAdvance $pageName outdir -var OUTDIR_TEMPLATE 297 340 book getword distToAdvance $pageName clean -var CLEAN 298 341 book getword distToAdvance $pageName dbname -var DBNAME … … 304 347 host anyhost 305 348 349 # using $DIST_ID as the "component" works fine here since we only look 350 # at the last two digits 351 set.dist.workdir.by.component $DIST_ID $OUTDIR_TEMPLATE ipp049 OUTDIR 352 if ("$OUTDIR" == "NULL") 353 echo ERROR failed to set workdir for $DIST_ID 354 break 355 end 356 306 357 sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID 307 358 # stdout $logfile -
trunk/ippTasks/ipphosts.mhpcc.config
r25839 r26015 214 214 ota76 STR ipp025 215 215 END 216 217 ipphosts METADATA 218 camera STR distribution 219 count S32 5 220 0 STR ipp048 221 1 STR ipp049 222 2 STR ipp050 223 3 STR ipp051 224 4 STR ipp052 225 END -
trunk/ippTasks/rcserver.pro
r25849 r26015 139 139 book getword rcPendingFS $pageName dbname -var DBNAME 140 140 141 # set.host.for.camera $CAMERA $MAGIC_ID142 # set.workdir.by.camera $CAMERA $MAGIC_ID $WORKDIR_TEMPLATE $default_host WORKDIR143 141 host anyhost 144 142 -
trunk/ippTools/share/disttool_pendingfileset.sql
r25835 r26015 3 3 target_id, 4 4 distRun.stage, 5 distRun.outdir as dist_dir, 5 6 stage_id, 6 7 distTarget.dist_group, 7 8 distTarget.filter, 8 CONCAT_WS('.', distRun.outroot, CONVERT(distRun.dist_id, CHAR)) as dist_dir,9 -- CONCAT_WS('.', distRun.outroot, CONVERT(distRun.dist_id, CHAR)) as dist_dir, 9 10 rcDestination.name AS product_name, 10 11 rcDestination.dest_id, -
trunk/ippTools/share/disttool_processedcomponent.sql
r23842 r26015 5 5 stage_id, 6 6 component, 7 CONCAT_WS('.', outroot, CONVERT(dist_id, CHAR)) asoutdir,7 distComponent.outdir, 8 8 bytes, 9 9 md5sum, -
trunk/ippTools/share/pxadmin_create_tables.sql
r25929 r26015 1344 1344 label VARCHAR(64), 1345 1345 outroot VARCHAR(255), 1346 outdir VARCHAR(255), 1346 1347 clean TINYINT, 1347 1348 no_magic TINYINT, … … 1362 1363 md5sum VARCHAR(32), 1363 1364 state VARCHAR(64), 1365 outdir VARCHAR(255), 1364 1366 name VARCHAR(255), 1365 1367 fault SMALLINT, -
trunk/ippTools/src/disttool.c
r26005 r26015 371 371 new_label, 372 372 outroot, 373 NULL, // outdir 373 374 clean, 374 375 no_magic, 375 376 "new", 376 NULL, // time_stamp377 NULL, // time_stamp 377 378 0, // fault 378 set_note // note does not propagate379 set_note // note does not propagate 379 380 ); 380 381 … … 430 431 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 431 432 PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); 433 PXOPT_LOOKUP_STR(outdir, config->args, "-set_outdir", false, false); 432 434 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 433 435 … … 440 442 psString query = psStringCopy("UPDATE distRun SET time_stamp = UTC_TIMESTAMP()"); 441 443 444 if (outdir) { 445 psStringAppend(&query, " , outdir = '%s'", outdir); 446 } 442 447 if (state) { 443 448 psStringAppend(&query, " , state = '%s'", state); … … 652 657 PXOPT_LOOKUP_S32(bytes, config->args, "-bytes", require_fileinfo, false); 653 658 PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", require_fileinfo, false); 659 PXOPT_LOOKUP_STR(outdir, config->args, "-outdir", require_fileinfo, false); 654 660 PXOPT_LOOKUP_STR(name, config->args, "-name", require_fileinfo, false); 655 661 656 if (!distComponentInsert(config->dbh, dist_id, component, bytes, md5sum, "full", name, fault)) {662 if (!distComponentInsert(config->dbh, dist_id, component, bytes, md5sum, "full", outdir, name, fault)) { 657 663 psError(PS_ERR_UNKNOWN, false, "database error"); 658 664 return false; -
trunk/ippTools/src/disttoolConfig.c
r25835 r26015 70 70 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state", NULL); 71 71 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label", 0, "new value for label", NULL); 72 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_outdir", 0, "new value for outdir", NULL); 72 73 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-stage", 0, "value for stage", NULL); 73 74 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, "value for state", NULL); … … 98 99 psMetadataAddS64(addprocessedcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 99 100 psMetadataAddStr(addprocessedcomponentArgs, PS_LIST_TAIL, "-component", 0, "define component (required)", NULL); 101 psMetadataAddStr(addprocessedcomponentArgs, PS_LIST_TAIL, "-outdir", 0, "define output directory", NULL); 100 102 psMetadataAddStr(addprocessedcomponentArgs, PS_LIST_TAIL, "-name", 0, "define file name", NULL); 101 103 psMetadataAddS32(addprocessedcomponentArgs, PS_LIST_TAIL, "-bytes", 0, "define file size", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
