[1a8a08a] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
[b814529] | 3 | use strict; |
---|
| 4 | |
---|
[1a8a08a] | 5 | use Getopt::Std; |
---|
[9c00d41] | 6 | use IO::File; |
---|
| 7 | use IO::Dir; |
---|
| 8 | use IO::Pipe; |
---|
| 9 | use File::Copy; |
---|
[1a8a08a] | 10 | |
---|
[f3691ff] | 11 | my @scripts = ("fed_bootstrap", "federate.sh", "smbmount.FreeBSD.pl", |
---|
| 12 | "smbmount.Linux.pl", "make_hosts", "fed-tun.pl", "fed_evrepeater", |
---|
| 13 | "rc.accounts.patch"); |
---|
[527321c] | 14 | my $local_script_dir = "."; |
---|
[b814529] | 15 | my($pid, $gid); # Process and group IDs for calling parse.tcl |
---|
[527321c] | 16 | my $splitter_config; # Configuration file |
---|
| 17 | my $debug; # True if thecalled in debug mode |
---|
| 18 | my $verbose; # True for extra progress reports |
---|
| 19 | my $startem; # If true, start the sub-experiments |
---|
| 20 | my $eid; # Experiment ID |
---|
| 21 | my $tcl; # The experiment description (topology file) |
---|
| 22 | my $master; # Master testbed |
---|
| 23 | my $tmpdir; # tmp files |
---|
| 24 | my $tb_config; # testbed configurations |
---|
| 25 | my $smb_share; # Share to mount from the master |
---|
| 26 | my $project_user; # User to mount project dirs as |
---|
[2396559e] | 27 | my $auth_proj; # Local project for resource access |
---|
[b814529] | 28 | my($gw_pubkey, $gw_pubkey_base);# Connector pubkey (full path & basename) |
---|
| 29 | my($gw_secretkey, $gw_secretkey_base);# Connector secret key (full path & |
---|
| 30 | # basename) |
---|
[22bb7f8] | 31 | my($keytype); # Type (DSA or RSA) of generated gateway keys |
---|
[527321c] | 32 | my $tcl_splitter; # tcl program to split experiments |
---|
[b814529] | 33 | # (changed during devel) |
---|
[527321c] | 34 | my $tclsh; # tclsh to call directly (changed during devel) |
---|
[2396559e] | 35 | my $fedd_client; # Program to call for testbed access params |
---|
[e5fee75] | 36 | my $muxmax; # Maximum number of links/lans over 1 gw pair |
---|
[527321c] | 37 | my @tarfiles; # Tarfiles in use by this experiment |
---|
[e2a71ebe] | 38 | my @rpms; # Rpms in use by this experiment |
---|
[5479c80] | 39 | my $timeout; # The timeout to use for experiment swap ins |
---|
[527321c] | 40 | my %opts; # Parsed options |
---|
| 41 | |
---|
| 42 | my $tbparams = {}; # Map of the per-testbed parameters from the |
---|
| 43 | # testbeds file. It is a reference to a hash |
---|
| 44 | # of hashes (because it's passed around a bunch |
---|
| 45 | # and it's nicer to have one access pattern |
---|
| 46 | # throughout the script, in the main loop and |
---|
| 47 | # the subroutines). That access is exemplified |
---|
| 48 | # by $tbparams->{'deter'}->{'domain'} which is |
---|
| 49 | # the domain parameter of the DETER testbed. |
---|
[637adfa] | 50 | my $fail_soft; # Do not swap failed sub-experiments out |
---|
[e863014] | 51 | my $max_children=1; # Maximum number of simultaneous swap-ins |
---|
[63f7c7e] | 52 | |
---|
[2396559e] | 53 | # Default commands for starting experiment and gateway nodes. Testbeds can |
---|
| 54 | # override these. (The 'm' prefixed commands are for operating as the master |
---|
| 55 | # testbed.) |
---|
| 56 | my $def_expstart = "sudo -H /bin/sh FEDDIR/fed_bootstrap >& /tmp/federate"; |
---|
| 57 | my $def_mexpstart = "sudo -H FEDDIR/make_hosts FEDDIR/hosts"; |
---|
| 58 | my $def_gwstart = "sudo -H FEDDIR/fed-tun.pl -f GWCONF>& /tmp/bridge.log"; |
---|
| 59 | my $def_mgwstart = "sudo -H FEDDIR/fed-tun.pl -f GWCONF >& /tmp/bridge.log"; |
---|
| 60 | my $def_gwimage = "FBSD61-TUNNEL2"; |
---|
| 61 | my $def_gwtype = "pc"; |
---|
| 62 | |
---|
[9c00d41] | 63 | # Parse the config file. The format is a colon-separated parameter name |
---|
| 64 | # followed by the value of that parameter to the end of the line. This parses |
---|
| 65 | # that format and puts the parameters into the referenced hash. Parameter |
---|
| 66 | # names are mapped to lower case, parameter values are unchanged. Returns 0 on |
---|
| 67 | # failure (e.g. file open) and 1 on success. |
---|
| 68 | sub parse_config { |
---|
| 69 | my($file, $href) = @_; |
---|
[5f1cd41] | 70 | my $fh = new IO::File($file); |
---|
[9c00d41] | 71 | |
---|
| 72 | unless ($fh) { |
---|
| 73 | warn "Can't open $file: $!\n"; |
---|
| 74 | return 0; |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | while (<$fh>) { |
---|
| 78 | next if /^\s*#/ || /^\s*$/; # Skip comments & blanks |
---|
| 79 | chomp; |
---|
| 80 | /^([^:]+):\s*(.*)/ && do { |
---|
[5f1cd41] | 81 | my $key = $1; |
---|
[9c00d41] | 82 | |
---|
| 83 | $key =~ tr/A-Z/a-z/; |
---|
| 84 | $href->{$key} = $2; |
---|
| 85 | next; |
---|
| 86 | }; |
---|
| 87 | warn "Unparasble line in $file: $_\n"; |
---|
| 88 | } |
---|
| 89 | $fh->close(); # It will close when it goes out of scope, but... |
---|
| 90 | return 1; |
---|
| 91 | } |
---|
| 92 | |
---|
[fe459d0] | 93 | # Parse an easier-to-read testbeds file (the original was comma-separated |
---|
| 94 | # unadorned strings). The format is a testbed scope as [testbed] followed by |
---|
| 95 | # the colon-separated attribute-value pairs for the testbed. Right now these |
---|
| 96 | # go into a set of global hashes indexed by testbed, but that should probably |
---|
[2396559e] | 97 | # change. The file parameter is an open IO::Handle. &parse_testbeds_filename |
---|
| 98 | # opens the file and calls this. Parse_testbeds can be used on pipes as well, |
---|
| 99 | # e.g. fedd_client output. |
---|
[fe459d0] | 100 | sub parse_testbeds { |
---|
[2396559e] | 101 | my($fh, $tbparams) = @_; # Testbeds file and parameter hash |
---|
[527321c] | 102 | my $tb; # Current testbed |
---|
[e2a71ebe] | 103 | # Convert attribute in the file to tbparams hash key |
---|
[527321c] | 104 | my %attr_to_hash = ( |
---|
[fe459d0] | 105 | "opsnode" => "host", |
---|
| 106 | "user" => "user", |
---|
| 107 | "domain" => "domain", |
---|
| 108 | "project" => "project", |
---|
| 109 | "connectortype" => "gwtype", |
---|
| 110 | "slavenodestartcmd" => "expstart", |
---|
| 111 | "slaveconnectorstartcmd" => "gwstart", |
---|
| 112 | "masternodestartcmd" => "mexpstart", |
---|
| 113 | "masterconnectorstartcmd" => "mgwstart", |
---|
| 114 | "connectorimage" => "gwimage", |
---|
| 115 | "fileserver" => "fs", |
---|
| 116 | "boss" => "boss", |
---|
[f64fa81] | 117 | "eventserver" => "eventserver", |
---|
[2396559e] | 118 | "tunnelcfg" => "tun", |
---|
| 119 | "uri" => "uri", |
---|
| 120 | "access" => "access" |
---|
[fe459d0] | 121 | ); |
---|
| 122 | |
---|
| 123 | while (<$fh>) { |
---|
| 124 | next if /^\s*#/ || /^\s*$/; # Skip comments & blanks |
---|
[2396559e] | 125 | print STDERR "testbeds: $_"; |
---|
[fe459d0] | 126 | chomp; |
---|
| 127 | /^\s*\[(.*)\]/ && do { |
---|
| 128 | $tb = $1; |
---|
[527321c] | 129 | $tbparams->{$tb} = {} unless $tbparams->{$tb}; |
---|
[fe459d0] | 130 | next; |
---|
| 131 | }; |
---|
| 132 | |
---|
| 133 | /^([^:]+):\s*(.*)/ && do { |
---|
| 134 | unless ($tb) { |
---|
[2396559e] | 135 | warn "Ignored attribute definition before testbed: $_\n "; |
---|
[fe459d0] | 136 | next; |
---|
| 137 | } |
---|
[527321c] | 138 | my $key = $1; |
---|
[fe459d0] | 139 | $key =~ tr/A-Z/a-z/; |
---|
[527321c] | 140 | my $var = $attr_to_hash{$key}; |
---|
[fe459d0] | 141 | |
---|
[527321c] | 142 | if ($var) { $tbparams->{$tb}->{$var} = $2; } |
---|
[2396559e] | 143 | else { warn "Unknown keyword $key\n"; } |
---|
[fe459d0] | 144 | |
---|
| 145 | next; |
---|
| 146 | }; |
---|
[2396559e] | 147 | warn "Unparasble line: $_\n"; |
---|
[fe459d0] | 148 | } |
---|
| 149 | return 1; |
---|
| 150 | } |
---|
| 151 | |
---|
[2396559e] | 152 | |
---|
| 153 | # Open the given file name and parse the testbeds file it contains by calling |
---|
| 154 | # &parse_testbeds. |
---|
| 155 | sub parse_testbeds_filename { |
---|
| 156 | my($file, $tbparams) = @_; # Testbeds file and parameter hash |
---|
| 157 | my $fh = new IO::File($file); # Testbeds filehandle |
---|
| 158 | |
---|
| 159 | if ($fh) { |
---|
| 160 | my $rv = &parse_testbeds($fh, $tbparams); |
---|
| 161 | $fh->close(); # It will close when it goes out of scope, but... |
---|
| 162 | $rv; |
---|
| 163 | } |
---|
| 164 | else { |
---|
| 165 | warn "Can't open $file: $!\n"; |
---|
| 166 | return 0; |
---|
| 167 | } |
---|
| 168 | } |
---|
| 169 | |
---|
[22bb7f8] | 170 | # Generate SSH keys for use by the gateways. The parameters are the type and |
---|
| 171 | # the filename for the private key. The pubkey will be stored in a filename |
---|
| 172 | # with the same name as the private key but with .pub appended. Type can be |
---|
| 173 | # dsa or rsa. |
---|
| 174 | |
---|
| 175 | sub generate_ssh_keys { |
---|
| 176 | my($type, $dest) = @_; |
---|
| 177 | |
---|
| 178 | $type =~ tr/A-Z/a-z/; |
---|
| 179 | return 0 if $type !~ /(rsa|dsa)/; |
---|
| 180 | system("/usr/bin/ssh-keygen -t $type -N \"\" -f $dest"); |
---|
| 181 | return $@ ? 0 : 1; |
---|
| 182 | } |
---|
[9c00d41] | 183 | |
---|
[1a8a08a] | 184 | # use scp to transfer a file, reporting true if successful and false otherwise. |
---|
| 185 | # Parameters are the local file name, the ssh host destination (either hostname |
---|
| 186 | # oe user@host), and an optional destination file name or directory. If no |
---|
| 187 | # destination is given, the file is transferred to the given user's home |
---|
| 188 | # directory. If only a machine is given in the ssh host destination, the |
---|
| 189 | # current user is used. |
---|
| 190 | sub scp_file { |
---|
[b68f597] | 191 | my($file, $user, $host, $dest) = @_; |
---|
[1a8a08a] | 192 | |
---|
| 193 | # XXX system with a relative pathname is sort of gross |
---|
[b68f597] | 194 | system("scp $file $user\@$host:$dest"); |
---|
[1a8a08a] | 195 | if ($?) { |
---|
| 196 | warn "scp failed $?\n"; |
---|
| 197 | return 0; |
---|
| 198 | } |
---|
| 199 | else { return 1; } |
---|
| 200 | } |
---|
| 201 | |
---|
| 202 | # use ssh to execute the given command on the machine (and as the user) in |
---|
| 203 | # $where. Parameters are the ssh destination directive ($where) and the |
---|
| 204 | # command to execute, and a prefix to be placed on a message generated if the |
---|
| 205 | # command fails. On failure print a warning if a warning prefix was given and |
---|
[5479c80] | 206 | # return false. If timeout is given fork a process and set an alarm of that |
---|
| 207 | # many seconds. Timeouts also return 0; |
---|
[1a8a08a] | 208 | sub ssh_cmd { |
---|
[5479c80] | 209 | my($user, $host, $cmd, $wname, $timeout) = @_; |
---|
| 210 | my $pid; # Child pid |
---|
| 211 | |
---|
[33548e1] | 212 | $timeout = 0 unless $timeout; # Force default timeout |
---|
| 213 | |
---|
| 214 | if ( $pid = fork () ) { |
---|
| 215 | # Parent process |
---|
| 216 | # The eval acts as a signal catcher. If the alarm goes off inside |
---|
| 217 | # the eval, the die will put "alarm\n" into $@, otherwise the |
---|
| 218 | # return value of the execution in the child process will be used. |
---|
| 219 | my $rv = eval { |
---|
| 220 | local $SIG{'ALRM'} = sub{ die "alarm\n"; }; |
---|
| 221 | my $rv; |
---|
| 222 | |
---|
| 223 | alarm $timeout; |
---|
| 224 | $rv = waitpid($pid, 0); |
---|
| 225 | alarm 0; |
---|
| 226 | $rv; |
---|
| 227 | }; |
---|
| 228 | |
---|
| 229 | # If the eval succeeded, $@ will be null and we can use $rv, which |
---|
| 230 | # is the return code from the subprocess. If the eval timed out, |
---|
| 231 | # print a warning and assume the best. |
---|
| 232 | if ($@ eq "alarm\n" ) { |
---|
| 233 | warn "$wname timed out - pid $pid still live\n"; |
---|
| 234 | return 1; |
---|
[5479c80] | 235 | } |
---|
| 236 | else { |
---|
[33548e1] | 237 | return $rv; |
---|
[5479c80] | 238 | } |
---|
| 239 | } |
---|
| 240 | else { |
---|
[33548e1] | 241 | # Child process |
---|
| 242 | exec("ssh $user\@$host $cmd"); |
---|
| 243 | exit 0; |
---|
[1a8a08a] | 244 | } |
---|
| 245 | } |
---|
| 246 | |
---|
[63f7c7e] | 247 | # Ship local copies of the federation scripts out to the given host. If any of |
---|
| 248 | # the script transfers fails, return 0. The scripts to transfer are from the |
---|
| 249 | # global @scripts and are found locally in $local_script_dir (another global). |
---|
| 250 | sub ship_scripts { |
---|
| 251 | my($host, $user, $dest_dir) = @_; # Where, who, where remotely |
---|
[5f1cd41] | 252 | my $s; |
---|
[63f7c7e] | 253 | |
---|
[2ef2c5b] | 254 | &ssh_cmd($user, $host, "mkdir -p $dest_dir"); |
---|
[63f7c7e] | 255 | for $s (@scripts) { |
---|
[b68f597] | 256 | &scp_file("$local_script_dir/$s", $user, $host, $dest_dir) || |
---|
[63f7c7e] | 257 | return 0; |
---|
| 258 | } |
---|
| 259 | return 1; |
---|
| 260 | } |
---|
| 261 | |
---|
[9c00d41] | 262 | # Ship per-testbed configuration generated by this script to the remote /proj |
---|
| 263 | # directories on the remote testbeds |
---|
| 264 | sub ship_configs { |
---|
| 265 | my($host, $user, $src_dir, $dest_dir) = @_; # Where, who, where remotely |
---|
| 266 | my($d, $f); |
---|
| 267 | |
---|
| 268 | $d = IO::Dir->new($src_dir) || return 0; |
---|
| 269 | |
---|
[3529a90] | 270 | # All directories under $tmpdir are 770 so we can delete them later. |
---|
| 271 | &ssh_cmd($user, $host, "mkdir -p $dest_dir") || return 0; |
---|
| 272 | &ssh_cmd($user, $host, "chmod 770 $dest_dir") || return 0; |
---|
[9c00d41] | 273 | while ( $f = $d->read()) { |
---|
| 274 | next if $f =~ /^\./; |
---|
[2ef2c5b] | 275 | if ( -d "$src_dir/$f" ) { |
---|
[3529a90] | 276 | &ship_configs($host, $user, "$src_dir/$f", "$dest_dir/$f") || |
---|
| 277 | return 0; |
---|
[2ef2c5b] | 278 | } |
---|
| 279 | else { |
---|
[b68f597] | 280 | &scp_file("$src_dir/$f", $user, $host, $dest_dir) || return 0; |
---|
[2ef2c5b] | 281 | } |
---|
[9c00d41] | 282 | } |
---|
| 283 | return 1; |
---|
| 284 | } |
---|
| 285 | |
---|
[1a8a08a] | 286 | # Start a sub section of the experiment on a given testbed. The testbed and |
---|
| 287 | # the user to start the experiment as are pulled from the global per-testbed |
---|
[527321c] | 288 | # hash, passed in as $tbparams, as is the project name on the remote testbed. |
---|
| 289 | # Parameters are the testbed and the experiment id. Configuration files are |
---|
| 290 | # scp-ed over to the target testbed from the global $tmpdir/$tb directory. |
---|
| 291 | # Then the current state of the experiment determined using expinfo. From that |
---|
| 292 | # state, the experiment is either created, modified or spapped in. If |
---|
| 293 | # everything succeeds, true is returned. If the global verbose is set progress |
---|
| 294 | # messages are printed. |
---|
[1a8a08a] | 295 | sub start_segment { |
---|
[5479c80] | 296 | my($tb, $eid, $tbparams, $timeout) = @_;# testbed, experiment ID, |
---|
| 297 | # per-testbed parameters and remote |
---|
| 298 | # swap-in timeout |
---|
[527321c] | 299 | my $host = # Host name of remote ops (FQDN) |
---|
| 300 | $tbparams->{$tb}->{'host'} . $tbparams->{$tb}->{'domain'}; |
---|
| 301 | my $user = $tbparams->{$tb}->{'user'}; # user to pass to ssh |
---|
| 302 | my $pid = $tbparams->{$tb}->{'project'};# remote project to start the |
---|
[1a8a08a] | 303 | # experiment under |
---|
[527321c] | 304 | my $tclfile = "./$eid.$tb.tcl"; # Local tcl file with the |
---|
[1a8a08a] | 305 | # sub-experiment |
---|
[527321c] | 306 | my $proj_dir = "/proj/$pid/exp/$eid/tmp"; # Where to stash federation stuff |
---|
| 307 | my $tarfiles_dir = "/proj/$pid/tarfiles/$eid"; # Where to stash tarfiles |
---|
[e2a71ebe] | 308 | my $rpms_dir = "/proj/$pid/rpms/$eid"; # Where to stash rpms |
---|
[527321c] | 309 | my $to_hostname = "$proj_dir/hosts"; # remote hostnames file |
---|
| 310 | my $state; # State of remote experiment |
---|
| 311 | my $status = new IO::Pipe; # The pipe to get status |
---|
[1a8a08a] | 312 | |
---|
| 313 | # Determine the status of the remote experiment |
---|
[9c00d41] | 314 | $status->reader("ssh $user\@$host /usr/testbed/bin/expinfo $pid $eid") || |
---|
[c23025e] | 315 | die "Can't ssh to $user\@$host:$!\n"; |
---|
[1a8a08a] | 316 | # XXX: this is simple now. Parsing may become more complex |
---|
[9c00d41] | 317 | while (<$status>) { |
---|
[1a8a08a] | 318 | /State: (\w+)/ && ($state = $1); |
---|
| 319 | /No\s+such\s+experiment/ && ($state = "none"); |
---|
| 320 | } |
---|
[9c00d41] | 321 | $status->close(); |
---|
[1a8a08a] | 322 | print "$tb: $state\n"; |
---|
| 323 | |
---|
[3529a90] | 324 | # Copy the experiment definition data over |
---|
[a835df7] | 325 | print "transferring subexperiment to $tb\n" if $verbose; |
---|
[b68f597] | 326 | &scp_file("$tmpdir/$tb/$tclfile", $user, $host) || return 0; |
---|
[3529a90] | 327 | # Clear out any old experiment data; if not deleted, copies over it by |
---|
| 328 | # different users will fail. |
---|
[0e23fdb] | 329 | # (O /bin/csh, how evil thou art. The -c and the escaped single quotes |
---|
| 330 | # force the /bin/sh interpretation of the trailing * (which we need to keep |
---|
| 331 | # tmp around)) Again, this needs to be done more properly once we have a |
---|
| 332 | # non-ssh interface here.) |
---|
[a835df7] | 333 | print "clearing experiment subdirs on $tb\n" if $verbose; |
---|
[0e23fdb] | 334 | &ssh_cmd($user, $host, "/bin/sh -c \\'/bin/rm -rf $proj_dir/*\\'") || |
---|
| 335 | return 0; |
---|
[b68f597] | 336 | print "clearing experiment tarfiles subdirs on $tb\n" if $verbose; |
---|
| 337 | &ssh_cmd($user, $host, "/bin/rm -rf $tarfiles_dir/") || |
---|
| 338 | return 0; |
---|
| 339 | print "creating tarfiles subdir $tarfiles_dir on $tb\n" if $verbose; |
---|
| 340 | &ssh_cmd($user, $host, "mkdir -p $tarfiles_dir", "create tarfiles") || |
---|
| 341 | return 0; |
---|
[e2a71ebe] | 342 | print "clearing experiment rpms subdirs on $tb\n" if $verbose; |
---|
| 343 | &ssh_cmd($user, $host, "/bin/rm -rf $rpms_dir/") || |
---|
| 344 | return 0; |
---|
| 345 | print "creating rpms subdir $rpms_dir on $tb\n" if $verbose; |
---|
| 346 | &ssh_cmd($user, $host, "mkdir -p $rpms_dir", "create rpms") || |
---|
| 347 | return 0; |
---|
[1a8a08a] | 348 | # Remote experiment is active. Modify it. |
---|
| 349 | if ($state eq "active") { |
---|
[a835df7] | 350 | print "Transferring federation support files to $tb\n" if $verbose; |
---|
[63f7c7e] | 351 | # First copy new scripts and hostinfo into the remote /proj |
---|
[b68f597] | 352 | &scp_file("$tmpdir/hostnames", $user, $host, $to_hostname) || |
---|
[c23025e] | 353 | return 0; |
---|
[63f7c7e] | 354 | &ship_scripts($host, $user, $proj_dir) || return 0; |
---|
[9c00d41] | 355 | &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; |
---|
[e2a71ebe] | 356 | |
---|
[b68f597] | 357 | if ( -d "$tmpdir/tarfiles") { |
---|
| 358 | &ship_configs($host, $user, "$tmpdir/tarfiles", $tarfiles_dir) || |
---|
| 359 | return 0; |
---|
| 360 | } |
---|
[a835df7] | 361 | |
---|
[e2a71ebe] | 362 | if ( -d "$tmpdir/rpms") { |
---|
| 363 | &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) || |
---|
| 364 | return 0; |
---|
| 365 | } |
---|
| 366 | |
---|
[a835df7] | 367 | print "Modifying $eid in place on $tb\n" if $verbose; |
---|
[1a8a08a] | 368 | &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -r -s -w $pid " . |
---|
[5479c80] | 369 | "$eid $tclfile", "modexp", $timeout) || return 0; |
---|
[1a8a08a] | 370 | return 1; |
---|
| 371 | } |
---|
| 372 | |
---|
| 373 | # Remote experiment is swapped out, modify it and swap it in. |
---|
| 374 | if ($state eq "swapped") { |
---|
[a835df7] | 375 | print "Transferring federation support files to $tb\n" if $verbose; |
---|
[2ef2c5b] | 376 | # First copy new scripts and hostinfo into the remote /proj (because |
---|
| 377 | # the experiment exists, the directory tree should be there. |
---|
[b68f597] | 378 | &scp_file("$tmpdir/hostnames", $user, $host, $to_hostname) || |
---|
[838fb6a] | 379 | return 0; |
---|
[63f7c7e] | 380 | &ship_scripts($host, $user, $proj_dir) || return 0; |
---|
[9c00d41] | 381 | &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; |
---|
[b68f597] | 382 | if ( -d "$tmpdir/tarfiles") { |
---|
| 383 | &ship_configs($host, $user, "$tmpdir/tarfiles", $tarfiles_dir) || |
---|
| 384 | return 0; |
---|
| 385 | } |
---|
[a835df7] | 386 | |
---|
[e2a71ebe] | 387 | if ( -d "$tmpdir/rpms") { |
---|
| 388 | &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) || |
---|
| 389 | return 0; |
---|
| 390 | } |
---|
| 391 | |
---|
[a835df7] | 392 | print "Modifying $eid on $tb\n" if $verbose; |
---|
[2ef2c5b] | 393 | &ssh_cmd($user, $host, "/usr/testbed/bin/modexp -w $pid $eid $tclfile", |
---|
| 394 | "modexp") || return 0; |
---|
[a835df7] | 395 | print "Swapping $eid in on $tb\n" if $verbose; |
---|
[63f7c7e] | 396 | # Now start up |
---|
[1a8a08a] | 397 | &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid in", |
---|
[5479c80] | 398 | "swapexp", $timeout) || return 0; |
---|
[1a8a08a] | 399 | return 1; |
---|
| 400 | } |
---|
| 401 | |
---|
[63f7c7e] | 402 | # No remote experiment. Create one. We do this in 2 steps so we can put |
---|
| 403 | # the configuration files and scripts into the new experiment directories. |
---|
[1a8a08a] | 404 | if ($state eq "none") { |
---|
[b68f597] | 405 | |
---|
| 406 | if ( -d "$tmpdir/tarfiles") { |
---|
| 407 | # Tarfiles have to exist for the creation to work |
---|
| 408 | print "copying tarfiles to $tb\n"; |
---|
| 409 | &ship_configs($host, $user, "$tmpdir/tarfiles", $tarfiles_dir) || |
---|
| 410 | return 0; |
---|
| 411 | } |
---|
[e2a71ebe] | 412 | |
---|
| 413 | if ( -d "$tmpdir/rpms") { |
---|
| 414 | &ship_configs($host, $user, "$tmpdir/rpms", $rpms_dir) || |
---|
| 415 | return 0; |
---|
| 416 | } |
---|
| 417 | |
---|
[fe459d0] | 418 | print "Creating $eid on $tb\n" if $verbose; |
---|
| 419 | &ssh_cmd($user, $host, "/usr/testbed/bin/startexp -i -f -w -p " . |
---|
[1a8a08a] | 420 | "$pid -e $eid $tclfile", "startexp") || return 0; |
---|
[e2a71ebe] | 421 | # After startexp succeeds, the per-experiment directories exist on the |
---|
| 422 | # remote testbed. |
---|
[a835df7] | 423 | print "Transferring federation support files to $tb\n" if $verbose; |
---|
[63f7c7e] | 424 | # First copy new scripts and hostinfo into the remote /proj |
---|
[b68f597] | 425 | &scp_file("$tmpdir/hostnames", $user, $host, $to_hostname) || |
---|
[838fb6a] | 426 | return 0; |
---|
[63f7c7e] | 427 | &ship_scripts($host, $user, $proj_dir) || return 0; |
---|
[9c00d41] | 428 | &ship_configs($host, $user, "$tmpdir/$tb", $proj_dir) || return 0; |
---|
[63f7c7e] | 429 | # Now start up |
---|
[a835df7] | 430 | print "Swapping $eid in on $tb\n" if $verbose; |
---|
[63f7c7e] | 431 | &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid in", |
---|
[5479c80] | 432 | "swapexp", $timeout) || return 0; |
---|
[1a8a08a] | 433 | return 1; |
---|
| 434 | } |
---|
| 435 | |
---|
| 436 | # Every branch for a known state returns. If execution gets here, the |
---|
| 437 | # state is unknown. |
---|
| 438 | warn "unknown state: $state\n"; |
---|
| 439 | return 0; |
---|
| 440 | } |
---|
| 441 | |
---|
| 442 | # Swap out a sub-experiment - probably because another has failed. Arguments |
---|
| 443 | # are testbed and experiment. Most of the control flow is similar to |
---|
| 444 | # start_segment, though much simpler. |
---|
| 445 | sub stop_segment { |
---|
[527321c] | 446 | my($tb, $eid, $tbparams) = @_; # testbed, experiment ID and |
---|
| 447 | # per-testbed parameters |
---|
| 448 | my $user = $tbparams->{$tb}->{'user'}; # testbed user |
---|
| 449 | my $host = # Ops node |
---|
| 450 | $tbparams->{$tb}->{'host'} . $tbparams->{$tb}->{'domain'}; |
---|
| 451 | my $pid = $tbparams->{$tb}->{'project'};# testbed project |
---|
[1a8a08a] | 452 | |
---|
[a835df7] | 453 | print "Stopping $eid on $tb\n" if $verbose; |
---|
[1a8a08a] | 454 | &ssh_cmd($user, $host, "/usr/testbed/bin/swapexp -w $pid $eid out", |
---|
| 455 | "swapexp (out)") || return 0; |
---|
| 456 | return 1; |
---|
| 457 | } |
---|
| 458 | |
---|
| 459 | |
---|
| 460 | $pid = $gid = "dummy"; # Default project and group to pass to |
---|
| 461 | # $tcl_splitter above. These are total |
---|
| 462 | # dummy arguments; the splitter doesn't |
---|
| 463 | # use them at all, but we supply them to |
---|
| 464 | # keep our changes to the parser minimal. |
---|
| 465 | # Argument processing. |
---|
[2396559e] | 466 | getopts('Ft:c:p:f:ndvNP:', \%opts); |
---|
[9c00d41] | 467 | $splitter_config = $opts{'c'} || "./splitter.conf"; |
---|
| 468 | $debug = $opts{'d'}; |
---|
[a835df7] | 469 | $verbose = $opts{'v'} || $opts{'d'}; |
---|
| 470 | |
---|
[9c00d41] | 471 | &parse_config("$splitter_config", \%opts) || |
---|
[b814529] | 472 | die "Cannot read config file $splitter_config: $!\n"; |
---|
[9c00d41] | 473 | |
---|
[33548e1] | 474 | warn "-N does nothing now. Only one testbeds format supported.\n" |
---|
| 475 | if $opts{'N'}; |
---|
[e863014] | 476 | $fail_soft = $opts{'F'} || $opts{'failsoft'}; |
---|
[9c00d41] | 477 | $startem = $opts{'n'} ? 0 : 1; # If true, start the sub-experiments |
---|
[5479c80] | 478 | $timeout = $opts{'t'} || $opts{'timeout'}; |
---|
[9c00d41] | 479 | $eid = $opts{'experiment'}; # Experiment ID |
---|
| 480 | $tcl = $opts{'f'} || shift; # The experiment description |
---|
| 481 | $master = $opts{'master'}; # Master testbed |
---|
| 482 | $tmpdir = $opts{'tmpdir'} || $opts{'tempdir'}|| "/tmp"; # tmp files |
---|
| 483 | $tb_config = $opts{'testbeds'} || "./testbeds"; # testbed configurations |
---|
| 484 | $local_script_dir = $opts{'scriptdir'}; # Local scripts |
---|
[e5fee75] | 485 | $muxmax = $opts{'muxlimit'} || 3; # Number of connections muxed on one |
---|
| 486 | # gateway |
---|
[3c7da22] | 487 | |
---|
[e863014] | 488 | $max_children = $opts{'p'} || $opts{'maxchildren'} |
---|
| 489 | if $opts{'p'} || $opts{'maxchildren'}; |
---|
| 490 | |
---|
[3c7da22] | 491 | $smb_share = $opts{'smbshare'} || # Share to mount from the master |
---|
| 492 | die "Must give an SMB share\n"; |
---|
| 493 | $project_user = $opts{'smbuser'} || # User to mount project dirs as |
---|
| 494 | die "Must give an SMB user\n"; |
---|
[f3691ff] | 495 | $auth_proj = $opts{'P'}; |
---|
[3c7da22] | 496 | |
---|
[9c00d41] | 497 | # tcl program to split experiments (changed during devel) |
---|
| 498 | $tcl_splitter = $opts{'tclparse'} || "/usr/testbed/lib/ns2ir/parse.tcl"; |
---|
| 499 | # tclsh to call directly (changed during devel) |
---|
| 500 | $tclsh = $opts{'tclsh'} || "/usr/local/bin/otclsh"; |
---|
[2396559e] | 501 | # fedd_client to get testbed access parameters |
---|
| 502 | $fedd_client = $opts{'feddclient'} || "fedd_client"; |
---|
[9c00d41] | 503 | |
---|
| 504 | # Prefix to avoid collisions |
---|
[c23025e] | 505 | $tmpdir .= "/split$$"; |
---|
| 506 | |
---|
[a835df7] | 507 | print "Temp files are in $tmpdir\n" if $verbose; |
---|
[9c00d41] | 508 | # Create a workspace |
---|
[c23025e] | 509 | unless (-d "$tmpdir") { |
---|
| 510 | mkdir("$tmpdir") || die "Can't create $tmpdir: $!"; |
---|
| 511 | } |
---|
| 512 | |
---|
[22bb7f8] | 513 | # If the keys are given, use them. Otherwise create a set under $tmpdir |
---|
| 514 | |
---|
| 515 | if ( $opts{'gatewatpubkey'} && $opts{'gatewaysecretkey'}) { |
---|
| 516 | $gw_pubkey = $opts{'gatewaypubkey'}; |
---|
| 517 | $gw_secretkey = $opts{'gatewaysecretkey'}; |
---|
| 518 | } |
---|
| 519 | else { |
---|
| 520 | $keytype = $opts{'gatewaykeytype'} || "rsa"; |
---|
| 521 | mkdir("$tmpdir/keys") || die "Can't create temoprary key dir: $!\n"; |
---|
| 522 | $gw_pubkey = "$tmpdir/keys/fed.$keytype.pub"; |
---|
| 523 | $gw_secretkey = "$tmpdir/keys/fed.$keytype"; |
---|
| 524 | print "Generating $keytype keys\n" if $verbose; |
---|
| 525 | generate_ssh_keys($keytype, $gw_secretkey) || |
---|
| 526 | die "Cannot generate kets:$@\n"; |
---|
| 527 | } |
---|
| 528 | # Generate the basenames |
---|
| 529 | ($gw_pubkey_base = $gw_pubkey) =~ s#.*/##; |
---|
| 530 | ($gw_secretkey_base = $gw_secretkey) =~ s#.*/##; |
---|
| 531 | |
---|
| 532 | |
---|
| 533 | |
---|
[9c00d41] | 534 | # Validate scripts directory |
---|
[b814529] | 535 | for my $s (@scripts) { |
---|
[63f7c7e] | 536 | die "$local_script_dir/$s not in local script directory. Try -d\n" |
---|
| 537 | unless -r "$local_script_dir/$s"; |
---|
| 538 | } |
---|
[1a8a08a] | 539 | |
---|
| 540 | die "Must supply file, master and experiment" unless $master && $tcl && $eid; |
---|
| 541 | |
---|
[2396559e] | 542 | &parse_testbeds_filename($tb_config, $tbparams) || |
---|
[33548e1] | 543 | die "Cannot testbed congfigurations from $tb_config: $!\n"; |
---|
[1a8a08a] | 544 | |
---|
| 545 | # Open a pipe to the splitter program and start it parsing the experiments |
---|
[5f1cd41] | 546 | my $pipe = new IO::Pipe; |
---|
[2ef2c5b] | 547 | # NB no more -p call on parse call. |
---|
[e5fee75] | 548 | $pipe->reader("$tclsh $tcl_splitter -s -x $muxmax -m $master $pid $gid $eid $tcl") || |
---|
| 549 | die "Cannot execute $tclsh $tcl_splitter -s -x $muxmax -m $master $pid $gid $eid $tcl:$!\n"; |
---|
[1a8a08a] | 550 | |
---|
[b814529] | 551 | # Parsing variables |
---|
[527321c] | 552 | my $ctb; # Current testbed |
---|
| 553 | my %allocated; # If allocated{$tb} > 0, $tb is in use |
---|
| 554 | my $destfile; # File that the sub-experiment tcl file is |
---|
[b814529] | 555 | # being written to, or "" if none. Also used |
---|
| 556 | # for hostnames file. |
---|
[5f1cd41] | 557 | my $desthandle; # File handle for distfile |
---|
[527321c] | 558 | my $gateways; # when gateway lists are being processed this |
---|
[b814529] | 559 | # is the testbed whose gateways are being |
---|
| 560 | # gathered. |
---|
[527321c] | 561 | my $control_gateway; # Control net gateway for the current testbed |
---|
| 562 | my %active_end; # If active_end{"a-b"} > 0 then a is the active |
---|
[b814529] | 563 | # end of the a <-> b connector pair. |
---|
| 564 | |
---|
[9c00d41] | 565 | # Parse the splitter output. This loop creates the sub experiments, gateway |
---|
| 566 | # configurations and hostnames file |
---|
| 567 | while (<$pipe>) { |
---|
[2396559e] | 568 | # Allbeds lists all the testbeds that this experiment accesses. This code |
---|
| 569 | # acquires access to them and pulls in their access parameters from fedd. |
---|
| 570 | (/^#\s+Begin\s+Allbeds/../^#\s+End\s+Allbeds/) && do { |
---|
| 571 | next if /^#/; |
---|
| 572 | chomp; |
---|
| 573 | |
---|
| 574 | my $tb = $_; # Current testbed |
---|
| 575 | # If this testbed has not had its access parameters read from fedd, try |
---|
| 576 | # to read them, if we have a way to talk to fedd |
---|
[f3691ff] | 577 | unless ($tbparams->{$tb}->{'access'} || !$fedd_client) { |
---|
[2396559e] | 578 | my $access_pipe = new IO::Pipe || |
---|
| 579 | die "Can't open pipe to fedd:$!\n"; |
---|
[f3691ff] | 580 | my $proj = $auth_proj ? " -p $auth_proj " : ""; |
---|
[2396559e] | 581 | |
---|
| 582 | print("Checking access to $tb using " . $tbparams->{$tb}->{'uri'} |
---|
| 583 | . "\n") if $verbose; |
---|
| 584 | |
---|
| 585 | my $cmd = "$fedd_client -t " . |
---|
| 586 | $tbparams->{$tb}->{'uri'} . " -T $ENV{HOME}/cacert.pem ". |
---|
[f3691ff] | 587 | "-l $tb $proj | /usr/bin/tee fedd.$tb "; |
---|
[2396559e] | 588 | print "$cmd\n" if $verbose; |
---|
| 589 | |
---|
| 590 | $access_pipe->reader($cmd) || |
---|
| 591 | die "Can't exec fedd_client: $!\n"; |
---|
| 592 | |
---|
| 593 | &parse_testbeds($access_pipe, $tbparams) || |
---|
| 594 | warn("Error reading fedd output: $!\n"); |
---|
| 595 | $access_pipe->close(); |
---|
| 596 | } |
---|
| 597 | next; |
---|
| 598 | }; |
---|
| 599 | |
---|
[1a8a08a] | 600 | # Start of a sub-experiment |
---|
| 601 | /^#\s+Begin\s+Testbed\s+\((\w+)\)/ && do { |
---|
| 602 | $ctb = $1; |
---|
| 603 | |
---|
| 604 | # If we know the testbed, start collecting its sub experiment tcl |
---|
[2396559e] | 605 | # description. If not, warn the user. |
---|
| 606 | if ($tbparams->{$ctb}->{'access'}) { |
---|
[1a8a08a] | 607 | $allocated{$ctb}++; # Keep track of the testbeds allocated |
---|
[c23025e] | 608 | |
---|
| 609 | unless (-d "$tmpdir/$ctb") { |
---|
| 610 | mkdir("$tmpdir/$ctb") || die "Can't create $tmpdir/$ctb: $!"; |
---|
| 611 | } |
---|
| 612 | $destfile = "$tmpdir/$ctb/$eid.$ctb.tcl"; |
---|
[1a8a08a] | 613 | |
---|
[5f1cd41] | 614 | $desthandle = new IO::File(">$destfile") || |
---|
| 615 | die "Cannot open $destfile:$!\n"; |
---|
[1a8a08a] | 616 | } |
---|
[2396559e] | 617 | else{ |
---|
[1a8a08a] | 618 | warn "No such testbed $ctb\n"; |
---|
| 619 | $destfile = ""; |
---|
| 620 | } |
---|
| 621 | next; |
---|
| 622 | }; |
---|
[c23025e] | 623 | |
---|
[1a8a08a] | 624 | # End of that experiment |
---|
| 625 | /^#\s+End\s+Testbed\s+\((\w+)\)/ && do { |
---|
| 626 | # Simple syntax check and close out this experiment's tcl description |
---|
| 627 | die "Mismatched testbed markers ($1, $ctb)\n" unless ($1 eq $ctb); |
---|
[2396559e] | 628 | $desthandle->close() if $desthandle; |
---|
[1a8a08a] | 629 | $destfile = $ctb = ""; |
---|
| 630 | next; |
---|
| 631 | }; |
---|
[c23025e] | 632 | |
---|
| 633 | # Beginning of a gateway set |
---|
| 634 | /^#\s+Begin\s+gateways\s+\((\w+)\)/ && do { |
---|
| 635 | $gateways = $1; |
---|
| 636 | # If we've heard of this tb, create the config lines for it one at a |
---|
| 637 | # time. |
---|
| 638 | if ($allocated{$gateways}) { |
---|
| 639 | # Just in case. This directory should already have been created |
---|
| 640 | # above. |
---|
| 641 | unless (-d "$tmpdir/$gateways") { |
---|
| 642 | mkdir("$tmpdir/$gateways") || |
---|
| 643 | die "Can't create $tmpdir/$gateways: $!"; |
---|
| 644 | } |
---|
| 645 | } |
---|
| 646 | else { |
---|
| 647 | warn "Gateways given (and ignored) for testbed not in use: " . |
---|
| 648 | "$gateways\n"; |
---|
| 649 | $gateways = 0; |
---|
| 650 | } |
---|
| 651 | next; |
---|
| 652 | }; |
---|
[3c7da22] | 653 | # End of the gateways section. Output the client config for this testbed |
---|
[c23025e] | 654 | /^#\s+End\s+gateways\s+\((\w+)\)/ && do { |
---|
| 655 | die "Mismatched gateway markers ($1, $gateways)\n" |
---|
| 656 | unless !$gateways || $gateways == $1; |
---|
[3c7da22] | 657 | |
---|
[e4436a6] | 658 | if ($control_gateway ) { |
---|
[fe459d0] | 659 | # Client config |
---|
[527321c] | 660 | my $cc = new IO::File(">$tmpdir/$gateways/client.conf"); |
---|
[bc01820] | 661 | my $master_project = $tbparams->{$master}->{'project'}; |
---|
[fe459d0] | 662 | die "Can't open $tmpdir/$gateways/client.conf: $!\n" unless $cc; |
---|
| 663 | print $cc "ControlGateway: $control_gateway\n"; |
---|
| 664 | print $cc "SMBShare: $smb_share\n"; |
---|
| 665 | print $cc "ProjectUser: $project_user\n"; |
---|
[bc01820] | 666 | print $cc "ProjectName: $master_project\n"; |
---|
[fe459d0] | 667 | $cc->close(); |
---|
| 668 | } |
---|
[5479c80] | 669 | else { warn "No control gateway for $gateways?\n"; } |
---|
[fe459d0] | 670 | |
---|
[c23025e] | 671 | $gateways = 0; |
---|
| 672 | next; |
---|
| 673 | }; |
---|
[1a8a08a] | 674 | # Beginning of the hostnames list. Collection is always in the hostnames |
---|
| 675 | # file. |
---|
| 676 | /^#\s+Begin\s+hostnames/ && do { |
---|
[c23025e] | 677 | $destfile = "$tmpdir/hostnames"; |
---|
[5f1cd41] | 678 | $desthandle = new IO::File(">$destfile") || |
---|
| 679 | die "Can't open $destfile:$!\n"; |
---|
[1a8a08a] | 680 | next; |
---|
| 681 | }; |
---|
| 682 | # end of the hostnames list. |
---|
| 683 | /^#\s+End\s+hostnames/ && do { |
---|
[5f1cd41] | 684 | $desthandle->close(); |
---|
[1a8a08a] | 685 | $destfile = ""; |
---|
| 686 | next; |
---|
| 687 | }; |
---|
| 688 | |
---|
[c23025e] | 689 | # Generate gateway configuration info, one file per line |
---|
| 690 | $gateways && do { |
---|
| 691 | chomp; |
---|
| 692 | my($dtb, $myname, $desthost, $type) = split(" ", $_); |
---|
[527321c] | 693 | |
---|
| 694 | # Many of these are to simplify print statements |
---|
| 695 | my $sdomain = # domain for the source |
---|
| 696 | $tbparams->{$gateways}->{'domain'}; |
---|
| 697 | my $ddomain = # domain for the destination |
---|
| 698 | $tbparams->{$dtb}->{'domain'}; |
---|
[8034579] | 699 | my $sproject = # Project of the source |
---|
[527321c] | 700 | $tbparams->{$gateways}->{'project'}; |
---|
[8034579] | 701 | my $dproject = # Project of the destination |
---|
| 702 | $tbparams->{$dtb}->{'project'}; |
---|
[527321c] | 703 | my $fs = # Master fs node (FQDN) |
---|
| 704 | $tbparams->{$master}->{'fs'} . $tbparams->{$master}->{'domain'}; |
---|
| 705 | my $boss = # Master boss node (FQDN) |
---|
| 706 | $tbparams->{$master}->{'boss'} . $tbparams->{$master}->{'domain'}; |
---|
[f64fa81] | 707 | my $event_server = # Master event-server (FQDN) |
---|
| 708 | $tbparams->{$master}->{'eventserver'} . |
---|
| 709 | $tbparams->{$master}->{'domain'}; |
---|
[33e3537] | 710 | my $remote_event_server = # Slave event-server (FQDN) |
---|
| 711 | $tbparams->{$dtb}->{'eventserver'} . |
---|
| 712 | $tbparams->{$dtb}->{'domain'}; |
---|
[527321c] | 713 | my $remote_script_dir = # Remote fed script location |
---|
[8034579] | 714 | "/proj/" . $dproject . "/exp/$eid/tmp"; |
---|
| 715 | my $local_script_dir = # Local fed script location |
---|
| 716 | "/proj/" . $sproject . "/exp/$eid/tmp"; |
---|
[527321c] | 717 | my $active; # Is this the active side of |
---|
[b814529] | 718 | # the connector? |
---|
[2396559e] | 719 | my $tunnel_cfg = # Use DETER's config stuff |
---|
| 720 | $tbparams->{$gateways}->{'tun'} || "false"; |
---|
| 721 | |
---|
[c23025e] | 722 | |
---|
[527321c] | 723 | $sdomain = ".$eid." . $tbparams->{$gateways}->{'project'} . "$sdomain"; |
---|
| 724 | $ddomain = ".$eid." . $tbparams->{$dtb}->{'project'} . "$ddomain"; |
---|
[4addf9d] | 725 | |
---|
[527321c] | 726 | my $conf_file = "$myname$sdomain.gw.conf"; |
---|
[8034579] | 727 | my $remote_conf_file = "$desthost$ddomain.gw.conf"; |
---|
[a835df7] | 728 | # translate to lower case so the `hostname` hack for specifying |
---|
| 729 | # configuration files works. |
---|
| 730 | $conf_file =~ tr/A-Z/a-z/; |
---|
[8034579] | 731 | $remote_conf_file =~ tr/A-Z/a-z/; |
---|
[a835df7] | 732 | |
---|
[c23025e] | 733 | # If either end of this link is in the master side of the testbed, that |
---|
| 734 | # side is the active end. Otherwise the first testbed encountered in |
---|
| 735 | # the file will be the active end. The $active_end variable keeps |
---|
| 736 | # track of those decisions |
---|
| 737 | if ( $dtb eq $master ) { $active = "false"; } |
---|
| 738 | elsif ($gateways eq $master ) { $active = "true"; } |
---|
| 739 | elsif ( $active_end{"$dtb-$gateways"} ) { $active="false"; } |
---|
| 740 | else { $active_end{"$gateways-$dtb"}++; $active = "true"; } |
---|
| 741 | |
---|
[3c7da22] | 742 | # This is used to create the client configuration. |
---|
| 743 | $control_gateway = "$myname$sdomain" |
---|
| 744 | if $type =~ /(control|both)/; |
---|
| 745 | |
---|
[c23025e] | 746 | # Write out the file |
---|
[5f1cd41] | 747 | my $gwconfig = new IO::File(">$tmpdir/$gateways/$conf_file")|| |
---|
[a835df7] | 748 | die "can't open $tmpdir/$gateways/$conf_file: $!\n"; |
---|
[321c0cb] | 749 | |
---|
[f70f9c8] | 750 | print $gwconfig "Active: $active\n"; |
---|
[2396559e] | 751 | print $gwconfig "TunnelCfg: $tunnel_cfg\n"; |
---|
[527321c] | 752 | print $gwconfig "BossName: $boss\n"; |
---|
| 753 | print $gwconfig "FsName: $fs\n"; |
---|
[f64fa81] | 754 | print $gwconfig "EventServerName: $event_server\n"; |
---|
[33e3537] | 755 | print $gwconfig "RemoteEventServerName: $remote_event_server\n"; |
---|
[f70f9c8] | 756 | print $gwconfig "Type: $type\n"; |
---|
[527321c] | 757 | print $gwconfig "RemoteScriptDir: $remote_script_dir\n"; |
---|
[8034579] | 758 | print $gwconfig "EventRepeater: $local_script_dir/fed_evrepeater\n"; |
---|
| 759 | print $gwconfig "RemoteExperiment: $dproject/$eid\n"; |
---|
| 760 | print $gwconfig "LocalExperiment: $sproject/$eid\n"; |
---|
| 761 | print $gwconfig "RemoteConfigFile: " . |
---|
| 762 | "$remote_script_dir/$remote_conf_file\n"; |
---|
[f70f9c8] | 763 | print $gwconfig "Peer: $desthost$ddomain\n"; |
---|
| 764 | print $gwconfig "Pubkeys: " . |
---|
[9c00d41] | 765 | "/proj/$sproject/exp/$eid/tmp/$gw_pubkey_base\n"; |
---|
[f70f9c8] | 766 | print $gwconfig "Privkeys: " . |
---|
[9c00d41] | 767 | "/proj/$sproject/exp/$eid/tmp/$gw_secretkey_base\n"; |
---|
[f70f9c8] | 768 | $gwconfig->close(); |
---|
[c23025e] | 769 | |
---|
[9c00d41] | 770 | # This testbed has a gateway (most will) so make a copy of the keys it |
---|
| 771 | # needs in this testbed's subdirectory. start_segment will transfer |
---|
| 772 | # them. |
---|
| 773 | unless (-r "$tmpdir/$gateways/$gw_pubkey_base" ) { |
---|
| 774 | copy($gw_pubkey, "$tmpdir/$gateways/$gw_pubkey_base") || |
---|
| 775 | die "Can't copy pubkeys ($gw_pubkey to " . |
---|
| 776 | "$tmpdir/$gateways/$gw_pubkey_base): $!\n"; |
---|
| 777 | } |
---|
| 778 | if ($active eq "true" ) { |
---|
| 779 | unless (-r "$tmpdir/$gateways/$gw_secretkey_base" ) { |
---|
| 780 | copy($gw_secretkey, "$tmpdir/$gateways/$gw_secretkey_base") || |
---|
| 781 | die "Can't copy secret keys ($gw_secretkey to " . |
---|
| 782 | "$tmpdir/$gateways/$gw_secretkey_base): $!\n"; |
---|
| 783 | } |
---|
| 784 | } |
---|
| 785 | |
---|
[c23025e] | 786 | #done processing gateway entry, ready for next line |
---|
| 787 | next; |
---|
| 788 | }; |
---|
[2ef2c5b] | 789 | (/^#\s+Begin\s+tarfiles/../^#\s+End\s+tarfiles/) && do { |
---|
| 790 | next if /^#/; |
---|
| 791 | chomp; |
---|
| 792 | push(@tarfiles, $_); |
---|
| 793 | next; |
---|
| 794 | }; |
---|
[e2a71ebe] | 795 | (/^#\s+Begin\s+rpms/../^#\s+End\s+rpms/) && do { |
---|
| 796 | next if /^#/; |
---|
| 797 | chomp; |
---|
| 798 | push(@rpms, $_); |
---|
| 799 | next; |
---|
| 800 | }; |
---|
[c23025e] | 801 | |
---|
[1a8a08a] | 802 | next unless $destfile; # Unidentified testbed, ignore config |
---|
[527321c] | 803 | # local copies that can be used in the substitutions below |
---|
[2396559e] | 804 | my $gwtype = $tbparams->{$ctb}->{'gwtype'} || $def_gwtype; |
---|
| 805 | my $gwimage = $tbparams->{$ctb}->{'gwimage'} || $def_gwimage; |
---|
| 806 | my $mgwstart = $tbparams->{$ctb}->{'mgwstart'} || $def_mgwstart; |
---|
| 807 | my $mexpstart = $tbparams->{$ctb}->{'mexpstart'} || $def_mexpstart; |
---|
| 808 | my $gwstart = $tbparams->{$ctb}->{'gwstart'} || $def_gwstart; |
---|
| 809 | my $expstart = $tbparams->{$ctb}->{'expstart'} || $def_expstart; |
---|
[527321c] | 810 | my $project = $tbparams->{$ctb}->{'project'}; |
---|
[1a8a08a] | 811 | |
---|
| 812 | # Substitute variables |
---|
[527321c] | 813 | s/GWTYPE/$gwtype/g; |
---|
| 814 | s/GWIMAGE/$gwimage/g; |
---|
[1a8a08a] | 815 | if ($ctb eq $master ) { |
---|
[527321c] | 816 | s/GWSTART/$mgwstart/g; |
---|
| 817 | s/EXPSTART/$mexpstart/g; |
---|
[1a8a08a] | 818 | } |
---|
| 819 | else { |
---|
[527321c] | 820 | s/GWSTART/$gwstart/g; |
---|
| 821 | s/EXPSTART/$expstart/g; |
---|
[1a8a08a] | 822 | } |
---|
[4addf9d] | 823 | # XXX: oh is this bad |
---|
| 824 | s#GWCONF#FEDDIR\`hostname\`.gw.conf#g; |
---|
[527321c] | 825 | s#PROJDIR#/proj/$project/#g; |
---|
[b68f597] | 826 | s#EID#$eid#g; |
---|
[527321c] | 827 | s#FEDDIR#/proj/$project/exp/$eid/tmp/#g; |
---|
[5f1cd41] | 828 | print $desthandle $_; |
---|
[1a8a08a] | 829 | } |
---|
[9c00d41] | 830 | $pipe->close(); |
---|
[1a8a08a] | 831 | die "No nodes in master testbed ($master)\n" unless $allocated{$master}; |
---|
| 832 | |
---|
[e2a71ebe] | 833 | # Copy tarfiles and rpms needed at remote sites to the staging directories. |
---|
| 834 | # Start_segment will distribute them |
---|
[b814529] | 835 | for my $t (@tarfiles) { |
---|
[2ef2c5b] | 836 | die "tarfile '$t' unreadable: $!\n" unless -r $t; |
---|
[b68f597] | 837 | unless (-d "$tmpdir/tarfiles") { |
---|
| 838 | mkdir("$tmpdir/tarfiles") || |
---|
| 839 | die "Can't create $tmpdir/tarfiles:$!\n"; |
---|
[2ef2c5b] | 840 | } |
---|
[b68f597] | 841 | copy($t, "$tmpdir/tarfiles") || |
---|
| 842 | die "Can't copy $t to $tmpdir/tarfiles:$!\n"; |
---|
[2ef2c5b] | 843 | } |
---|
| 844 | |
---|
[e2a71ebe] | 845 | for my $r (@rpms) { |
---|
| 846 | die "rpm '$r' unreadable: $!\n" unless -r $r; |
---|
| 847 | unless (-d "$tmpdir/rpms") { |
---|
| 848 | mkdir("$tmpdir/rpms") || |
---|
| 849 | die "Can't create $tmpdir/rpms:$!\n"; |
---|
| 850 | } |
---|
| 851 | copy($r, "$tmpdir/rpms") || |
---|
| 852 | die "Can't copy $r to $tmpdir/rpms:$!\n"; |
---|
| 853 | } |
---|
| 854 | |
---|
[1a8a08a] | 855 | exit(0) unless $startem; |
---|
| 856 | |
---|
[527321c] | 857 | my %started; # If $started{$tb} then $tb successfully started |
---|
[e863014] | 858 | my %child; # If $child{$pid} then a process with that pid is |
---|
| 859 | # working on a starting a segment |
---|
| 860 | my $nworking = 0; # Number of children working on swapin |
---|
| 861 | my $pid; # Scratch variable for pids |
---|
[b814529] | 862 | |
---|
[1a8a08a] | 863 | # Start up the slave sub-experiments first |
---|
| 864 | TESTBED: |
---|
[b814529] | 865 | for my $tb (keys %allocated) { |
---|
[e863014] | 866 | if ( $tb ne $master ) { |
---|
| 867 | while ( $nworking == $max_children ) { |
---|
| 868 | print "Waiting for a child process to complete\n" if $verbose; |
---|
| 869 | if (($pid = wait()) != -1 ) { |
---|
| 870 | # The $? >> 8 is the exit code of the subprocess, which is |
---|
| 871 | # non-zero if the &start_segment routine failed. |
---|
| 872 | my $exit_code = ($? >> 8); |
---|
| 873 | |
---|
| 874 | print "Child $pid completed exit code ($exit_code)\n" |
---|
| 875 | if $verbose; |
---|
| 876 | $nworking--; |
---|
| 877 | $started{$child{$pid}}++ unless $exit_code; |
---|
| 878 | if ($child{$pid} ) { delete $child{$pid}; } |
---|
| 879 | else { warn "Reaped a pid we did not start?? ($pid)\n"; } |
---|
| 880 | last TESTBED if $exit_code; |
---|
| 881 | } |
---|
| 882 | else { warn "wait returned without reaping: $!\n"; } |
---|
| 883 | } |
---|
| 884 | if ( $pid = fork() ) { |
---|
| 885 | # Parent process |
---|
| 886 | $nworking ++; |
---|
| 887 | $child{$pid} = $tb; |
---|
| 888 | print "Started process $pid to start testbed $tb\n" |
---|
| 889 | if $verbose; |
---|
| 890 | } |
---|
| 891 | else { |
---|
| 892 | # Child. Note that we reverse the sense of the return code when it |
---|
| 893 | # becomes an exit value. Zero exit values indicate success. |
---|
| 894 | exit(!&start_segment($tb, $eid, $tbparams, $timeout)); |
---|
| 895 | } |
---|
| 896 | } |
---|
| 897 | } |
---|
| 898 | |
---|
| 899 | # Now wait for any still running processes. |
---|
| 900 | while ( $nworking ) { |
---|
| 901 | print "Waiting for a child process to complete ($nworking running)\n" |
---|
| 902 | if $verbose; |
---|
| 903 | if (($pid = wait()) != -1 ) { |
---|
| 904 | # The $? >> 8 is the exit code of the subprocess, which is |
---|
| 905 | # non-zero if the &start_segment routine failed. |
---|
| 906 | my $exit_code = ($? >> 8); |
---|
| 907 | |
---|
| 908 | print "Child $pid completed exit code ($exit_code)\n" |
---|
| 909 | if $verbose; |
---|
| 910 | $nworking--; |
---|
| 911 | $started{$child{$pid}}++ unless $exit_code; |
---|
| 912 | if ($child{$pid} ) { delete $child{$pid}; } |
---|
| 913 | else { warn "Reaped a pid we did not start?? ($pid)\n"; } |
---|
[1a8a08a] | 914 | } |
---|
[e863014] | 915 | else { warn "wait returned without reaping: $!\n"; } |
---|
[1a8a08a] | 916 | } |
---|
| 917 | |
---|
| 918 | # Now the master |
---|
[5479c80] | 919 | if (&start_segment($master, $eid, $tbparams, $timeout)) { |
---|
[1a8a08a] | 920 | $started{$master}++; |
---|
| 921 | } |
---|
| 922 | |
---|
| 923 | # If any testbed failed, swap the rest out. |
---|
[637adfa] | 924 | if ( !$fail_soft && scalar(keys %started) != scalar(keys %allocated)) { |
---|
[527321c] | 925 | for my $tb (keys %started) { &stop_segment($tb, $eid, $tbparams); } |
---|
[1a8a08a] | 926 | print "Error starting experiment\n"; |
---|
| 927 | exit(1); |
---|
| 928 | } |
---|
| 929 | print "Experiment started\n"; |
---|
[a835df7] | 930 | print "Deleting $tmpdir (-d to leave them in place)\n" if $verbose && !$debug; |
---|
[9c00d41] | 931 | system("rm -rf $tmpdir") unless $debug; |
---|
[1a8a08a] | 932 | exit(0); # set the exit value |
---|
| 933 | |
---|
| 934 | =pod |
---|
| 935 | |
---|
| 936 | =head1 NAME |
---|
| 937 | |
---|
| 938 | B<splitter.pl> |
---|
| 939 | |
---|
| 940 | =head1 SYNOPSIS |
---|
| 941 | |
---|
[637adfa] | 942 | B<splitter.pl> [B<-ndF>] [B<-t> I<secs>] [B<-c> F<config_file>] |
---|
[e863014] | 943 | [B<-f> F<experiment_tcl>] [B<-p> I<max_procs>] [F<experiment_tcl>] |
---|
[1a8a08a] | 944 | |
---|
| 945 | =head1 DESCRIPTION |
---|
| 946 | |
---|
| 947 | B<splitter.pl> invokes the DETER experiment parser to split an annotated |
---|
| 948 | experiment into multiple sub-experments and instantiates the sub-experiments on |
---|
| 949 | their intended testbeds. Annotation is accomplished using the |
---|
| 950 | tb-set-node-testbed command, added to the parser. |
---|
| 951 | |
---|
[5f1cd41] | 952 | Much of the script's behavior depends on the configuration file, specified with |
---|
| 953 | the B<-c> flag and defaulting to F<./splitter.conf>. |
---|
| 954 | |
---|
| 955 | The testbed labels supplied in the B<tb-set-node-testbed> command are |
---|
| 956 | meaningful based on their presence in the testbeds file. that file can be |
---|
| 957 | specified in the configuration file using the B<Testbeds> directive, and |
---|
| 958 | defaults to F<./testbeds>. The syntax is described below. |
---|
[9c00d41] | 959 | |
---|
| 960 | Most of the intermediate files are staged in a sub-directory of a temporary |
---|
| 961 | files directory and deleted at the end of the script. Specifying the B<-d> |
---|
| 962 | flag on the command line avoids the deletion for debbugging. By default the |
---|
| 963 | temporary files directory is directory is F</tmp> and can be reset in the |
---|
| 964 | configuration file using the B<Tmpdir> directive. Intermediate files are |
---|
| 965 | stored under a subdirectory formed by adding the process ID of the splitter |
---|
| 966 | process. For example, if the temporary files directory is F</tmp> and the |
---|
| 967 | B<splitter.pl> process ID is 2323, the temporary files will be stored in |
---|
| 968 | F</tmp/split2323/>. |
---|
[1a8a08a] | 969 | |
---|
| 970 | The expreriment is split out into one experiment description per testbed in the |
---|
[9c00d41] | 971 | temporary directory named as F<experiment.testbed.tcl> where the experiment is |
---|
| 972 | the experiment ID given in the configuration file, and the testbed is the |
---|
| 973 | tb-set-node-testbed parameter for the nodes in the file. |
---|
[1a8a08a] | 974 | |
---|
| 975 | If the B<-n> option is absent the sub-experiments are then instantiated on |
---|
| 976 | their testbeds. (Here B<-n> is analogous to its use in L<make(1)>). |
---|
[9c00d41] | 977 | Per-testbed parameters are set in the testbeds file. Sub-experiments on |
---|
[1a8a08a] | 978 | slave testbeds are instantiated in a random order, but the master testbed is |
---|
| 979 | currently instantiated last. |
---|
| 980 | |
---|
[e863014] | 981 | Slave testbeds can be swapped in in parallel by specifying the B<-p> parameter |
---|
| 982 | and the maximum number of simultaneous processes to start. |
---|
| 983 | |
---|
[9c00d41] | 984 | Scripts to start federation (the federation kit) are copied into the local |
---|
| 985 | experiment's tmp file - e.g., F</proj/DETER/exp/simple-split/tmp>. These are |
---|
| 986 | taken from the directory given by the B<ScriptDir> directive in the |
---|
| 987 | configuration file. |
---|
[63f7c7e] | 988 | |
---|
[637adfa] | 989 | If B<-t> is given the parameter is treated as a parameter to B<Timeout> in |
---|
| 990 | F<splitter.conf>. |
---|
| 991 | |
---|
[1a8a08a] | 992 | If any sub-experiment fails to instantiate, the other sub-exeriments are |
---|
[637adfa] | 993 | swapped out. B<-F> avoids this swap out, which can also be specified as |
---|
| 994 | B<SoftFail: true> in F<splitter.conf> |
---|
[1a8a08a] | 995 | |
---|
[9c00d41] | 996 | =head2 Configuration File |
---|
| 997 | |
---|
[5f1cd41] | 998 | The configuration file is a simple set of colon-separated parameters and |
---|
| 999 | values. A configuration file must be present, either specified in the B<-c> |
---|
| 1000 | flag or the default F<./splitter.conf>. All the parameter names are case |
---|
| 1001 | insensitive, but should not include any whitespace. Parameter values may |
---|
| 1002 | include whitespace, but no newlines. |
---|
[9c00d41] | 1003 | |
---|
| 1004 | Possible parameters are: |
---|
| 1005 | |
---|
| 1006 | =over 5 |
---|
| 1007 | |
---|
| 1008 | =item Experiment |
---|
| 1009 | |
---|
| 1010 | The name of the experiment on the various testbeds |
---|
| 1011 | |
---|
| 1012 | =item Master |
---|
| 1013 | |
---|
| 1014 | The master testbed label from the testbeds file, described below. |
---|
| 1015 | |
---|
| 1016 | =item Testbeds |
---|
| 1017 | |
---|
| 1018 | The testbeds file described below, giving per-testbed parameters. If this |
---|
| 1019 | directive is absent the testbeds file defaults to F<./testbeds> |
---|
| 1020 | |
---|
| 1021 | =item ScriptDir |
---|
| 1022 | |
---|
| 1023 | Location of the default federation scripts, i.e. the federation kit. |
---|
| 1024 | |
---|
| 1025 | =item GatewayPubkey |
---|
| 1026 | |
---|
| 1027 | =item GatewaySecretKey |
---|
| 1028 | |
---|
| 1029 | The names of the files containing secret and public keys to use in setting up |
---|
[22bb7f8] | 1030 | tunnels between testbeds. If given they are used, otherwise keys are generated. |
---|
| 1031 | |
---|
| 1032 | =item GatewayKeyType |
---|
| 1033 | |
---|
| 1034 | This controls the kind of SSH keys generated to configure the geatways. If |
---|
| 1035 | given this must be B<dsa> or B<rsa>, and it defaults to B<rsa>. The parameter |
---|
| 1036 | is csase insensitive. |
---|
[9c00d41] | 1037 | |
---|
| 1038 | =item TmpDir |
---|
| 1039 | |
---|
| 1040 | =item TempDir |
---|
| 1041 | |
---|
| 1042 | The directory where temporary files are created. These are synonyms, but |
---|
| 1043 | should both be specified, B<TmpDir> has priority. If neither is specified, |
---|
| 1044 | F</tmp> is used. |
---|
| 1045 | |
---|
[3c7da22] | 1046 | =item SMBShare |
---|
| 1047 | |
---|
| 1048 | The SMB share on the master testbed that will be exported to remote clients. |
---|
| 1049 | |
---|
| 1050 | =item SMBUser |
---|
| 1051 | |
---|
| 1052 | The experiment user to mount project directories as. This user needs to be a |
---|
| 1053 | member of the exported experiment - that is one of the users in the project |
---|
| 1054 | containing this experiment on the master testbed. |
---|
| 1055 | |
---|
[637adfa] | 1056 | =item Timeout |
---|
| 1057 | |
---|
| 1058 | Value in seconds after which a swap-in operatioin will be considered a success. |
---|
| 1059 | Often long swap-ins will hang when there are partial failures. This works |
---|
[8412883] | 1060 | around this issue. (This behavior can be requested on the command line by |
---|
| 1061 | specifying B<-t> I<secs>.) |
---|
[637adfa] | 1062 | |
---|
| 1063 | =item FailSoft |
---|
| 1064 | |
---|
[8412883] | 1065 | If not set, failure of any sub experiment swaps the rest out. Setting this to |
---|
| 1066 | any value avoids this swap out. (This behavior can be requested on the command |
---|
| 1067 | line by specifying B<-F>.) |
---|
[637adfa] | 1068 | |
---|
[e5fee75] | 1069 | =item MuxLimit |
---|
| 1070 | |
---|
| 1071 | The maximum bumber of links/lans carried by one gateway pair |
---|
| 1072 | |
---|
| 1073 | =item Tclparse |
---|
| 1074 | |
---|
| 1075 | The pathname to the experiment parsing program. Only developers should set |
---|
| 1076 | this. |
---|
| 1077 | |
---|
| 1078 | =item Tclsh |
---|
| 1079 | |
---|
| 1080 | The pathname to the local oTcl shell. Only developers should set |
---|
| 1081 | this. |
---|
| 1082 | |
---|
[9c00d41] | 1083 | =back |
---|
| 1084 | |
---|
| 1085 | =head2 Testbeds file |
---|
[1a8a08a] | 1086 | |
---|
[33548e1] | 1087 | The configuration file (F<./testbeds> unless overridden by B<-c>) is a file of |
---|
| 1088 | scoped attribute-value pairs where each attribute is specified on a separate |
---|
| 1089 | line of the configuration file. Each testbed's parameters are preceeded by the |
---|
| 1090 | testbed label in brackets ([]) on a line by itself. After that the parameters |
---|
| 1091 | are specified as parameter: value. This is essentially the same format as the |
---|
| 1092 | configuration file. Parameters are: |
---|
[5f1cd41] | 1093 | |
---|
| 1094 | =over 4 |
---|
| 1095 | |
---|
| 1096 | =item User |
---|
| 1097 | |
---|
| 1098 | The user under which to make requests to this testbed. The user running |
---|
| 1099 | B<splitter.pl> must be able to authenicate as this user under L<ssh(1)> to this |
---|
| 1100 | testbed. |
---|
| 1101 | |
---|
| 1102 | =item OpsNode |
---|
| 1103 | |
---|
| 1104 | The host name of the testbed's ops node. The user calling B<splitter.pl> must |
---|
| 1105 | be able to execute commands on this host via L<ssh(1)>. |
---|
| 1106 | |
---|
| 1107 | =item Domain |
---|
| 1108 | |
---|
| 1109 | The domain of nodes in this testbed (including the ops host). This parameter |
---|
| 1110 | should always start with a period. |
---|
| 1111 | |
---|
| 1112 | =item Project |
---|
| 1113 | |
---|
| 1114 | The project under which to instantiate sub-experiments on this testbed. |
---|
| 1115 | |
---|
| 1116 | =item ConnectorType |
---|
| 1117 | |
---|
| 1118 | The node type for inter-testbed connector nodes on this testbed. |
---|
| 1119 | |
---|
| 1120 | =item SlaveNodeStartCmd |
---|
| 1121 | |
---|
| 1122 | The start command to run on experimental nodes when this testbed is used as a |
---|
[8412883] | 1123 | slave. In all the start commands the following string substitutions are made: |
---|
| 1124 | |
---|
| 1125 | =over 10 |
---|
| 1126 | |
---|
| 1127 | =item FEDDIR |
---|
| 1128 | |
---|
| 1129 | The local experiment's federation scripts directory. Each local experiment |
---|
| 1130 | will have this replaced by the scripts directory on its local boss. |
---|
| 1131 | |
---|
| 1132 | =item GWCONF |
---|
| 1133 | |
---|
| 1134 | The full pathname of the gateway configuration file. As with FEDDIR, this is |
---|
| 1135 | on the local boss. |
---|
| 1136 | |
---|
| 1137 | =item PROJDIR |
---|
| 1138 | |
---|
| 1139 | The project directory on the local boss. |
---|
| 1140 | |
---|
| 1141 | =item EID |
---|
| 1142 | |
---|
| 1143 | The local experiment name. |
---|
| 1144 | |
---|
| 1145 | =back |
---|
| 1146 | |
---|
| 1147 | All startcmds specified in F<testbeds> undergo these expansions. |
---|
[5f1cd41] | 1148 | |
---|
| 1149 | =item SlaveConnectorStartCmd |
---|
| 1150 | |
---|
| 1151 | The start command to run on gateway nodes when this testbed is used as a slave. |
---|
[8412883] | 1152 | The same string substitutions are made in this command as in SlaveNodeStartCmd. |
---|
[5f1cd41] | 1153 | |
---|
| 1154 | =item MasterNodeStartCmd |
---|
| 1155 | |
---|
| 1156 | The start command to run on experimental nodes when this testbed is used as a |
---|
| 1157 | master. The same string substitutions are made in this command as in |
---|
[8412883] | 1158 | SlaveNodeStartCmd. |
---|
[5f1cd41] | 1159 | |
---|
| 1160 | =item MasterConnectorStartCmd |
---|
| 1161 | |
---|
| 1162 | The start command to run on gateway nodes when this testbed is used as a |
---|
| 1163 | master. The same string substitutions are made in this command as in |
---|
[8412883] | 1164 | SlaveNodeStartCmd. |
---|
[5f1cd41] | 1165 | |
---|
| 1166 | =item ConnectorImage |
---|
| 1167 | |
---|
| 1168 | The disk image to be loaded on a gateway node on this testbed. |
---|
| 1169 | |
---|
| 1170 | =item FileServer |
---|
| 1171 | |
---|
| 1172 | The node in the master testbed from which filesystems are mounted. |
---|
| 1173 | |
---|
| 1174 | =item Boss |
---|
| 1175 | |
---|
| 1176 | The node in the master testbed that controls the testbed. |
---|
| 1177 | |
---|
| 1178 | =item TunnelCfg |
---|
| 1179 | |
---|
| 1180 | True if the connector needs to do DETER federation. This parameter will |
---|
| 1181 | probably be removed. |
---|
| 1182 | |
---|
| 1183 | |
---|
| 1184 | =back |
---|
| 1185 | |
---|
[1a8a08a] | 1186 | =head1 ENVIRONMENT |
---|
| 1187 | |
---|
| 1188 | B<splitter.pl> does not directly make use of environment variables, but calls |
---|
| 1189 | out to L<ssh(1)> and (indirectly) to L<sh(1)>, which may be influenced by the |
---|
| 1190 | environment. |
---|
| 1191 | |
---|
[8412883] | 1192 | =head1 BUGS |
---|
| 1193 | |
---|
| 1194 | A deprecated B<-N> flag was used to select testbeds file format. Only one |
---|
| 1195 | format is supported now, and B<-N> generates a warning, but otherwise does not |
---|
| 1196 | affect B<splitter.pl>. |
---|
| 1197 | |
---|
[1a8a08a] | 1198 | =head1 SEE ALSO |
---|
| 1199 | |
---|
| 1200 | L<sh(1)>, L<ssh(1)> |
---|
| 1201 | |
---|
| 1202 | =cut |
---|