Changeset 5f1cd41


Ignore:
Timestamp:
Sep 22, 2007 10:27:32 PM (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:
45ed8ee
Parents:
527321c
Message:

remove last old-style filehandle, documentation update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/splitter.pl

    r527321c r5f1cd41  
    4848sub parse_config {
    4949    my($file, $href) = @_;
    50     my($fh) = new IO::File($file);
     50    my $fh = new IO::File($file);
    5151       
    5252    unless ($fh) {
     
    5959        chomp;
    6060        /^([^:]+):\s*(.*)/ && do {
    61             my($key) = $1;
     61            my $key = $1;
    6262
    6363            $key =~ tr/A-Z/a-z/;
     
    176176sub ship_scripts {
    177177    my($host, $user, $dest_dir) = @_;       # Where, who, where remotely
    178     my($s);
     178    my $s;
    179179
    180180    &ssh_cmd($user, $host, "mkdir -p $dest_dir");
     
    191191    my($host, $user, $src_dir, $dest_dir) = @_;     # Where, who, where remotely
    192192    my($d, $f);
    193 
    194193
    195194    $d = IO::Dir->new($src_dir) || return 0;
     
    421420else {
    422421    # Read a hash of per-testbed parameters from the local configurations.
    423     my($conf) = new IO::File($tb_config) ||
     422    my $conf = new IO::File($tb_config) ||
    424423        die "can't read testbed configutions from $tb_config: $!\n";
    425424    while (<$conf>) {
     
    450449
    451450# Open a pipe to the splitter program and start it parsing the experiments
    452 my($pipe) = new IO::Pipe;
     451my $pipe = new IO::Pipe;
    453452# NB no more -p call on parse call.
    454453$pipe->reader("$tclsh $tcl_splitter -s -m $master  $pid $gid $eid $tcl") ||
     
    461460                                # being written to, or "" if none.  Also used
    462461                                # for hostnames file.
     462my $desthandle;                 # File handle for distfile
    463463my $gateways;                   # when gateway lists are being processed this
    464464                                # is the testbed whose gateways are being
     
    486486            $destfile = "$tmpdir/$ctb/$eid.$ctb.tcl";
    487487
    488             open(FILE, ">$destfile") || die "Cannot open $destfile:$!\n";
     488            $desthandle = new IO::File(">$destfile") ||
     489                die "Cannot open $destfile:$!\n";
    489490        }
    490491        else {
     
    499500        # Simple syntax check and close out this experiment's tcl description
    500501        die "Mismatched testbed markers ($1, $ctb)\n" unless ($1 eq $ctb);
    501         close(FILE);
     502        $desthandle->close();
    502503        $destfile = $ctb = "";
    503504        next;
     
    547548    /^#\s+Begin\s+hostnames/ && do {
    548549        $destfile = "$tmpdir/hostnames";
    549         open(FILE, ">$destfile") || die "Can't open $destfile:$!\n";
     550        $desthandle = new IO::File(">$destfile") ||
     551            die "Can't open $destfile:$!\n";
    550552        next;
    551553    };
    552554    # end of the hostnames list.
    553555    /^#\s+End\s+hostnames/ && do {
    554         close(FILE);
     556        $desthandle->close();
    555557        $destfile = "";
    556558        next;
     
    600602
    601603        # Write out the file
    602         my($gwconfig) = new IO::File(">$tmpdir/$gateways/$conf_file")||
     604        my $gwconfig = new IO::File(">$tmpdir/$gateways/$conf_file")||
    603605            die "can't open $tmpdir/$gateways/$conf_file: $!\n";
    604606
     
    668670    s#EID#$eid#g;
    669671    s#FEDDIR#/proj/$project/exp/$eid/tmp/#g;
    670     print FILE;
     672    print $desthandle $_;
    671673}
    672674$pipe->close();
     
    730732tb-set-node-testbed command, added to the parser.
    731733
    732 The testbed labels are meaningful based on their presence in the testbeds file.
    733 that file can be specified in the configuration file using the B<Testbeds>
    734 directive, and defaults to F<./testbeds>.  The syntax is described below.
     734Much of the script's behavior depends on the configuration file, specified with
     735the B<-c> flag and defaulting to F<./splitter.conf>.
     736
     737The testbed labels supplied in the B<tb-set-node-testbed> command are
     738meaningful based on their presence in the testbeds file.  that file can be
     739specified in the configuration file using the B<Testbeds> directive, and
     740defaults to F<./testbeds>.  The syntax is described below.
    735741
    736742Most of the intermediate files are staged in a sub-directory of a temporary
     
    765771=head2 Configuration File
    766772
    767 The configuration file is a simple attribute-value pair set of colon-separated
    768 parameters and values.  A configuration file must be present, either specified
    769 in the B<-c> flag or the default F<./splitter.conf>.  All the parameter names
    770 are case insensitive, but should not include any whitespace.  Parameter values
    771 may include whitespace, but no newlines.
     773The configuration file is a simple set of colon-separated parameters and
     774values.  A configuration file must be present, either specified in the B<-c>
     775flag or the default F<./splitter.conf>.  All the parameter names are case
     776insensitive, but should not include any whitespace.  Parameter values may
     777include whitespace, but no newlines.
    772778
    773779Possible parameters are:
     
    854860=item domain
    855861
    856 The domain of nodes in this testbed (including the ops host).
     862The domain of nodes in this testbed (including the ops host).  This parameter
     863should always start with a period.
    857864
    858865=item project
     
    892899The disk image to be loaded on a gateway node on this testbed.
    893900
     901=item filesystem node
     902
     903The node in the master testbed from which filesystems are mounted.
     904
     905=item boss node
     906
     907The node in the master testbed that controls the testbed.
     908
     909=item tunnel configuration
     910
     911True if the connector needs to do DETER federation.  This parameter will
     912probably be removed.
     913
    894914=back
    895915
    896916The parsing of the testbeds is extremely simple.  Colons separate each
    897917field and there is n provision for escaping them at this time.
     918
     919=head2 New Testbeds File Format
     920
     921The testbeds file has ben revamped to make it more human readable.  The
     922parameters are now named and specified on separate lines of the configuration
     923file.  Each testbed's parameters are preceeded by the testbed label in brackets
     924([]) on a line by itself.  After that the parameters are specified as
     925parameter: value.  This is essentially the same format as the configuration
     926file.  Parameters are:
     927
     928=over 4
     929
     930=item User
     931
     932The user under which to make requests to this testbed.  The user running
     933B<splitter.pl> must be able to authenicate as this user under L<ssh(1)> to this
     934testbed.
     935
     936=item OpsNode
     937
     938The host name of the testbed's ops node.  The user calling B<splitter.pl> must
     939be able to execute commands on this host via L<ssh(1)>.
     940
     941=item Domain
     942
     943The domain of nodes in this testbed (including the ops host).  This parameter
     944should always start with a period.
     945
     946=item Project
     947
     948The project under which to instantiate sub-experiments on this testbed.
     949
     950=item ConnectorType
     951
     952The node type for inter-testbed connector nodes on this testbed.
     953
     954=item SlaveNodeStartCmd
     955
     956The start command to run on experimental nodes when this testbed is used as a
     957slave.  In all the start commands the string FEDDIR will be replaced by the
     958local experiment's federation scripts directory and the string GWCONF replaced
     959by the gatway configuration file.
     960
     961=item SlaveConnectorStartCmd
     962
     963The start command to run on gateway nodes when this testbed is used as a slave.
     964The same string substitutions are made in this command as in experiment start.
     965
     966=item MasterNodeStartCmd
     967
     968The start command to run on experimental nodes when this testbed is used as a
     969master.  The same string substitutions are made in this command as in
     970experiment start.
     971
     972=item MasterConnectorStartCmd
     973
     974The start command to run on gateway nodes when this testbed is used as a
     975master.  The same string substitutions are made in this command as in
     976experiment start.
     977
     978=item ConnectorImage
     979
     980The disk image to be loaded on a gateway node on this testbed.
     981
     982=item FileServer
     983
     984The node in the master testbed from which filesystems are mounted.
     985
     986=item Boss
     987
     988The node in the master testbed that controls the testbed.
     989
     990=item TunnelCfg
     991
     992True if the connector needs to do DETER federation.  This parameter will
     993probably be removed.
     994
     995
     996=back
     997
    898998
    899999=head1 ENVIRONMENT
Note: See TracChangeset for help on using the changeset viewer.