Changeset a835df7
- Timestamp:
- Sep 18, 2007 9:36:56 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:
- c8c45ee
- Parents:
- 0e23fdb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/splitter.pl
r0e23fdb ra835df7 126 126 # of the experiment determined using expinfo. From that state, the experiment 127 127 # is either created, modified or spapped in. If everything succeeds, true is 128 # returned. 128 # returned. If the global verbose is set progress messages are printed. 129 129 sub start_segment { 130 130 my($tb, $eid) = @_; # testbed and experiment ID … … 152 152 153 153 # Copy the experiment definition data over 154 print "transferring subexperiment to $tb\n" if $verbose; 154 155 &scp_file("$tmpdir/$tb/$tclfile", "$user\@$host") || return 0; 155 156 # Clear out any old experiment data; if not deleted, copies over it by … … 159 160 # tmp around)) Again, this needs to be done more properly once we have a 160 161 # non-ssh interface here.) 162 print "clearing experiment subdirs on $tb\n" if $verbose; 161 163 &ssh_cmd($user, $host, "/bin/sh -c \\'/bin/rm -rf $proj_dir/*\\'") || 162 164 return 0; 163 165 # Remote experiment is active. Modify it. 164 166 if ($state eq "active") { 167 print "Transferring federation support files to $tb\n" if $verbose; 165 168 # First copy new scripts and hostinfo into the remote /proj 166 169 &scp_file("$tmpdir/hostnames", "$user\@$host", $to_hostname) || … … 168 171 &ship_scripts($host, $user, $proj_dir) || return 0; 169 172 &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; 173 174 print "Modifying $eid in place on $tb\n" if $verbose; 170 175 &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -r -s -w $pid " . 171 176 "$eid $tclfile", "modexp") || return 0; … … 175 180 # Remote experiment is swapped out, modify it and swap it in. 176 181 if ($state eq "swapped") { 182 print "Transferring federation support files to $tb\n" if $verbose; 177 183 # First copy new scripts and hostinfo into the remote /proj (because 178 184 # the experiment exists, the directory tree should be there. … … 181 187 &ship_scripts($host, $user, $proj_dir) || return 0; 182 188 &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; 189 190 print "Modifying $eid on $tb\n" if $verbose; 183 191 &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -w $pid $eid $tclfile", 184 192 "modexp") || return 0; 193 print "Swapping $eid in on $tb\n" if $verbose; 185 194 # Now start up 186 195 &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid in", … … 192 201 # the configuration files and scripts into the new experiment directories. 193 202 if ($state eq "none") { 203 print "Creating $exp on $tb\n" if $verbose; 194 204 &ssh_cmd($user, $host, "/usr/testbed/bin/startexp -f -w -p " . 195 205 "$pid -e $eid $tclfile", "startexp") || return 0; 206 print "Transferring federation support files to $tb\n" if $verbose; 196 207 # First copy new scripts and hostinfo into the remote /proj 197 208 &scp_file("$tmpdir/hostnames", "$user\@$host", $to_hostname) || … … 200 211 &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; 201 212 # Now start up 213 print "Swapping $eid in on $tb\n" if $verbose; 202 214 &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid in", 203 215 "swapexp") || return 0; … … 220 232 my($pid) = $project{$tb}; 221 233 234 print "Stopping $eid on $tb\n" if $verbose; 222 235 &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid out", 223 236 "swapexp (out)") || return 0; … … 232 245 # keep our changes to the parser minimal. 233 246 # Argument processing. 234 getopts('c:f:nd ', \%opts);247 getopts('c:f:ndv', \%opts); 235 248 $splitter_config = $opts{'c'} || "./splitter.conf"; 236 249 $debug = $opts{'d'}; 250 $verbose = $opts{'v'} || $opts{'d'}; 251 237 252 &parse_config("$splitter_config", \%opts) || 238 253 die "Cannot read config file $splitter_conf: $!\n"; … … 266 281 $tmpdir .= "/split$$"; 267 282 283 print "Temp files are in $tmpdir\n" if $verbose; 268 284 # Create a workspace 269 285 unless (-d "$tmpdir") { … … 410 426 $ddomain = ".$eid.$project{$dtb}$ddomain"; 411 427 428 my($conf_file) = "$myname$sdomain.gw.conf"; 429 # translate to lower case so the `hostname` hack for specifying 430 # configuration files works. 431 $conf_file =~ tr/A-Z/a-z/; 432 412 433 # If either end of this link is in the master side of the testbed, that 413 434 # side is the active end. Otherwise the first testbed encountered in … … 424 445 425 446 # Write out the file 426 $gwconfig= new IO::File(">$tmpdir/$gateways/$ myname$sdomain.gw.conf")||427 die "can't open $tmpdir/$gateways/$ myname$sdomain.gw.conf: $!\n";447 $gwconfig= new IO::File(">$tmpdir/$gateways/$conf_file")|| 448 die "can't open $tmpdir/$gateways/$conf_file: $!\n"; 428 449 429 450 print $gwconfig "Active: $active\n"; … … 521 542 } 522 543 print "Experiment started\n"; 544 print "Deleting $tmpdir (-d to leave them in place)\n" if $verbose && !$debug; 523 545 system("rm -rf $tmpdir") unless $debug; 524 546 exit(0); # set the exit value
Note: See TracChangeset
for help on using the changeset viewer.