Changeset 16283
- Timestamp:
- Feb 1, 2008, 5:42:05 PM (18 years ago)
- Location:
- trunk/pstamp
- Files:
-
- 4 edited
-
scripts/ppstamp_run.pl (modified) (2 diffs)
-
scripts/pstamp_dorequest.pl (modified) (4 diffs)
-
scripts/pstampwebrequest.sh (modified) (7 diffs)
-
web/request.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/ppstamp_run.pl
r16280 r16283 96 96 } 97 97 98 my $jobStatus; 98 99 { 99 100 my $command = "$ppstamp -file $uri $outputBase $argString"; 100 101 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 101 102 run(command => $command, verbose => $verbosity); 102 ### 103 ### update the status of the job with the error 104 ### 105 unless ($success) { 106 die("Unable to perform $command: $error_code"); 103 104 if ($success) { 105 $jobStatus = "ok"; 106 } else { 107 $jobStatus = $error_code; 108 print STDERR "ppstamp failed with error code $error_code\n"; 107 109 } 110 # unless ($success) { 111 # die("Unable to perform $command: $error_code"); 112 # } 108 113 } 109 114 110 115 116 # stop the job and set the error status 111 117 { 112 my $command = "$pstamptool -processedjob -job_id $job_id -state stop -status ok";118 my $command = "$pstamptool -processedjob -job_id $job_id -state stop -status $jobStatus"; 113 119 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 114 120 run(command => $command, verbose => $verbosity); … … 119 125 120 126 121 exit 0;127 exit $jobStatus; -
trunk/pstamp/scripts/pstamp_dorequest.pl
r16280 r16283 16 16 my $request_id = $ARGV[0]; 17 17 18 my $verbosity = 0;18 my $verbosity = 1; 19 19 20 20 use Sys::Hostname; … … 78 78 if ($job->{req_id} == $request_id) { 79 79 # there must be a better way to do this 80 print STDERR "adding $job->{job_id} to the list\n"; 80 81 $psjobs[@psjobs] = $job; 81 82 } … … 90 91 91 92 foreach my $job (@psjobs) { 92 my $command = " echo$ppstamp_run $job->{job_id}";93 my $command = "$ppstamp_run $job->{job_id}"; 93 94 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 94 95 run(command => $command, verbose => $verbosity); … … 100 101 101 102 # 102 # set the state of the request to stop103 # Update the state of the request 103 104 # 104 105 -
trunk/pstamp/scripts/pstampwebrequest.sh
r16280 r16283 12 12 # 13 13 # Note: there's nothing really web specific about this program. 14 # with the exception that we set up the environment to allow a 15 # random user (in this case apache ) to run ipp programs 16 # 17 # TODO: re-write this in perl 14 18 # 15 19 ### … … 42 46 43 47 # These variables need to be customized for a particular installation 44 BASE_DIR=/export/data1/bills/pstamp45 48 export PSCONFDIR=/export/data0/bills/psconfig 46 49 … … 48 51 export LD_LIBRARY_PATH=/usr/local/lib 49 52 53 WORK_DIR=/export/data1/bills/pstamp/work 54 CMD_DIR=/export/data0/bills/src/ipp/pstamp/scripts 55 50 56 #### END LOCAL_CONFIGURATION 51 57 52 WORK_DIR=$BASE_DIR/work53 CMD_DIR=$BASE_DIR/bin54 58 export HOME=$WORK_DIR 55 59 … … 67 71 68 72 69 ## configure IPP 73 ### 74 ### configure IPP 75 ### 70 76 export MANPATH="" 71 77 72 78 source $PSCONFDIR/psconfig.bash default 73 79 80 ### 81 ### Add our command directory to the path. This won't be necessary once the scripts get 82 ### installed in the IPP 83 ### 74 84 PATH=${CMD_DIR}:${PATH} 75 85 … … 149 159 150 160 ### 151 ### TODO: Won't it interfere with pantask's job processing? 152 ### 153 ### Queue jobs for the request 161 ### TODO: Until we have pantasks monitoring the reuest and job table 162 ### run things directly 163 164 165 ### 166 ### Queue the jobs for the request 154 167 ### 155 168 pstampparser_run.pl $request_id 1> $parse_out 2> $parse_err … … 166 179 fi 167 180 168 cat $parse.out169 170 ### for each line in the output add a psJob to the171 172 181 ### 173 182 ### Ok now it's time to build the stamps 183 ### 174 184 175 185 stamp_out=stamp.${out_ext} 176 186 stamp_err=stamp.${err_ext} 177 187 178 echo making stamps > $stamp_err179 180 ### 181 ### Make the stamps 188 echo making stamps for request> $stamp_err 189 190 ### 191 ### Make the stamps by executing each of the jobs 182 192 ### 183 193 pstamp_dorequest.pl $request_id 1>$stamp_out 2>>$stamp_err 184 194 if [[ $? != 0 ]]; then 185 echo makestamps.pl failed195 echo pstamp_do_request.pl failed 186 196 echo STDERR: 187 197 cat $stamp_err … … 192 202 fi 193 203 194 # Success print the output 195 # get the stamp urls 196 cat $stamp_out 204 # Success print the urls 205 pstamptool -listjob -req_id $request_id -simple | awk '{ print $6 ".fits" }' 197 206 198 207 cleanup -
trunk/pstamp/web/request.php
r16279 r16283 14 14 <pre> 15 15 <?php 16 17 $COMMAND_DIR = "/export/data0/bills/src/ipp/pstamp/scripts"; 18 $STAMPS_DIR = "stamps"; 16 19 17 20 // Initialize variables … … 416 419 global $rvar_id, $rvar_class_id; 417 420 global $command_line; 421 global $STAMPS_DIR; 418 422 419 423 $cmd = "pstampwebrequest.sh"; … … 430 434 throw new Exception('Stamp Name must be specified.'); 431 435 } 432 $cmd .= " -user_tag $ rvar_user_tag";436 $cmd .= " -user_tag $STAMPS_DIR/$rvar_user_tag"; 433 437 434 438 // Set up the ROI parameters … … 493 497 global $error_line; 494 498 global $command_status; 495 496 $HOME = "/export/data1/bills/pstamp"; 497 $cmd_dir = "$HOME/bin"; 498 $work_dir = "$HOME/work"; 499 500 501 exec ("$cmd_dir/$command_line", $output_array, $command_status); 499 global $COMMAND_DIR; 500 501 502 exec ("$COMMAND_DIR/$command_line", $output_array, $command_status); 502 503 503 504 $size = sizeof($output_array); … … 520 521 function printURL($path) 521 522 { 522 $fileName = basename($path);523 523 echo "<tr><td>"; 524 echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">"; 525 echo $fileName; 526 echo "</a>"; 524 $doURL = 1; 525 if ($doURL) { 526 $fileName = basename($path); 527 echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">"; 528 echo $fileName; 529 echo "</a>"; 530 } else { 531 print "$path"; 532 } 527 533 echo "</td></tr>"; 528 534 }
Note:
See TracChangeset
for help on using the changeset viewer.
