line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HPC::Runner::Command::execute_job::Utils::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
435
|
use MooseX::App::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
5939
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with 'MooseX::Object::Pluggable'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head3 job_plugins |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Load job execution plugins |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
option 'job_plugins' => ( |
15
|
|
|
|
|
|
|
traits => ['Array'], |
16
|
|
|
|
|
|
|
is => 'rw', |
17
|
|
|
|
|
|
|
isa => 'ArrayRef[Str]', |
18
|
|
|
|
|
|
|
documentation => 'Load job execution plugins', |
19
|
|
|
|
|
|
|
cmd_split => qr/,/, |
20
|
|
|
|
|
|
|
required => 0, |
21
|
|
|
|
|
|
|
default => sub { [] }, |
22
|
|
|
|
|
|
|
handles => { |
23
|
|
|
|
|
|
|
has_job_plugins => 'count', |
24
|
|
|
|
|
|
|
join_job_plugins => 'join', |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
option 'job_plugins_opts' => ( |
29
|
|
|
|
|
|
|
is => 'rw', |
30
|
|
|
|
|
|
|
isa => 'HashRef', |
31
|
|
|
|
|
|
|
documentation => 'Options for job_plugins', |
32
|
|
|
|
|
|
|
required => 0, |
33
|
|
|
|
|
|
|
default => sub { {} }, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 Subroutines |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head3 job_load_plugins |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub job_load_plugins { |
43
|
1
|
|
|
1
|
1
|
28
|
my $self = shift; |
44
|
|
|
|
|
|
|
|
45
|
1
|
50
|
|
|
|
74
|
return unless $self->job_plugins; |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
36
|
$self->app_load_plugins( $self->job_plugins ); |
48
|
1
|
|
|
|
|
57
|
$self->parse_plugin_opts( $self->job_plugins_opts ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head3 after *load_plugins |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
After loading the plugins make sure to reload the configs - to get any options we didn't get the first time around |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
after 'job_load_plugins' => sub { |
58
|
|
|
|
|
|
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
if ( $self->has_config_files ) { |
61
|
|
|
|
|
|
|
$self->load_configs; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |