IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18247


Ignore:
Timestamp:
Jun 20, 2008, 3:08:02 PM (18 years ago)
Author:
bills
Message:

more tweaks.

Location:
trunk/pstamp
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_listjobs.pl

    r18236 r18247  
    88use warnings;
    99use strict;
     10use Getopt::Long qw( GetOptions );
     11
     12my $verbose;
     13my $dbname;
     14
     15GetOptions(
     16    'verbose'   =>  \$verbose,
     17    'dbname=s'  =>  \$dbname,
     18);
    1019
    1120if (@ARGV != 1) {
     
    1524my $request_id = $ARGV[0];
    1625
    17 my $verbosity = 0;
    1826
    1927use Sys::Hostname;
     
    2129
    2230## This isn't a script to be launched by pantasks we probably want go get rid of this
    23 if ($verbosity) {
     31if ($verbose) {
    2432    print STDERR "\n\n";
    2533    print STDERR "Starting script $0 on $host\n\n";
     
    5967{
    6068    my $command = "$pstamptool -listjob -req_id $request_id";
     69    $command .= " -dbname $dbname" if $dbname;
    6170    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    62         run(command => $command, verbose => $verbosity);
     71        run(command => $command, verbose => $verbose);
    6372    unless ($success) {
    6473        die("Unable to perform pstamptool -pendingreq: $error_code");
  • trunk/pstamp/scripts/pstamp_queue_requests.pl

    r18234 r18247  
    1717my $verbose;
    1818my $dbname;
     19my $limit;
    1920
    2021GetOptions(
    2122    'verbose'       =>  \$verbose,
    2223    'dbname=s'      =>  \$dbname,
     24    'limit=s'       =>  \$limit,
    2325);
    2426
  • trunk/pstamp/scripts/pstamp_webrequest.pl

    r18233 r18247  
    6868# if -list is used, it must be the first argument
    6969my $listMode;
    70 if ($ARGV[0] eq "-list" ) {
     70if ($ARGV[0] eq "-list_uri" ) {
    7171    $listMode=1;
    7272} else  {
     
    9292    ### In list mode just parse the file print the output and we're done
    9393    ###
    94     my $command = "$pstampparse $request_file";
     94    ### XXX TODO: I shouldn't need this -mode list_uri since it's in the request file
     95    my $command = "$pstampparse -mode list_uri $request_file";
    9596    $command .= " -dbname $dbname" if $dbname;
    9697    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/pstamp/src/pstampfinish.c

    r18243 r18247  
    2626    psString    dsRoot;
    2727    psString    dsProduct;
     28    psString    dbName;
    2829    int         exitStatus;
    2930} psrfOptions;
     
    7071        return NULL;
    7172    }
     73    psBool status;
     74    options->dbName = psMetadataLookupStr(&status, options->config->complete, "DBNAME");
    7275
    7376    if ((argnum = psArgumentGet(argc, argv, "-mode"))) {
     
    265268    psString command = NULL;
    266269
    267     psStringAppend(&command, "dsreg --add --type PSRESULTS --product %s --fileset %s",
    268             options->dsProduct, fileset_id);
    269 
    270     printf("command is: %s\n", command);
     270    psStringAppend(&command, "dsreg --dbname %s --add --type PSRESULTS --product %s --fileset %s",
     271            options->dbName, options->dsProduct, fileset_id);
     272
     273    if (options->verbose) {
     274        fprintf(stderr, "command is: %s\n", command);
     275    }
    271276
    272277    // open a pipe to dsreg and set up the output fileset
  • trunk/pstamp/src/pstampparse.c

    r18243 r18247  
    6464    }
    6565
     66    // XXX: need to sort out the interactions of this mode option and the JOB_TYPE
     67    // listed in the request file.
    6668    if ((argnum = psArgumentGet(argc, argv, "-mode"))) {
    6769        psArgumentRemove(argnum, &argc, argv);
     
    629631        psStringAppend(&cmd, " -args '%s'", commandArgs);
    630632    }
     633    // XXX We may want to have the data store name be different than the default DB
     634    psBool status;
     635    psString dbName = psMetadataLookupStr(&status, options->config->complete, "DBNAME");
     636    fprintf(stderr, "\n\n   dbName is %s\n", dbName);
     637    if (dbName) {
     638        psStringAppend(&cmd, " -dbname %s", dbName);
     639    }
     640
    631641    psStringAppend(&cmd, " > /dev/null");
    632642
  • trunk/pstamp/web/request.php

    r18238 r18247  
    11<?php
    22
     3// prototype postage stamp server web interface
     4
    35// A php program that generates a postage stamp request form
    46
    5 // There are two modes on the form List Images simply lists the input images that match
    6 // the image selection critera
     7// There are two modes on the form List Images simply lists the input images
     8// that match the image selection critera
    79
    810// When make stamps is selected when the page is posted, a postage stamp request is queued.
     
    1214// The mode for the page is given by $request_id != 0
    1315
    14 $COMMAND_DIR = "/export/data0/bills/src/ipp/pstamp/scripts";
     16// XXX This is just a prototype for testing purposes.
     17
     18
     19// BEGIN Local configuration
     20
     21$COMMAND_DIR = "/export/data0/bills/psconfig/debug.linrh64/bin";
    1522$dsroot = "/export/data1/datastore/dsroot";
     23$dbname = "simtest";
     24
     25// END Local configuration
     26//      (actually there is a little bit more in $COMMAND_DIR/pstamp_runcommand.sh )
    1627
    1728// Initialize variables
     
    213224    global $rvar_id, $rvar_class_id;
    214225    global $command_line;
    215 
     226    global $dbname;
     227
     228    $making_stamps = 1;
    216229    $cmd = "pstamp_runcommand.sh pstamp_webrequest.pl";
    217230
    218     $making_stamps = 1;
     231    // NOTE: If it is used, -list_uri must be the first argument to pstamp_webrequest.pl
    219232   
    220233    if ($list_checked) {
    221         $cmd .= " -list";
     234        $cmd .= " -list_uri";
    222235        $making_stamps = 0;
    223236    } else if ($get_checked) {
    224237        $making_stamps = 0;
    225238        $cmd .= " -get_image";
     239    }
     240
     241    if ($dbname) {
     242        $cmd .= " --dbname $dbname";
    226243    }
    227244
     
    291308
    292309    if (($rvar_img_type == "raw") || ($rvar_img_type == "chip")) {
    293         if (! $rvar_class_id ) {
    294             throw new Exception("must specify Class ID with Image Type $rvar_img_type.");
    295         }
    296         if ($rvar_class_id = "all") {
     310#        if (! $rvar_class_id ) {
     311#            throw new Exception("must specify Class ID with Image Type $rvar_img_type.");
     312#        }
     313        if ((!$rvar_class_id) || ($rvar_class_id = "all")) {
    297314            $cmd .= " null";
    298315        } else {
     
    402419
    403420    $command_line = "pstamp_runcommand.sh pstamp_listjobs.pl $request_id";
     421    global $dbname;
     422    if ($dbname) {
     423        $command_line .= " --dbname $dbname";
     424    }
     425
    404426    run_command($command_line);
    405427    if ($jobFinished) {
     
    429451    global $output_array;
    430452    global $outFileset;
     453    global $dbname;
    431454
    432455    $command_line = "pstamp_runcommand.sh pstamptool -listreq -req_id $request_id -simple";
     456    if ($dbname) {
     457        $command_line .= " -dbname $dbname";
     458    }
    433459    run_command($command_line);
    434460    if ($command_status == 0) {
Note: See TracChangeset for help on using the changeset viewer.