IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 1, 2009, 5:28:52 PM (17 years ago)
Author:
bills
Message:

on receive side of distribution, optionally create a fileset in a status data store
defer {$stage}tool -importrun until all of the files have been downloaded
in the dist.queuruns task queue rcruns

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

Legend:

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

    r24001 r24038  
    9898}
    9999
     100# queue rcRuns for any distRuns that have completed and have interested destinations
     101{
     102    my $command = "$disttool -queuercrun";
     103    $command .= " -dbname $dbname" if defined $dbname;
     104    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     105        run(command => $command, verbose => $verbose);
     106    unless ($success) {
     107        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     108        &my_die("Unable to perform $command error_code: $error_code", $error_code);
     109    }
     110    # display the output from the command
     111    print STDERR join "", @$stdout_buf if $verbose;
     112}
     113
    100114exit 0;
    101115
  • trunk/ippScripts/scripts/receive_file.pl

    r23895 r24038  
    3636
    3737# Parse the command-line arguments
    38 my ( $file_id, $source, $product, $fileset, $file, $workdir, $dbname, $verbose, $no_update, $save_temps );
     38my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $workdir, $dbname, $verbose, $no_update, $save_temps );
    3939
    4040GetOptions(
     
    4343           'product=s'         => \$product, # Product for data
    4444           'fileset=s'         => \$fileset, # Fileset for data
     45           'fileset_id=s'      => \$fileset_id, # database id for the fileset
    4546           'file=s'            => \$file, # File to retrieve
    4647           'workdir=s'         => \$workdir, # Working directory for output
     
    6162    defined $workdir;
    6263
     64$tempdir .= "/$file_id";
     65
    6366my $ipprc = PS::IPP::Config->new() or
    6467    &my_die( "Unable to set up", $file_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    8083    # Load into database
    8184
     85    my $target = "$workdir/$file"; # Target destination for file
     86    my $fixName = $ipprc->file_create( $target ); # Target for move
     87    my $fixFile;
     88
     89    open $fixFile, ">$fixName" or die "can't open $fixName\n";
     90
    8291    # Need to fix paths to point to new workdir
    83     my ($fixFile, $fixName) = tempfile( "$tempdir/$file.XXXX", UNLINK => !$save_temps ); # Fixed file
    8492    open my $inFile, $filename or die "Can't open $filename\n"; # Input file
    8593    my $workdir_old;            # Old workdir
     
    98106    }
    99107    close($inFile);
    100 
    101     my ($stage) = $file =~ m|^dbinfo\.(\S+)\.\d+\.mdc$|; # Stage of interest
    102     my $tool = can_run("${stage}tool") or die "Can't find tool to load $file\n";
    103 
    104     my $command = "$tool -importrun -infile $fixName"; # Command to execute
     108    close($fixFile);
     109#{
     110    my $command = "$receivetool -updatefileset -fileset_id $fileset_id -dbinfo_uri $fixName"; # Command to execute
    105111    $command .= " -dbname $dbname" if defined $dbname;
    106112    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    107113        run(command => $command, verbose => $verbose);
    108     die "Unable to load $fixName\n" unless $success;
     114    die "Unable to set dbinfo_uri for $fileset_id to  $fixName\n" unless $success;
     115#}
     116
    109117} elsif ($file =~ m|.*\.tgz$|) {
    110118    # Get contents of tarball
  • trunk/ippScripts/scripts/receive_setstatus.pl

    r24031 r24038  
    5151
    5252pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    53 pod2usage( -msg => "Required options: --dest_id --status_uri",
     53pod2usage( -msg => "Required options: --status_fs_name --status_product",
    5454           -exitval => 3) unless
    55     defined $status_fs_name and
     55    defined $received_fs_name and
    5656    defined $status_product and
    5757    defined $fault;
    5858#    and ($fault == 0 or defined $status_file);
     59
     60# if a name for the status fileset is not provided use the received value
     61$status_fs_name = $received_fs_name if !defined $status_fs_name;
    5962
    6063$ipprc->redirect_output($logfile) if $logfile;
Note: See TracChangeset for help on using the changeset viewer.