5 use JSON qw(encode_json);
7 # Finding out own path in order to reference own components (including own modules):
11 $ENV{
'EHIVE_ROOT_DIR'} ||= File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) );
12 unshift @INC, $ENV{
'EHIVE_ROOT_DIR'}.
'/modules';
15 use Getopt::Long qw(:config pass_through no_auto_abbrev);
33 # connection parameters
34 'url=s' => \$self->{
'url'},
35 'reg_conf|reg_file=s' => \$self->{
'reg_conf'},
36 'reg_type=s' => \$self->{
'reg_type'},
37 'reg_alias|reg_name=s' => \$self->{
'reg_alias'},
38 'nosqlvc' => \$self->{
'nosqlvc'}, #
using "nosqlvc" instead of
"sqlvc!" for consistency with scripts where it is a propagated option
39 'json' => \$self->{
'json'},
40 'tweak|SET=s@' => \$tweaks,
41 'DELETE=s' => sub { my ($opt_name, $opt_value) = @_; push @$tweaks, $opt_value.
'#'; },
42 'SHOW=s' => sub { my ($opt_name, $opt_value) = @_; push @$tweaks, $opt_value.
'?'; },
44 'h|help' => \$self->{
'help'},
45 ) or die
"\nERROR: in command line arguments\n";
48 die
"\nERROR: There are invalid arguments on the command-line: ". join(
" ", @ARGV).
"\n";
52 pod2usage({-exitvalue => 0, -verbose => 2});
57 if($self->{
'url'} or $self->{
'reg_alias'}) {
59 -url => $self->{
'url'},
60 -reg_conf => $self->{
'reg_conf'},
61 -reg_type => $self->{
'reg_type'},
62 -reg_alias => $self->{
'reg_alias'},
63 -no_sql_schema_version_check => $self->{
'nosqlvc'},
67 die
"\nERROR: Connection parameters (url or reg_conf+reg_alias) need to be specified\n";
70 my ($need_write, $msg_list_ref, $response_structure) = $pipeline->apply_tweaks( $tweaks );
72 $response_structure->{URL} = $self->{
'url'};
73 my $json = JSON->new->allow_nonref;
75 print $self->{
'json'} ? $json->encode($response_structure) : join(
'', @$msg_list_ref);
77 $pipeline->hive_dba()->dbc->requires_write_access();
78 $pipeline->save_collections();
95 tweak_pipeline.pl [ -url mysql:
99 This is a script to
"tweak" attributes or parameters of an existing eHive pipeline.
107 URL defining where eHive database is located
109 =item --reg_conf <path>
111 path to a Registry configuration file
113 =item --reg_type <name>
115 Registry type of the eHive DBAdaptor
117 =item --reg_alias <name>
119 species/alias name
for the eHive DBAdaptor
123 "No SQL Version Check" - set
if you want to force working with a database created by a potentially schema-incompatible API
125 =item --tweak <string>
127 An assignment command that performs one individual
"tweak". You can
"tweak" global/Analysis parameters, Analysis attributes and Resource Classes:
129 -tweak
'pipeline.param[take_time]=20' #
override a value of a pipeline-wide parameter; can also create a non-existent parameter
130 -tweak
'analysis[take_b_apart].param[base]=10' #
override a value of an Analysis-wide parameter; can also create a non-existent parameter
131 -tweak
'analysis[add_together].analysis_capacity=undef' #
override a value of an Analysis attribute
132 -tweak
'analysis[add_together].batch_size=15' #
override a value of an Analysis_stats attribute
133 -tweak
'analysis[part_multiply].resource_class=urgent' # set the Resource Class of an Analysis (whether a Resource Class with
this name existed or not)
134 -tweak
'resource_class[urgent].LSF=-q yesteryear' # update or create a
new Resource Description
136 If multiple
"tweaks" are requested, they will be performed in the given order.
138 =item --DELETE <selector>
140 Shortcut to
delete a parameter
142 =item --SHOW <selector>
144 Shortcut to show a parameter value
150 See the NOTICE file distributed with
this work
for additional information
151 regarding copyright ownership.
153 Licensed under the Apache License, Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
154 You may obtain a copy of the License at
158 Unless required by applicable law or agreed to in writing, software distributed under the License
159 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160 See the License
for the specific language governing permissions and limitations under the License.
164 Please subscribe to the eHive mailing list: http: