Commit 3be7a1d4 authored by Leo Gordon's avatar Leo Gordon
Browse files

moving Ensembl-specific configuration from HiveGeneric_conf into...

moving Ensembl-specific configuration from HiveGeneric_conf into EnsemblGeneric_conf. Make sure you inherit from the right one!
parent ff7450de
=pod
=head1 NAME
Bio::EnsEMBL::Hive::PipeConfig::EnsemblGeneric_conf
=head1 DESCRIPTION
Generic configuration module for all Ensembl-derived pipelines.
It extends HiveGeneric_conf with specifically Ensembl things (knows about the release number, for instance).
So if your pipeline has anything to do with Ensembl API/schema, please inherit (directly or not) your config from this file.
=head1 LICENSE
Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
=head1 CONTACT
Please subscribe to the Hive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss Hive-related questions or to be notified of our updates
=cut
package Bio::EnsEMBL::Hive::PipeConfig::EnsemblGeneric_conf;
use strict;
use warnings;
use Bio::EnsEMBL::ApiVersion ();
use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf');
=head2 default_options
Description : Interface method that should return a hash of option_name->default_option_value pairs.
Please see existing PipeConfig modules for examples.
=cut
sub default_options {
my ($self) = @_;
return {
%{ $self->SUPER::default_options() }, # inherit from parent
# Please note: ENVironment variables may be "exported" to inherit from enclosing shell,
# but if you want to *prevent* that you need to specifically say so
# (setting a password to empty string does exactly that - sets it to an empty string)
#
# [bash] export -n ENSEMBL_CVS_ROOT_DIR # will stop exporting, but the value in current shell stays as it was
# [tcsh] unsetenv ENSEMBL_CVS_ROOT_DIR # will destroy the variable even in current shell, and stop exporting
'ensembl_cvs_root_dir' => $ENV{'ENSEMBL_CVS_ROOT_DIR'} || $self->o('ensembl_cvs_root_dir'), # it will make sense to set this variable if you are going to use ehive with ensembl
'ensembl_release' => Bio::EnsEMBL::ApiVersion::software_version(), # snapshot of EnsEMBL Core API version. Please do not change if not sure.
'rel_suffix' => '', # an empty string by default, a letter otherwise
'rel_with_suffix' => $self->o('ensembl_release').$self->o('rel_suffix'),
'user' => 'ensadmin',
'password' => $ENV{'ENSADMIN_PSW'} // $self->o('password'), # people will have to make an effort NOT to insert it into config files like .bashrc etc
'dbowner' => $ENV{'USER'} // $self->o('dbowner'), # although it is very unlikely $ENV{USER} is not set
'pipeline_name' => $self->pipeline_name(),
'pipeline_db' => {
-driver => $self->o('hive_driver'),
-host => $self->o('host'),
-port => $self->o('port'),
-user => $self->o('user'),
-pass => $self->o('password'),
-dbname => $self->o('dbowner').'_'.$self->o('pipeline_name').'_'.$self->o('rel_with_suffix'), # example of a linked definition (resolved via saturation)
},
};
}
=head2 pipeline_wide_parameters
Description : Interface method that should return a hash of pipeline_wide_parameter_name->pipeline_wide_parameter_value pairs.
The value doesn't have to be a scalar, can be any Perl structure now (will be stringified and de-stringified automagically).
Please see existing PipeConfig modules for examples.
=cut
sub pipeline_wide_parameters {
my ($self) = @_;
return {
%{ $self->SUPER::pipeline_wide_parameters() }, # inherit from parent
'schema_version' => $self->o('ensembl_release'), # keep compatibility with core API
};
}
1;
......@@ -60,8 +60,6 @@ package Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf;
use strict;
use warnings;
use Bio::EnsEMBL::ApiVersion ();
use Bio::EnsEMBL::Hive::Utils::URL;
use Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::DBSQL::SqlSchemaAdaptor;
......@@ -87,27 +85,16 @@ use base ('Bio::EnsEMBL::Hive::DependentOptions');
sub default_options {
my ($self) = @_;
return {
# Please note: ENVironment variables may be "exported" to inherit from enclosing shell,
# but if you want to *prevent* that you need to specifically say so
# (setting a password to empty string does exactly that - sets it to an empty string)
#
# [bash] export -n ENSEMBL_CVS_ROOT_DIR # will stop exporting, but the value in current shell stays as it was
# [tcsh] unsetenv ENSEMBL_CVS_ROOT_DIR # will destroy the variable even in current shell, and stop exporting
'ensembl_cvs_root_dir' => $ENV{'ENSEMBL_CVS_ROOT_DIR'} || $self->o('ensembl_cvs_root_dir'), # it will make sense to set this variable if you are going to use ehive with ensembl
'ensembl_release' => Bio::EnsEMBL::ApiVersion::software_version(), # snapshot of EnsEMBL Core API version. Please do not change if not sure.
'hive_root_dir' => $ENV{'EHIVE_ROOT_DIR'} # this value is set up automatically if this code is run by init_pipeline.pl
|| $self->o('ensembl_cvs_root_dir').'/ensembl-hive', # otherwise we have to rely on other means
'hive_root_dir' => $ENV{'EHIVE_ROOT_DIR'}, # this value is set up automatically if this code is run by init_pipeline.pl
'hive_driver' => 'mysql',
'host' => $ENV{'EHIVE_HOST'} || 'localhost', # BEWARE that 'localhost' for mysql driver usually means a UNIX socket, not a TCPIP socket!
# If you need to connect to TCPIP socket, set -host => '127.0.0.1' instead.
'host' => $ENV{'EHIVE_HOST'} || 'localhost', # BEWARE that 'localhost' for mysql driver usually means a UNIX socket, not a TCPIP socket!
# If you need to connect to TCPIP socket, set -host => '127.0.0.1' instead.
'port' => $ENV{'EHIVE_PORT'}, # or remain undef, which means default for the driver
'user' => $ENV{'EHIVE_USER'} || 'ensadmin',
'password' => $ENV{'EHIVE_PASS'} // $ENV{'ENSADMIN_PSW'} // $self->o('password'), # people will have to make an effort NOT to insert it into config files like .bashrc etc
'dbowner' => $ENV{'EHIVE_USER'} || $ENV{'USER'} || $self->o('dbowner'), # although it is very unlikely $ENV{USER} is not set
'port' => $ENV{'EHIVE_PORT'}, # or remain undef, which means default for the driver
'user' => $ENV{'EHIVE_USER'} // $self->o('user'),
'password' => $ENV{'EHIVE_PASS'} // $self->o('password'), # people will have to make an effort NOT to insert it into config files like .bashrc etc
'dbowner' => $ENV{'EHIVE_USER'} || $ENV{'USER'} || $self->o('dbowner'), # although it is very unlikely $ENV{USER} is not set
'pipeline_name' => $self->pipeline_name(),
'hive_use_triggers' => 0, # there have been a few cases of big pipelines misbehaving with triggers on, let's keep the default off.
......@@ -170,7 +157,8 @@ sub pipeline_create_commands {
sub pipeline_wide_parameters {
my ($self) = @_;
return {
'schema_version' => $self->o('ensembl_release'), # keep compatibility with core API
# 'variable1' => 'value1',
# 'variable2' => 'value2',
};
}
......
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