Commit 11ebc755 authored by Leo Gordon's avatar Leo Gordon
Browse files

more uniform treatment of worker_options

parent cd2723ef
...@@ -91,7 +91,7 @@ sub main { ...@@ -91,7 +91,7 @@ sub main {
'meadow_options|lsf_options=s' => \$meadow_options, # 'lsf_options' is deprecated (please investigate the resource requirements, they may suit your needs way better) 'meadow_options|lsf_options=s' => \$meadow_options, # 'lsf_options' is deprecated (please investigate the resource requirements, they may suit your needs way better)
# worker control # worker control
'jlimit=i' => \$self->{'job_limit'}, 'job_limit|jlimit=i' => \$self->{'job_limit'},
'batch_size=i' => \$self->{'batch_size'}, 'batch_size=i' => \$self->{'batch_size'},
'lifespan=i' => \$self->{'lifespan'}, 'lifespan=i' => \$self->{'lifespan'},
'logic_name=s' => \$self->{'logic_name'}, 'logic_name=s' => \$self->{'logic_name'},
...@@ -322,13 +322,11 @@ sub generate_worker_cmd { ...@@ -322,13 +322,11 @@ sub generate_worker_cmd {
if ($self->{'run_job_id'}) { if ($self->{'run_job_id'}) {
$worker_cmd .= " -job_id ".$self->{'run_job_id'}; $worker_cmd .= " -job_id ".$self->{'run_job_id'};
} else { } else {
$worker_cmd .= (defined($self->{'job_limit'}) ? " -limit $self->{'job_limit'}" : '') foreach my $worker_option ('batch_size', 'job_limit', 'lifespan', 'logic_name', 'maximize_concurrency', 'retry_throwing_jobs', 'hive_output_dir') {
. (defined($self->{'batch_size'}) ? " -batch_size $self->{'batch_size'}" : '') if(defined(my $value = $self->{$worker_option})) {
. (defined($self->{'lifespan'}) ? " -lifespan $self->{'lifespan'}" : '') $worker_cmd .= " -${worker_option} $value";
. (defined($self->{'logic_name'}) ? " -logic_name $self->{'logic_name'}" : '') }
. ($self->{'maximise_concurrency'} ? ' -maximise_concurrency 1' : '') }
. (defined($self->{'retry_throwing_jobs'}) ? " -retry_throwing_jobs $self->{'retry_throwing_jobs'}" : '')
. ($self->{'hive_output_dir'} ? " -hive_output_dir $self->{'hive_output_dir'}" : '');
} }
if ($self->{'reg_file'}) { if ($self->{'reg_file'}) {
...@@ -505,7 +503,7 @@ __DATA__ ...@@ -505,7 +503,7 @@ __DATA__
=head2 Worker control =head2 Worker control
-jlimit <num> : #jobs to run before worker can die naturally -job_limit <num> : #jobs to run before worker can die naturally
-batch_size <num> : #jobs a worker can claim at once -batch_size <num> : #jobs a worker can claim at once
-lifespan <num> : lifespan limit for each worker -lifespan <num> : lifespan limit for each worker
-logic_name <string> : restrict the pipeline stat/runs to this analysis logic_name -logic_name <string> : restrict the pipeline stat/runs to this analysis logic_name
......
...@@ -66,7 +66,7 @@ GetOptions( ...@@ -66,7 +66,7 @@ GetOptions(
'rc_id=i' => \$self->{'rc_id'}, 'rc_id=i' => \$self->{'rc_id'},
'logic_name=s' => \$self->{'logic_name'}, 'logic_name=s' => \$self->{'logic_name'},
'batch_size=i' => \$self->{'batch_size'}, 'batch_size=i' => \$self->{'batch_size'},
'limit=i' => \$self->{'job_limit'}, 'job_limit|limit=i' => \$self->{'job_limit'},
'lifespan=i' => \$self->{'lifespan'}, 'lifespan=i' => \$self->{'lifespan'},
'hive_output_dir|outdir=s' => \$self->{'hive_output_dir'}, # keep compatibility with the old name 'hive_output_dir|outdir=s' => \$self->{'hive_output_dir'}, # keep compatibility with the old name
'bk=s' => \$self->{'beekeeper'}, # deprecated and ignored 'bk=s' => \$self->{'beekeeper'}, # deprecated and ignored
...@@ -295,7 +295,7 @@ __DATA__ ...@@ -295,7 +295,7 @@ __DATA__
-analysis_id <id> : analysis_id in db -analysis_id <id> : analysis_id in db
-logic_name <string> : logic_name of analysis to make this worker -logic_name <string> : logic_name of analysis to make this worker
-batch_size <num> : #jobs to claim at a time -batch_size <num> : #jobs to claim at a time
-limit <num> : #jobs to run before worker can die naturally -job_limit <num> : #jobs to run before worker can die naturally
-lifespan <num> : number of minutes this worker is allowed to run -lifespan <num> : number of minutes this worker is allowed to run
-hive_output_dir <path> : directory where stdout/stderr of the hive is redirected -hive_output_dir <path> : directory where stdout/stderr of the hive is redirected
-bk <string> : beekeeper identifier (deprecated and ignored) -bk <string> : beekeeper identifier (deprecated and ignored)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment