IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16959


Ignore:
Timestamp:
Mar 12, 2008, 11:37:23 AM (18 years ago)
Author:
bills
Message:

changes to allow the web interface to work with pantasks sequencing
the requests

Location:
trunk/pstamp/scripts
Files:
1 added
3 edited

Legend:

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

    r16358 r16959  
    22###
    33### pstamp_listjobs.pl
    4 ### list the job_id, state, and uri for the postage stamp jobs queued for a given
     4### list the job_id, state, and data store uri for the postage stamp jobs queued for a given
    55### postage stamp request id
    66###
     
    8080if (! @psjobs) {
    8181    print STDERR "no postage stamp jobs for request $request_id found\n";
    82     exit 1;
     82    exit 0;
    8383}
    8484
    8585foreach my $job (@psjobs) {
    86     print "$job->{job_id} $job->{state} $job->{outputBase}.fits\n";
     86    #
     87    # convert from filename to data store relative uri
     88    # XXX arguably we shouldn't do this here. this should be a function
     89    # of the web interface. But since this script is only used by
     90    # the web interface ....
     91    my $i = index($job->{outputBase}, "dsroot/");
     92
     93    my $uri;
     94    if ($i > 0) {
     95        $uri = "/ds" . substr($job->{outputBase}, $i + 6) . ".fits";
     96    } else {
     97        $uri = "$job->{outputBase}" . ".fits";
     98    }
     99
     100    print "$job->{job_id} $job->{state} $uri\n";
    87101}
    88102
  • trunk/pstamp/scripts/pstamp_runcommand.sh

    r16764 r16959  
    6565#### Finally, execute the command given by the command line arguments
    6666
     67umask 0
     68
    6769$*
  • trunk/pstamp/scripts/pstamp_webrequest.pl

    r16899 r16959  
    4242                       );
    4343
     44use Cwd;
     45
    4446my $missing_tools;
    4547
     
    5456}
    5557
    56 
    5758# if -list is used, it must be the first argument
    5859my $listMode;
     
    6364}
    6465
    65 my $request_file = "request_file.$$.fits";
     66my $cur_dir = getcwd();
     67my $request_file = "$cur_dir/request_file.$$.fits";
    6668{
    6769    my $command = "$pstamprequest $request_file @ARGV";
     
    7375    }
    7476}
    75 
    7677
    7778# ok at this point we have a request file add it to the database (unless we're in listMode)
     
    9596{
    9697
    97     my $command = "$pstamptool -addreq -uri $request_file";
     98    my $command = "$pstamptool -addreq -uri $request_file -out_fileset \'pstampresults/web\$REQ_ID\'";
    9899    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    99100        run(command => $command, verbose => $verbosity);
     
    105106}
    106107
    107 # parse the file to queue the jobs
    108 {
    109     my $command = "$pstampparser_run $request_id";
    110     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    111         run(command => $command, verbose => $verbosity);
    112     unless ($success) {
    113         print STDERR @$stderr_buf;
    114         die("Unable to perform pstamparser_run -addreq: $error_code");
    115     }
    116 }
    117 
    118 #                   note: $request_id still has a newline
    119108print "$request_id";
    120109
Note: See TracChangeset for help on using the changeset viewer.