Commit 25f8387f authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

standaloneJob.pl creates a standalone Worker

parent dc769b3a
......@@ -26,6 +26,7 @@ use warnings;
use Bio::EnsEMBL::Hive::AnalysisJob;
use Bio::EnsEMBL::Hive::GuestProcess;
use Bio::EnsEMBL::Hive::HivePipeline;
use Bio::EnsEMBL::Hive::Queen;
use Bio::EnsEMBL::Hive::Utils ('load_file_or_module', 'destringify');
use Bio::EnsEMBL::Hive::Utils::PCL;
......@@ -33,12 +34,29 @@ use Bio::EnsEMBL::Hive::Utils::PCL;
sub standaloneJob {
my ($module_or_file, $input_id, $flags, $flow_into, $language) = @_;
my $worker = Bio::EnsEMBL::Hive::Queen->create_new_worker(
# Worker control parameters:
#-job_limit => $job_limit,
#-life_span => $life_span,
-no_cleanup => $flags->{no_cleanup},
-no_write => $flags->{no_write},
#-worker_log_dir => $worker_log_dir,
#-hive_log_dir => $hive_log_dir,
#-retry_throwing_jobs => $retry_throwing_jobs,
#-can_respecialize => $can_respecialize,
# Other parameters:
-debug => $flags->{debug},
);
my $runnable_module = $language ? 'Bio::EnsEMBL::Hive::GuestProcess' : load_file_or_module( $module_or_file );
my $runnable_object = $runnable_module->new($flags->{debug}, $language, $module_or_file); # Only GuestProcess will read the arguments
die "Runnable $module_or_file not created\n" unless $runnable_object;
$runnable_object->execute_writes(not $flags->{no_write});
$runnable_object->worker($worker);
my $hive_pipeline = Bio::EnsEMBL::Hive::HivePipeline->new();
......
......@@ -410,6 +410,11 @@ sub get_stderr_redirector {
sub worker_say {
my ($self, $msg) = @_;
unless ($self->adaptor) {
print "Standalone worker $$ : $msg\n";
return;
}
my $worker_id = $self->dbID();
my $current_role = $self->current_role;
my $job_id = $self->runnable_object && $self->runnable_object->input_job && $self->runnable_object->input_job->dbID;
......
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