Changeset e2a71ebe


Ignore:
Timestamp:
Oct 3, 2007 9:10:01 AM (17 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
33548e1
Parents:
637adfa
Message:

remote rpms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/splitter.pl

    r637adfa re2a71ebe  
    3030my $tclsh;                      # tclsh to call directly (changed during devel)
    3131my @tarfiles;                   # Tarfiles in use by this experiment
     32my @rpms;                       # Rpms in use by this experiment
    3233my $timeout;                    # The timeout to use for experiment swap ins
    3334my %opts;                       # Parsed options
     
    8384    my $fh = new IO::File($file);  # Testbeds filehandle
    8485    my $tb;                         # Current testbed
    85     # Convert attribute in the file to global variable name.  XXX: Again, this
    86     # needs to be a 2-level hash
     86    # Convert attribute in the file to tbparams hash key
    8787    my %attr_to_hash = (
    8888        "opsnode" => "host",
     
    273273    my $proj_dir = "/proj/$pid/exp/$eid/tmp";  # Where to stash federation stuff
    274274    my $tarfiles_dir = "/proj/$pid/tarfiles/$eid";  # Where to stash tarfiles
     275    my $rpms_dir = "/proj/$pid/rpms/$eid";  # Where to stash rpms
    275276    my $to_hostname = "$proj_dir/hosts";    # remote hostnames file
    276277    my $state;                              # State of remote experiment
     
    307308    &ssh_cmd($user, $host, "mkdir -p $tarfiles_dir", "create tarfiles") ||
    308309        return 0;
     310    print "clearing experiment rpms subdirs on $tb\n" if $verbose;
     311    &ssh_cmd($user, $host, "/bin/rm -rf $rpms_dir/") ||
     312        return 0;
     313    print "creating rpms subdir $rpms_dir on $tb\n" if $verbose;
     314    &ssh_cmd($user, $host, "mkdir -p $rpms_dir", "create rpms") ||
     315        return 0;
    309316    # Remote experiment is active.  Modify it.
    310317    if ($state eq "active") {
     
    315322        &ship_scripts($host, $user, $proj_dir) || return 0;
    316323        &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0;
     324
    317325        if ( -d "$tmpdir/tarfiles") {
    318326            &ship_configs($host, $user, "$tmpdir/tarfiles", $tarfiles_dir) ||
     327                return 0;
     328        }
     329
     330        if ( -d "$tmpdir/rpms") {
     331            &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) ||
    319332                return 0;
    320333        }
     
    340353        }
    341354
     355        if ( -d "$tmpdir/rpms") {
     356            &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) ||
     357                return 0;
     358        }
     359
    342360        print "Modifying $eid on $tb\n" if $verbose;
    343361        &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -w $pid $eid $tclfile",
     
    360378                return 0;
    361379        }
     380
     381        if ( -d "$tmpdir/rpms") {
     382            &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) ||
     383                return 0;
     384        }
     385
    362386        print "Creating $eid on $tb\n" if $verbose;
    363387        &ssh_cmd($user, $host, "/usr/testbed/bin/startexp -i -f -w -p " .
    364388            "$pid -e $eid $tclfile", "startexp") || return 0;
     389        # After startexp succeeds, the per-experiment directories exist on the
     390        # remote testbed.
    365391        print "Transferring federation support files to $tb\n" if $verbose;
    366392        # First copy new scripts and hostinfo into the remote /proj
     
    688714        next;
    689715    };
     716    (/^#\s+Begin\s+rpms/../^#\s+End\s+rpms/) && do {
     717        next if /^#/;
     718        chomp;
     719        push(@rpms, $_);
     720        next;
     721    };
    690722
    691723    next unless $destfile;  # Unidentified testbed, ignore config
     
    720752die "No nodes in master testbed ($master)\n" unless $allocated{$master};
    721753
     754# Copy tarfiles and rpms needed at remote sites to the staging directories.
     755# Start_segment will distribute them
    722756for my $t  (@tarfiles) {
    723757    die "tarfile '$t' unreadable: $!\n" unless -r $t;
     
    728762    copy($t, "$tmpdir/tarfiles") ||
    729763        die "Can't copy $t to  $tmpdir/tarfiles:$!\n";
     764}
     765
     766for my $r  (@rpms) {
     767    die "rpm '$r' unreadable: $!\n" unless -r $r;
     768    unless (-d "$tmpdir/rpms") {
     769        mkdir("$tmpdir/rpms") ||
     770            die "Can't create $tmpdir/rpms:$!\n";
     771    }
     772    copy($r, "$tmpdir/rpms") ||
     773        die "Can't copy $r to  $tmpdir/rpms:$!\n";
    730774}
    731775
Note: See TracChangeset for help on using the changeset viewer.