- Timestamp:
- Sep 22, 2007 10:27:32 PM (17 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 45ed8ee
- Parents:
- 527321c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/splitter.pl
r527321c r5f1cd41 48 48 sub parse_config { 49 49 my($file, $href) = @_; 50 my ($fh)= new IO::File($file);50 my $fh = new IO::File($file); 51 51 52 52 unless ($fh) { … … 59 59 chomp; 60 60 /^([^:]+):\s*(.*)/ && do { 61 my ($key)= $1;61 my $key = $1; 62 62 63 63 $key =~ tr/A-Z/a-z/; … … 176 176 sub ship_scripts { 177 177 my($host, $user, $dest_dir) = @_; # Where, who, where remotely 178 my ($s);178 my $s; 179 179 180 180 &ssh_cmd($user, $host, "mkdir -p $dest_dir"); … … 191 191 my($host, $user, $src_dir, $dest_dir) = @_; # Where, who, where remotely 192 192 my($d, $f); 193 194 193 195 194 $d = IO::Dir->new($src_dir) || return 0; … … 421 420 else { 422 421 # 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) || 424 423 die "can't read testbed configutions from $tb_config: $!\n"; 425 424 while (<$conf>) { … … 450 449 451 450 # Open a pipe to the splitter program and start it parsing the experiments 452 my ($pipe)= new IO::Pipe;451 my $pipe = new IO::Pipe; 453 452 # NB no more -p call on parse call. 454 453 $pipe->reader("$tclsh $tcl_splitter -s -m $master $pid $gid $eid $tcl") || … … 461 460 # being written to, or "" if none. Also used 462 461 # for hostnames file. 462 my $desthandle; # File handle for distfile 463 463 my $gateways; # when gateway lists are being processed this 464 464 # is the testbed whose gateways are being … … 486 486 $destfile = "$tmpdir/$ctb/$eid.$ctb.tcl"; 487 487 488 open(FILE, ">$destfile") || die "Cannot open $destfile:$!\n"; 488 $desthandle = new IO::File(">$destfile") || 489 die "Cannot open $destfile:$!\n"; 489 490 } 490 491 else { … … 499 500 # Simple syntax check and close out this experiment's tcl description 500 501 die "Mismatched testbed markers ($1, $ctb)\n" unless ($1 eq $ctb); 501 close(FILE);502 $desthandle->close(); 502 503 $destfile = $ctb = ""; 503 504 next; … … 547 548 /^#\s+Begin\s+hostnames/ && do { 548 549 $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"; 550 552 next; 551 553 }; 552 554 # end of the hostnames list. 553 555 /^#\s+End\s+hostnames/ && do { 554 close(FILE);556 $desthandle->close(); 555 557 $destfile = ""; 556 558 next; … … 600 602 601 603 # Write out the file 602 my ($gwconfig)= new IO::File(">$tmpdir/$gateways/$conf_file")||604 my $gwconfig = new IO::File(">$tmpdir/$gateways/$conf_file")|| 603 605 die "can't open $tmpdir/$gateways/$conf_file: $!\n"; 604 606 … … 668 670 s#EID#$eid#g; 669 671 s#FEDDIR#/proj/$project/exp/$eid/tmp/#g; 670 print FILE;672 print $desthandle $_; 671 673 } 672 674 $pipe->close(); … … 730 732 tb-set-node-testbed command, added to the parser. 731 733 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. 734 Much of the script's behavior depends on the configuration file, specified with 735 the B<-c> flag and defaulting to F<./splitter.conf>. 736 737 The testbed labels supplied in the B<tb-set-node-testbed> command are 738 meaningful based on their presence in the testbeds file. that file can be 739 specified in the configuration file using the B<Testbeds> directive, and 740 defaults to F<./testbeds>. The syntax is described below. 735 741 736 742 Most of the intermediate files are staged in a sub-directory of a temporary … … 765 771 =head2 Configuration File 766 772 767 The configuration file is a simple attribute-value pair set of colon-separated768 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 mayinclude whitespace, but no newlines.773 The configuration file is a simple set of colon-separated parameters and 774 values. A configuration file must be present, either specified in the B<-c> 775 flag or the default F<./splitter.conf>. All the parameter names are case 776 insensitive, but should not include any whitespace. Parameter values may 777 include whitespace, but no newlines. 772 778 773 779 Possible parameters are: … … 854 860 =item domain 855 861 856 The domain of nodes in this testbed (including the ops host). 862 The domain of nodes in this testbed (including the ops host). This parameter 863 should always start with a period. 857 864 858 865 =item project … … 892 899 The disk image to be loaded on a gateway node on this testbed. 893 900 901 =item filesystem node 902 903 The node in the master testbed from which filesystems are mounted. 904 905 =item boss node 906 907 The node in the master testbed that controls the testbed. 908 909 =item tunnel configuration 910 911 True if the connector needs to do DETER federation. This parameter will 912 probably be removed. 913 894 914 =back 895 915 896 916 The parsing of the testbeds is extremely simple. Colons separate each 897 917 field and there is n provision for escaping them at this time. 918 919 =head2 New Testbeds File Format 920 921 The testbeds file has ben revamped to make it more human readable. The 922 parameters are now named and specified on separate lines of the configuration 923 file. 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 925 parameter: value. This is essentially the same format as the configuration 926 file. Parameters are: 927 928 =over 4 929 930 =item User 931 932 The user under which to make requests to this testbed. The user running 933 B<splitter.pl> must be able to authenicate as this user under L<ssh(1)> to this 934 testbed. 935 936 =item OpsNode 937 938 The host name of the testbed's ops node. The user calling B<splitter.pl> must 939 be able to execute commands on this host via L<ssh(1)>. 940 941 =item Domain 942 943 The domain of nodes in this testbed (including the ops host). This parameter 944 should always start with a period. 945 946 =item Project 947 948 The project under which to instantiate sub-experiments on this testbed. 949 950 =item ConnectorType 951 952 The node type for inter-testbed connector nodes on this testbed. 953 954 =item SlaveNodeStartCmd 955 956 The start command to run on experimental nodes when this testbed is used as a 957 slave. In all the start commands the string FEDDIR will be replaced by the 958 local experiment's federation scripts directory and the string GWCONF replaced 959 by the gatway configuration file. 960 961 =item SlaveConnectorStartCmd 962 963 The start command to run on gateway nodes when this testbed is used as a slave. 964 The same string substitutions are made in this command as in experiment start. 965 966 =item MasterNodeStartCmd 967 968 The start command to run on experimental nodes when this testbed is used as a 969 master. The same string substitutions are made in this command as in 970 experiment start. 971 972 =item MasterConnectorStartCmd 973 974 The start command to run on gateway nodes when this testbed is used as a 975 master. The same string substitutions are made in this command as in 976 experiment start. 977 978 =item ConnectorImage 979 980 The disk image to be loaded on a gateway node on this testbed. 981 982 =item FileServer 983 984 The node in the master testbed from which filesystems are mounted. 985 986 =item Boss 987 988 The node in the master testbed that controls the testbed. 989 990 =item TunnelCfg 991 992 True if the connector needs to do DETER federation. This parameter will 993 probably be removed. 994 995 996 =back 997 898 998 899 999 =head1 ENVIRONMENT
Note: See TracChangeset
for help on using the changeset viewer.