[Bio] / FigCommon / setup-sge.pl Repository:
ViewVC logotype

Annotation of /FigCommon/setup-sge.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : olson 1.1 #
2 : olson 1.2 # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 :     #
19 : olson 1.1 # Configure the SGE install for this machine.
20 :     #
21 :     # We copy the SGE directory from the common runtime
22 :     # directory to the directory FIGdisk/gendb/SGE so that
23 :     # we can have a custom installation as part of the build
24 :     # (this should help in the configuration of the system
25 :     # if one copies a figdisk from one machine to another).
26 :     #
27 :    
28 :     use FIG_Config;
29 :     use FIG;
30 :    
31 :     my $root = "$FIG_Config::fig_disk/gendb/SGE";
32 :    
33 :     my $cell = "default";
34 :    
35 :     if (-d "$root/$cell")
36 :     {
37 :     die "It appears that SGE is already configured in $root.\n";
38 :     }
39 :    
40 :     my $sge_src = "$FIG_Config::common_runtime/sge";
41 :     if (! -d $sge_src)
42 :     {
43 :     die "Cannot find SGE source directory $sge_src\n";
44 :     }
45 :    
46 :    
47 :     &FIG::verify_dir($root);
48 :     my $rc = system("cd $sge_src; tar cf - . | (cd $root; tar xfp -)");
49 :     if ($rc != 0)
50 :     {
51 :     die "Copy of sge from $FIG_Config::common_runtime/sge failed\n";
52 :     }
53 :    
54 :     #
55 :     # Just use these defaults for now.
56 :     my %replacements = (ROOT => $root,
57 :     QMASTER_PORT => 10111,
58 :     EXECD_PORT => 10112,
59 :     CELL_NAME => $cell,
60 :     GID_RANGE=> '20000-20100',
61 :     ADMIN_HOSTS => "localhost",
62 :     SUBMIT_HOSTS => "localhost",
63 :     EXEC_HOSTS => "localhost",
64 :     );
65 :    
66 :     my $conf = "$root/SGE_Config";
67 :     open(CONF, ">$conf") or die "Cannot open $conf for writing: $!\n";
68 :    
69 :     while (<DATA>)
70 :     {
71 :     my $k, $v;
72 :     while (($k, $v) = each(%replacements))
73 :     {
74 :     s/\@$k\@/$v/g;
75 :     }
76 :     print CONF $_;
77 :     }
78 :     close(DATA);
79 :     close(CONF);
80 :    
81 :     chdir($root) or die "Cannot chdir $root: $!\n";
82 :    
83 :     my $inst = "$root/inst_sge";
84 :    
85 :     -x $inst or die "Cannot execute $inst\n";
86 :    
87 :     $rc = system($inst, qw(-m -x -auto ./SGE_Config));
88 :    
89 :     if ($rc != 0)
90 :     {
91 :     die "$inst failed\n";
92 :     }
93 :     print "SGE setup to $root succeeded\n";
94 :    
95 :    
96 :     __DATA__
97 :     #-------------------------------------------------
98 :     # SGE default configuration file
99 :     #-------------------------------------------------
100 :    
101 :     # Use always fully qualified pathnames, please
102 :    
103 :     # SGE_ROOT Path, this is basic information
104 :     #(mandatory for qmaster and execd installation)
105 :     SGE_ROOT=@ROOT@
106 :    
107 :     # SGE_QMASTER_PORT is used by qmaster for communication
108 :     # Please enter the port in this way: 1300
109 :     # Please do not this: 1300/tcp
110 :     #(mandatory for qmaster installation)
111 :     SGE_QMASTER_PORT=@QMASTER_PORT@
112 :    
113 :     # SGE_EXECD_PORT is used by execd for communication
114 :     # Please enter the port in this way: 1300
115 :     # Please do not this: 1300/tcp
116 :     #(mandatory for qmaster installation)
117 :     SGE_EXECD_PORT=@EXECD_PORT@
118 :    
119 :     # CELL_NAME, will be a dir in SGE_ROOT, contains the common dir
120 :     # Please enter only the name of the cell. No path, please
121 :     #(mandatory for qmaster and execd installation)
122 :     CELL_NAME="@CELL_NAME@"
123 :    
124 :     # The dir, where qmaster spools this parts, which are not spooled by DB
125 :     #(mandatory for qmaster installation)
126 :     QMASTER_SPOOL_DIR=$SGE_ROOT/$CELL_NAME/spool/qmaster
127 :    
128 :     # The dir, where the execd spools (active jobs)
129 :     # This entry is needed, even if your are going to use
130 :     # berkeley db spooling. Only cluster configuration and jobs will
131 :     # be spooled in the database. The execution daemon still needs a spool
132 :     # directory
133 :     #(mandatory for qmaster installation)
134 :     EXECD_SPOOL_DIR=$SGE_ROOT/$CELL_NAME/spool
135 :    
136 :     # For monitoring and accounting of jobs, every job will get
137 :     # unique GID. So you have to enter a free GID Range, which
138 :     # is assigned to each job running on a machine.
139 :     # If you want to run 100 Jobs at the same time on one host you
140 :     # have to enter a GID-Range like that: 16000-16100
141 :     #(mandatory for qmaster installation)
142 :     GID_RANGE=@GID_RANGE@
143 :    
144 :     # If SGE is compiled with -spool-dynamic, you have to enter here, which
145 :     # spooling method should be used. (classic or berkeleydb)
146 :     #(mandatory for qmaster installation)
147 :     SPOOLING_METHOD="berkeleydb"
148 :    
149 :     # Name of the Server, where the Spooling DB is running on
150 :     # if spooling methode is berkeleydb, it must be "none", when
151 :     # using no spooling server and it must containe the servername
152 :     # if a server should be used. In case of "classic" spooling,
153 :     # can be left out
154 :     DB_SPOOLING_SERVER="none"
155 :    
156 :     # The dir, where the DB spools
157 :     # If berkeley db spooling is used, it must contain the path to
158 :     # the spooling db. Please enter the full path. (eg. /tmp/data/spooldb)
159 :     # Remember, this directory must be local on the qmaster host or on the
160 :     # Berkeley DB Server host. No NSF mount, please
161 :     DB_SPOOLING_DIR=$SGE_ROOT/$CELL_NAME/spool/spooldb
162 :    
163 :     # A List of Host which should become admin hosts
164 :     # If you do not enter any host here, you have to add all of your hosts
165 :     # by hand, after the installation. The autoinstallation works without
166 :     # any entry
167 :     ADMIN_HOST_LIST="@ADMIN_HOSTS@"
168 :    
169 :     # A List of Host which should become submit hosts
170 :     # If you do not enter any host here, you have to add all of your hosts
171 :     # by hand, after the installation. The autoinstallation works without
172 :     # any entry
173 :     SUBMIT_HOST_LIST="@SUBMIT_HOSTS@"
174 :    
175 :     # A List of Host which should become exec hosts
176 :     # If you do not enter any host here, you have to add all of your hosts
177 :     # by hand, after the installation. The autoinstallation works without
178 :     # any entry
179 :     # (mandatory for execution host installation)
180 :     EXEC_HOST_LIST="@EXEC_HOSTS@"
181 :    
182 :     # The dir, where the execd spools (local configuration)
183 :     # If you want configure your execution daemons to spool in
184 :     # a local directory, you have to enter this directory here.
185 :     # If you do not want to configure a local execution host spool directory
186 :     # please leave this empty
187 :     EXECD_SPOOL_DIR_LOCAL="$SGE_ROOT/$CELL_NAME/spool"
188 :    
189 :     # If true, the domainnames will be ignored, during the hostname resolving
190 :     # if false, the fully qualified domain name will be used for name resolving
191 :     HOSTNAME_RESOLVING="true"
192 :    
193 :     # Shell, which should be used for remote installation (rsh/ssh)
194 :     # This is only supported, if your hosts and rshd/sshd is configured,
195 :     # not to ask for a password, or promting any message.
196 :     SHELL_NAME="ssh"
197 :    
198 :     # Enter your default domain, if you are using /etc/hosts or NIS configuration
199 :     DEFAULT_DOMAIN="none"
200 :    
201 :     # If a job stops, fails, finnish, you can send a mail to this adress
202 :     ADMIN_MAIL="none"
203 :    
204 :     # If true, the rc scripts (sgemaster, sgeexecd, sgebdb) will be added,
205 :     # to start automatically during boottime
206 :     ADD_TO_RC="false"
207 :    
208 :     #If this is "true" the file permissions of executables will be set to 755
209 :     #and of ordenary file to 644.
210 :     SET_FILE_PERMS="true"
211 :    
212 :     # This option is not implemented, yet.
213 :     # When a exechost should be uninstalled, the running jobs will be rescheduled
214 :     RESCHEDULE_JOBS="wait"
215 :    
216 :     # Enter a one of the three distributed scheduler tuning configuration sets
217 :     # (1=normal, 2=high, 3=max)
218 :     SCHEDD_CONF="1"
219 :    
220 :     # The name of the shadow host. This host must have read/write permission
221 :     # to the qmaster spool directory
222 :     # If you want to setup a shadow host, you must enter the servername
223 :     # (mandatory for shadowhost installation)
224 :     SHADOW_HOST="none"
225 :    
226 :     # Remove this execution hosts in automatic mode
227 :     # (mandatory for unistallation of execution hosts)
228 :     EXEC_HOST_LIST_RM="localhost"
229 :    
230 :     # This option is used for startup script removing.
231 :     # If true, all rc startup scripts will be removed during
232 :     # automatic deinstallation. If false, the scripts won't
233 :     # be touched.
234 :     # (mandatory for unistallation of execution/qmaster hosts)
235 :     REMOVE_RC="false"

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3