1 # Batch EXecutor 2.0 -- Configuration
2 # (c) 2011 Martin Mares <mj@ucw.cz>
9 # This file specifies default values, which can be overridden in BEX.cf
11 # A hash of all known machines and groups
12 # 'name' => { Option => ... } for a machine; options:
13 # Host => 'name' Host name to use in ssh, ping, ...
14 # 'name' => ['a','b','c'] for a group containing specified machines/subgroups
19 # A file whose contents should be prepended before the job. Should start with the "#!" line.
20 our $job_prolog = 'prolog';
22 # A file whose contents should be appended to the job
23 our $job_epilog = 'epilog';
25 # Keep history of successfully completed jobs
26 our $keep_history = 1;
28 # Before we try to connect to a host, ping it to check if it's alive
31 # Whenever we want to run a job on a machine, we must obtain a lock.
32 # Available locking schemes are:
33 # none - no locking takes place (dangerous!)
34 # job - obtain exclusive access to the job, other jobs on the same
35 # host can run in parallel
36 # host - obtain exclusive access to the host, other hosts can run
37 # queue - obtain exclusive access to the whole queue
38 our $locking_scheme = 'host';
40 # Maximum number of simultaneously running jobs in `bprun'
41 our $max_parallel_jobs = 5;
43 # When a job fails, skip all other jobs on the same host
44 # (however, when locking_scheme is set to `job', another instance of `brun'
45 # still could run such jobs in parallel)
46 our $skip_on_fail = 0;
48 # How we run ssh (including options)
49 our $ssh_command = "ssh";
51 # Various utility functions
53 sub parse_machine_list(@);
55 sub parse_machine_list(@) {
59 for my $mm (keys %machines) {
60 if (ref($machines{$mm}) eq 'HASH') {
67 if ($m =~ s{^!}{}) { $op = 0; }
68 my $v = $machines{$m};
70 die "Unknown machine or class: $m\n";
71 } elsif (ref($v) eq 'HASH') {
73 } elsif (ref($v) eq 'ARRAY') {
74 for my $mm (parse_machine_list(@$v)) {
79 return sort grep { $set{$_} } keys %set;
84 return $machines{$mach}->{'Host'} // $mach;