1cook_rsh(1)                 General Commands Manual                cook_rsh(1)
2
3
4

NAME

6       cook_rsh - load balancing rsh
7

SYNOPSIS

9       cook_rsh [ option...  ] architecture command [ argument...  ]
10       cook_rsh -Help
11

DESCRIPTION

13       The  cook_rsh program is a wrapper around rsh(1) which does simple load
14       balancing.  It obtains its load information by running the rup(1)  com‐
15       mand,  and selects the most suitable host hased on the architecture you
16       specify, and the least load of all hosts of that architecture.
17
18       The first command line argument is the architecture name which is  used
19       to  get  the list of possible hosts.  From that list the rup(1) command
20       is run to determine the host with the lowest load,  which  is  in  turn
21       used as the first argument of the eventual rsh(1) command.
22

COOKBOOKS

24       In  order  to make use of this program, somewhere in your cookbook, you
25       need to add a line which reads
26              parallel_rsh = "cook_rsh";
27       If the host chosen is the same as the caller  (build  host)  then  this
28       program just exec the command skipping the rsh.  So it costs nothing to
29       use this in a one machine network!
30
31       For each recipe you want distributed to a remote host, you need to  add
32       a  host-binding  attribute to.  Typical usage is where you have a muti-
33       architecture build.
34              %1/%0%.o: %0%.c
35                  host-binding %1 {
36                  cc -o [target] -c [resolve %0%.c]; }
37       In the recipe given here, each architecture has its object files placed
38       into a separate architecture-specific directory tree.  The architecture
39       name (%1) is used in the host-binding, so  that  the  compiles  may  be
40       load-balanced to all machines of that architecture.
41
42       If  you  need  a command to run on a specific host (say, because that's
43       where a specific application license resides), then simply use the host
44       name in the host-binding attribute, rather than an architecture name.
45

DEFINING THE CLASSES

47       The  /host_lists.pl  file is expected to exist, and to contain variable
48       definitions used to determine if hosts are members of particular archi‐
49       tectures.
50
51       The  /host_lists.pl file defines a perl HOL "hash of lists" The hash is
52       %ArchNames and it maps names of architectures as user want to see them,
53       to list references as the actual lists are stored.
54
55       The  names of each architecture could be any form you wish but the con‐
56       vention is to use the GNUish names such as "sparc-sun-solaris2.8".
57
58       For each architecture, define one or more lists of  machines  according
59       to  what function each machine set may do.  This can be as simple or as
60       elaborate as required.  The form of the list variable name can  be  any
61       valid  perl  identifier  but  may as well be like the architecture name
62       with dash changed to underbar and dot removed, and the type added.  For
63       example one might define solaris hosts as:
64              @sparc_sun_solaris28_hosts = (
65                 "mickey", "minny", "scrooge" );
66       And linux hosts as:
67              @i386_linux22_hosts = (
68                 "goofy", "scrooge" );
69
70       If  there  is a need to define different sets of machines for different
71       types of jobs then add a suffix  to  the  names  in  the   host-binding
72       directive on each of the recipes, and lists here with the same suffix.
73
74       The hash to map argument names to lists is defined like:
75              %ArchNames = (
76                "sparc-solaris2.8",     => @sparc_solaris28_hosts,
77                "i586-unknown-linux22", => @i386_linux22_hosts, );
78
79       Of  course if users have differing opinions as to what the architecture
80       names should look like, you can define "alias" mappings as well.
81                "sun4-SunOS-5.8",       => @sparc_solaris28_hosts,
82       Or maybe the level is of no importance, then define
83                "sparc-solaris",        => @sparc_solaris28_hosts,
84                "sparc-solaris2.7",     => @sparc_solaris28_hosts,
85       Also, this list isn't allowed to be empty.
86
87       And finally, curtesy of Perl, the last line of the file must read
88              1; for obscure and magical reasons.
89

SYSLOG LOGGING

91       Typical commands seen during a build would look like
92              sh   -c   'cd    /aegis/dd/gumby2.2.C079    &&    \    sh    -ce
93              /aegis/dd/gumby2.2.C079/.6.1;       \       echo       $?      >
94              /aegis/dd/gumby2.2.C079/.6.2'
95       So we can extract the project/ change from the command quite easily and
96       logging it via syslog would be a trivial addition.
97

OPTIONS

99       This command is not usually given any options.
100
101       -h      Help - show usage info
102
103       -vP     Verbose - report choice
104
105       -Tn     Trace value for testing
106

FILES

108       /exclude.hosts
109               This  file is used to list those host which must not be used by
110               this script.  Simply list excuded hosts, one hostname per line.
111               If  the  file  is  absent,  all hosts reported by rup(1) may be
112               used.
113
114       /host_lists.pl
115               This file defines the classes of hosts for each architecture.
116

AUTHOR

118       Jerry Pendergraft <jerry@endocardial.com>
119
120
121
122Reference Manual                     Cook                          cook_rsh(1)
Impressum