IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25567


Ignore:
Timestamp:
Sep 24, 2009, 4:27:56 PM (17 years ago)
Author:
bills
Message:

fix some problems with distribution that were introduced by the removal of table rcDSProduct

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_make_fileset.pl

    r25432 r25567  
    3939
    4040# Parse the command-line arguments
    41 my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $prod_id, $product_name, $ds_dbhost, $ds_dbname);
     41my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $dest_id, $product_name, $ds_dbhost, $ds_dbname);
    4242my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4343
     
    4848           'stage=s'        => \$stage,      # raw, chip, camera, fake, warp, stack, or diff
    4949           'stage_id=s'     => \$stage_id,   # exp_id, chip_id, etc.
    50            'prod_id=s'      => \$prod_id,    # id for the product
     50           'dest_id=s'      => \$dest_id,    # id for the product
    5151           'product_name=s' => \$product_name,  # location of the data store directory for this product
    5252           'ds_dbhost=s'    => \$ds_dbhost,  # database host for the datastore database
     
    6060
    6161pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    62 pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --prod_id --ds_dbhost --ds_dbname",
     62pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --dest_id --ds_dbhost --ds_dbname",
    6363           -exitval => 3) unless
    6464    defined $dist_id and
     
    6767    defined $stage and
    6868    defined $stage_id and
    69     defined $prod_id and
     69    defined $dest_id and
    7070    defined $product_name and
    7171    defined $ds_dbhost and
     
    7979my $fs_tag = get_fileset_tag($ipprc, $stage, $stage_id, $dbname);
    8080
    81 &my_die("failed to lookup fileset tag", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR) if !defined $fs_tag;
    82 
    83 my $fileset_name = "$fs_tag$stage.$stage_id.$dist_id.$prod_id";
     81&my_die("failed to lookup fileset tag", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR) if !defined $fs_tag;
     82
     83my $fileset_name = $fs_tag ? "$fs_tag." : "";
     84$fileset_name .= "$stage.$stage_id.$dist_id.$dest_id";
    8485
    8586print "$fileset_name\n";
     
    8990my $dbinfo_file = "dbinfo.$stage.$stage_id.mdc";
    9091if (! -e "$dist_dir/$dbinfo_file" ) {
    91     &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR);
     92    &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    9293}
    9394print "dbinfo file $dbinfo_file exists\n" if $verbose;
     
    9697my $dirinfo_file = "dirinfo.$stage.$stage_id.mdc";
    9798if (! -e "$dist_dir/$dirinfo_file" ) {
    98     &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR);
     99    &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    99100}
    100101print "dirinfo file $dirinfo_file exists\n" if $verbose;
     
    116117    unless ($success) {
    117118        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    118         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     119        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
    119120    }
    120121
    121122    my $metadata = $mdcParser->parse (join "", @$stdout_buf) or
    122         &my_die("Unable to parse metadata config doc", $dist_id, $prod_id, $PS_EXIT_PROG_ERROR);
     123        &my_die("Unable to parse metadata config doc", $dist_id, $dest_id, $PS_EXIT_PROG_ERROR);
    123124
    124125    $components = parse_md_list($metadata);
     
    153154
    154155    # set the product specific columns in product list
    155     $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $fs_tag";
     156    my $prod_col_3 = $fs_tag ? $fs_tag : "$stage.$stage_id";
     157
     158    $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $prod_col_3";
    156159
    157160    $command .= " --dbname $ds_dbname";    # XXX: notyet --dbhost $ds_dbhost
     
    161164    unless ($success) {
    162165        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    163         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     166         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
    164167    }
    165168}
    166169
    167170{
    168     my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -name $fileset_name";
     171    my $command = "$disttool -addfileset -dist_id $dist_id -dest_id $dest_id -name $fileset_name";
    169172    $command .= " -dbname $dbname" if $dbname;
    170173
     
    175178        # We need to have revertfileset check whether the fileset exists and do dsreg -del if it does
    176179        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    177         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     180        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
    178181    }
    179182}
     
    252255    my $msg = shift;
    253256    my $dist_id = shift;
    254     my $prod_id = shift;
     257    my $dest_id = shift;
    255258    my $fault = shift;
    256259
    257     # TODO: disttool -adddsfileset -prod_id $prod_id -dist_id $dist_id -fault $fault
     260    # TODO: disttool -adddsfileset -dest_id $dest_id -dist_id $dist_id -fault $fault
    258261    print STDERR "$msg\n";
    259262
    260     my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -fault $fault";
     263    my $command = "$disttool -addfileset -dist_id $dist_id -dest_id $dest_id -fault $fault";
    261264    $command .= " -dbname $dbname" if $dbname;
    262265
  • trunk/ippScripts/scripts/rcserver_checkstatus.pl

    r24030 r25567  
    4040
    4141# Parse the command-line arguments
    42 my ($dest_id, $prod_id, $status_uri, $last_fileset, $limit);
     42my ($dest_id, $status_uri, $last_fileset, $limit);
    4343my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4444
    4545GetOptions(
    4646           'dest_id=s'      => \$dest_id,    # destination identifier
    47            'prod_id=s'      => \$prod_id,    # product identifier
    4847           'status_uri=s'   => \$status_uri, # uri for the desination's status data store product
    4948           'last_fileset=s' => \$last_fileset, # name of last fileset seen on this datastore
  • trunk/ippTasks/rcserver.pro

    r24847 r25567  
    44check.globals
    55
    6 #$LOGSUBDIR = $LOGDIR/rcserver
     6$LOGSUBDIR = $LOGDIR/rcserver
    77mkdir $LOGSUBDIR
    88
     
    6666
    6767  stdout NULL
    68   stderr $LOGDIR/rcserver.makefileset.load.log
     68  stderr $LOGSUBDIR/rcserver.makefileset.load.log
    6969
    7070  task.exec
     
    8686  task.exit    0
    8787    # convert 'stdout' to book format
    88     ipptool2book stdout rcPendingFS -key dist_id:prod_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     88    ipptool2book stdout rcPendingFS -key dist_id:dest_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    8989    if ($VERBOSE > 2)
    9090      book listbook rcPendingFS
     
    131131    book getword rcPendingFS $pageName dist_dir -var DIST_DIR
    132132#    book getword rcPendingFS $pageName clean -var CLEAN
    133     book getword rcPendingFS $pageName prod_id -var PROD_ID
     133    book getword rcPendingFS $pageName dest_id -var DEST_ID
    134134    book getword rcPendingFS $pageName product_name -var PRODUCT_NAME
    135135    book getword rcPendingFS $pageName ds_dbhost -var DS_DBHOST
     
    141141    host anyhost
    142142
    143     sprintf logfile "%s/makefs.%s.%s.log" $DIST_DIR $DIST_ID $PROD_ID
     143    sprintf logfile "%s/makefs.%s.%s.log" $DIST_DIR $DIST_ID $DEST_ID
    144144    stdout $logfile
    145145    stderr $logfile
     
    147147    book setword rcPendingFS $pageName pantaskState RUN
    148148
    149     $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --prod_id $PROD_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
     149    $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
    150150
    151151    add_standard_args run
     
    184184
    185185  stdout NULL
    186   stderr $LOGDIR/rcserver.checkstatus.load.log
     186  stderr $LOGSUBDIR/rcserver.checkstatus.load.log
    187187
    188188  task.exec
     
    241241
    242242    stdout NULL
    243     stderr $LOGDIR/rcserver.checkstatus.run.log
     243    stderr $LOGSUBDIR/rcserver.checkstatus.run.log
    244244
    245245    book setword rcPendingDest $pageName pantaskState RUN
    246246    book getword rcPendingDest $pageName dest_id -var DEST_ID
    247     book getword rcPendingDest $pageName prod_id -var PROD_ID
     247    book getword rcPendingDest $pageName dest_id -var DEST_ID
    248248    book getword rcPendingDest $pageName status_uri -var STATUS_URI
    249249    book getword rcPendingDest $pageName last_fileset -var LAST_FILESET
     
    252252    host anyhost
    253253
    254     $run = rcserver_checkstatus.pl --dest_id $DEST_ID --prod_id $PROD_ID --status_uri $STATUS_URI --last_fileset $LAST_FILESET
     254    $run = rcserver_checkstatus.pl --dest_id $DEST_ID --dest_id $DEST_ID --status_uri $STATUS_URI --last_fileset $LAST_FILESET
    255255    add_standard_args run
    256256
  • trunk/ippTools/share/disttool_pendingfileset.sql

    r25493 r25567  
    66    CONCAT_WS('.', distRun.outroot, CONVERT(distRun.dist_id, CHAR)) as dist_dir,
    77    rcDestination.name AS product_name,
    8     rcDestination.prod_id,
     8    rcDestination.dest_id,
    99    rcDestination.dbname AS ds_dbname,
    1010    rcDestination.dbhost AS ds_dbhost
  • trunk/ippTools/src/disttool.c

    r25517 r25567  
    903903    // required values
    904904    PXOPT_LOOKUP_S64(dist_id, config->args, "-dist_id", true, false);
    905     PXOPT_LOOKUP_S64(prod_id, config->args, "-prod_id", true, false);
     905    PXOPT_LOOKUP_S64(dest_id, config->args, "-dest_id", true, false);
    906906
    907907    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     
    913913            0,          // fs_id
    914914            dist_id,
    915             prod_id,
     915            dest_id,
    916916            name,
    917917            "full",
     
    928928    PXOPT_COPY_S64(config->args, where, "-fs_id", "fs_id", "==");
    929929    PXOPT_COPY_S64(config->args, where, "-dist_id", "rcDSFileset.dist_id", "==");
    930     PXOPT_COPY_S64(config->args, where, "-prod_id", "prod_id", "==");
     930    PXOPT_COPY_S64(config->args, where, "-dest_id", "dest_id", "==");
    931931    PXOPT_COPY_STR(config->args, where, "-stage", "stage", "==");;
    932932    PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "==");
     
    10561056    PXOPT_COPY_S64(config->args, where, "-dist_id",  "dist_id", "==");
    10571057    PXOPT_COPY_S64(config->args, where, "-dest_id",  "dest_id", "==");
    1058     PXOPT_COPY_S64(config->args, where, "-prod_id",  "prod_id", "==");
    10591058    PXOPT_COPY_S64(config->args, where, "-target_id","target_id", "==");
    10601059    PXOPT_COPY_S64(config->args, where, "-fs_id",    "fs_id", "==");
     
    14551454    psMetadata *where = psMetadataAlloc();
    14561455    PXOPT_COPY_S64(config->args, where, "-dest_id", "dest_id", "==");
    1457     PXOPT_COPY_S64(config->args, where, "-prod_id", "prod_id", "==");
    14581456
    14591457    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
     
    14771475    // last_fileset normally gets set by updatercrunMode
    14781476    // Allowing it to be set here might cause problems
    1479     // especially since we are allowing selection by prod_id
     1477    // especially since we are allowing selection by dest_id
    14801478    if (last_fileset) {
    14811479        psStringAppend(&query, " %s last_fileset = '%s'", sep, last_fileset);
  • trunk/ippTools/src/disttoolConfig.c

    r25510 r25567  
    146146    psMetadata *addfilesetArgs = psMetadataAlloc();
    147147    psMetadataAddS64(addfilesetArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0);
    148     psMetadataAddS64(addfilesetArgs, PS_LIST_TAIL, "-prod_id", 0, "define prod_id", 0);
     148    psMetadataAddS64(addfilesetArgs, PS_LIST_TAIL, "-dest_id", 0, "define dest_id", 0);
    149149    psMetadataAddStr(addfilesetArgs, PS_LIST_TAIL, "-name",    0, "define file name", NULL);
    150150    psMetadataAddS32(addfilesetArgs, PS_LIST_TAIL, "-fault",   0, "define fault code", 0);
     
    161161    psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-fs_id",   0, "define fs_id", 0);
    162162    psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0);
    163     psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-prod_id", 0, "define dist_id", 0);
     163    psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-dest_id", 0, "define dist_id", 0);
    164164    psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-stage",   0, "define stage", NULL);
    165165    psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-stage_id",0, "define stage_id", 0);
     
    173173    psMetadataAddS64(queuercrunArgs, PS_LIST_TAIL, "-dist_id",   0, "define dist_id", 0);
    174174    psMetadataAddS64(queuercrunArgs, PS_LIST_TAIL, "-dest_id",   0, "define dest_id", 0);
    175     psMetadataAddS64(queuercrunArgs, PS_LIST_TAIL, "-prod_id",   0, "define prod_id", 0);
    176175    psMetadataAddS64(queuercrunArgs, PS_LIST_TAIL, "-target_id", 0, "define target_id", 0);
    177176    psMetadataAddS64(queuercrunArgs, PS_LIST_TAIL, "-fs_id",     0, "define fs_id", 0);
Note: See TracChangeset for help on using the changeset viewer.