13 This is an example pipeline put together from basic building blocks:
15 Analysis_1: JobFactory.pm is used to turn the list of commands in a file into jobs
17 these jobs are sent down the branch #2 into the second analysis
19 Analysis_2: SystemCmd.pm is used to
run these jobs in parallel.
23 See the NOTICE file distributed with
this work
for additional information
24 regarding copyright ownership.
26 Licensed under the Apache License,
Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
27 You may obtain a copy of the License at
31 Unless required by applicable law or agreed to in writing, software distributed under the License
32 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33 See the License
for the specific language governing permissions and limitations under the License.
37 Please subscribe to the
Hive mailing list: http:
42 package Bio::EnsEMBL::Hive::Examples::Factories::PipeConfig::RunListOfCommandsOnFarm_conf;
47 use base (
'Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); # All
Hive databases configuration files should inherit from HiveGeneric, directly or indirectly
49 =head2 default_options
51 Description : Implements default_options()
interface method of
Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf that is used to initialize default options.
52 In addition to the standard things it defines three options:
53 o('capacity') defines how many files can be
run in parallel
55 There are rules dependent on two options that do not have defaults (this makes them mandatory):
56 o('password') your read-write password for creation and maintenance of the hive database
57 o('inputfile') name of the inputfile where the commands are
64 %{ $self->SUPER::default_options() }, # inherit other stuff from the base
class
66 'pipeline_name' =>
'ifile_syscmd', # name used by the beekeeper to prefix job names on the farm
68 'capacity' => 100, # how many commands can be
run in parallel
73 =head2 pipeline_analyses
75 Description : Implements pipeline_analyses()
interface method of
Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf that defines the structure of the pipeline: analyses, jobs, rules, etc.
76 Here it defines two analyses:
78 * 'create_jobs' reads commands line-by-line from inputfile
79 Each job of this analysis will dataflow (create jobs) via branch #2 into 'run_cmd' analysis.
81 * 'run_cmd' actually runs the commands in parallel
85 sub pipeline_analyses {
88 { -logic_name =>
'create_jobs',
89 -module =>
'Bio::EnsEMBL::Hive::RunnableDB::JobFactory',
91 'column_names' => [
'cmd' ],
94 {
'inputfile' => $self->o(
'inputfile') }, # A
new file-with-commands could be loaded at each -topup_jobs execution of init_pipeline
97 2 => [
'run_cmd' ], # will create a fan of jobs
101 { -logic_name =>
'run_cmd',
102 -module =>
'Bio::EnsEMBL::Hive::RunnableDB::SystemCmd',
104 -analysis_capacity => $self->o(
'capacity'), # allow several workers to perform identical tasks in parallel