- Timestamp:
- Oct 3, 2007 9:10:01 AM (17 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 33548e1
- Parents:
- 637adfa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/splitter.pl
r637adfa re2a71ebe 30 30 my $tclsh; # tclsh to call directly (changed during devel) 31 31 my @tarfiles; # Tarfiles in use by this experiment 32 my @rpms; # Rpms in use by this experiment 32 33 my $timeout; # The timeout to use for experiment swap ins 33 34 my %opts; # Parsed options … … 83 84 my $fh = new IO::File($file); # Testbeds filehandle 84 85 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 87 87 my %attr_to_hash = ( 88 88 "opsnode" => "host", … … 273 273 my $proj_dir = "/proj/$pid/exp/$eid/tmp"; # Where to stash federation stuff 274 274 my $tarfiles_dir = "/proj/$pid/tarfiles/$eid"; # Where to stash tarfiles 275 my $rpms_dir = "/proj/$pid/rpms/$eid"; # Where to stash rpms 275 276 my $to_hostname = "$proj_dir/hosts"; # remote hostnames file 276 277 my $state; # State of remote experiment … … 307 308 &ssh_cmd($user, $host, "mkdir -p $tarfiles_dir", "create tarfiles") || 308 309 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; 309 316 # Remote experiment is active. Modify it. 310 317 if ($state eq "active") { … … 315 322 &ship_scripts($host, $user, $proj_dir) || return 0; 316 323 &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; 324 317 325 if ( -d "$tmpdir/tarfiles") { 318 326 &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) || 319 332 return 0; 320 333 } … … 340 353 } 341 354 355 if ( -d "$tmpdir/rpms") { 356 &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) || 357 return 0; 358 } 359 342 360 print "Modifying $eid on $tb\n" if $verbose; 343 361 &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -w $pid $eid $tclfile", … … 360 378 return 0; 361 379 } 380 381 if ( -d "$tmpdir/rpms") { 382 &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) || 383 return 0; 384 } 385 362 386 print "Creating $eid on $tb\n" if $verbose; 363 387 &ssh_cmd($user, $host, "/usr/testbed/bin/startexp -i -f -w -p " . 364 388 "$pid -e $eid $tclfile", "startexp") || return 0; 389 # After startexp succeeds, the per-experiment directories exist on the 390 # remote testbed. 365 391 print "Transferring federation support files to $tb\n" if $verbose; 366 392 # First copy new scripts and hostinfo into the remote /proj … … 688 714 next; 689 715 }; 716 (/^#\s+Begin\s+rpms/../^#\s+End\s+rpms/) && do { 717 next if /^#/; 718 chomp; 719 push(@rpms, $_); 720 next; 721 }; 690 722 691 723 next unless $destfile; # Unidentified testbed, ignore config … … 720 752 die "No nodes in master testbed ($master)\n" unless $allocated{$master}; 721 753 754 # Copy tarfiles and rpms needed at remote sites to the staging directories. 755 # Start_segment will distribute them 722 756 for my $t (@tarfiles) { 723 757 die "tarfile '$t' unreadable: $!\n" unless -r $t; … … 728 762 copy($t, "$tmpdir/tarfiles") || 729 763 die "Can't copy $t to $tmpdir/tarfiles:$!\n"; 764 } 765 766 for 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"; 730 774 } 731 775
Note: See TracChangeset
for help on using the changeset viewer.