|
@@ -15,22 +15,22 @@
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
################################################################################
|
|
|
|
|
|
-package Regress::RoxieConfig;
|
|
|
+package Regress::EclPublish;
|
|
|
|
|
|
=pod
|
|
|
|
|
|
=head1 NAME
|
|
|
-
|
|
|
-Regress::RoxieConfig - perl module used by runregress to execute roxieconfig
|
|
|
+
|
|
|
+Regress::EclPublish - perl module used by runregress to execute ecl publish
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
-my $submit = Regress::RoxieConfig->new($opts);
|
|
|
+my $submit = Regress::EclPublish->new($opts);
|
|
|
|
|
|
$submit->submit($run);
|
|
|
|
|
|
=cut
|
|
|
-
|
|
|
+
|
|
|
use strict;
|
|
|
use warnings;
|
|
|
use File::Spec::Functions qw(splitpath);
|
|
@@ -49,9 +49,9 @@ our @ISA = qw(Exporter);
|
|
|
|
|
|
=pod
|
|
|
|
|
|
-=item my $submit = Regress::RoxieConfig->new(%options);
|
|
|
+=item my $submit = Regress::EclPublish->new(%options);
|
|
|
|
|
|
-Takes a hash of options obtained from a L<Regress::Engine> object. Returns an object used to execute roxieconfig.
|
|
|
+Takes a hash of options obtained from a L<Regress::Engine> object. Returns an object used to execute ecl publish.
|
|
|
|
|
|
=cut
|
|
|
|
|
@@ -67,7 +67,7 @@ sub new($$)
|
|
|
|
|
|
=item $submit->submit($run, $seq);
|
|
|
|
|
|
-Runs roxieconfig to submit a query. Takes a hash as passed to L<Regress::Engine::note_to_run>, and a sequence number. Calls L<Regress::Engine::note_done_run> when completed, passing the run hash and the WUID if known.
|
|
|
+Runs ecl publish to submit a query. Takes a hash as passed to L<Regress::Engine::note_to_run>, and a sequence number. Calls L<Regress::Engine::note_done_run> when completed, passing the run hash and the WUID if known.
|
|
|
|
|
|
=cut
|
|
|
|
|
@@ -75,22 +75,20 @@ sub submit($$)
|
|
|
{
|
|
|
my ($self, $run, $seq) = @_;
|
|
|
my $tmpout = "$run->{outpath}.tmp";
|
|
|
+ my (undef, undef, $basename) = splitpath($run->{path});
|
|
|
+ $basename =~ s/\.ecl//i;
|
|
|
$self->{seqpaths}->{$seq} = {outpath => $run->{outpath}, tmppath => $tmpout, postfilter => $run->{postfilter}};
|
|
|
|
|
|
my @commands;
|
|
|
if($self->{deploy_roxie_queries} eq 'run')
|
|
|
{
|
|
|
- my %vals = (name => $run->{path},
|
|
|
- user => $self->{owner},
|
|
|
- password => $self->{password},
|
|
|
- roxieconfigaddress => $self->{roxieconfig},
|
|
|
- makeActive => 1,
|
|
|
- -noCache => 1,
|
|
|
- ImportAllModules => 0,
|
|
|
- ImportImplicitModules => 0,
|
|
|
- logAction => 0);
|
|
|
- my $args = ["RunECLFile", map("$_=$vals{$_}", sort(keys(%vals)))];
|
|
|
- push(@commands, {command => $self->{roxieconfigcmd} || $self->{engine}->executable_name('roxieconfig'),
|
|
|
+ my %vals = ('--username' => $self->{owner},
|
|
|
+ '--password' => $self->{password},
|
|
|
+ '--cluster' => $self->{cluster},
|
|
|
+ '--name' => $basename
|
|
|
+ );
|
|
|
+ my $args = ["run", "$run->{path}", map("$_=$vals{$_}", sort(keys(%vals)))];
|
|
|
+ push(@commands, {command => $self->{eclcmd} || $self->{engine}->executable_name('ecl'),
|
|
|
args => $args,
|
|
|
output => $tmpout,
|
|
|
done_callback => sub { $self->_on_complete(@_); },
|
|
@@ -100,23 +98,18 @@ sub submit($$)
|
|
|
{
|
|
|
if($self->{deploy_roxie_queries} eq 'yes')
|
|
|
{
|
|
|
- my %vals = (name => $run->{path},
|
|
|
- user => $self->{owner},
|
|
|
- password => $self->{password},
|
|
|
- roxieconfigaddress => $self->{roxieconfig},
|
|
|
- -noCache => 1,
|
|
|
- ImportAllModules => 0,
|
|
|
- ImportImplicitModules => 0,
|
|
|
- makeActive => 1);
|
|
|
- my $args = ["DeployECLFile", map("$_=$vals{$_}", sort(keys(%vals)))];
|
|
|
- push(@commands, {command => $self->{roxieconfigcmd} || $self->{engine}->executable_name('roxieconfig'),
|
|
|
+ my %vals = ('--username' => $self->{owner},
|
|
|
+ '--password' => $self->{password},
|
|
|
+ '--cluster' => $self->{cluster},
|
|
|
+ '--name' => $basename
|
|
|
+ );
|
|
|
+ my $args = ["publish", "$run->{path}", "--activate", map("$_=$vals{$_}", sort(keys(%vals)))];
|
|
|
+ push(@commands, {command => $self->{eclcmd} || $self->{engine}->executable_name('ecl'),
|
|
|
args => $args,
|
|
|
output => sub { $self->_scan_for_wuid($seq, @_); },
|
|
|
done_callback => sub { $self->_report_deployed(@_); },
|
|
|
seq => $seq});
|
|
|
}
|
|
|
- my (undef, undef, $basename) = splitpath($run->{path});
|
|
|
- $basename =~ s/\.ecl//i;
|
|
|
my $args;
|
|
|
if (-e $run->{queryxmlpath})
|
|
|
{
|
|
@@ -150,14 +143,14 @@ sub _report_deployed($$$$)
|
|
|
my $deployout = $self->{deployout}->{$seq};
|
|
|
if($deployout)
|
|
|
{
|
|
|
- $self->{engine}->log_write("roxieconfig output was: [" . join("\n", @{$deployout}) . "]");
|
|
|
+ $self->{engine}->log_write("ecl publish output was: [" . join("\n", @{$deployout}) . "]");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $self->{engine}->log_write("roxieconfig produced no output");
|
|
|
+ $self->{engine}->log_write("ecl publish produced no output");
|
|
|
}
|
|
|
$self->{engine}->note_done_run($seq);
|
|
|
- #MORE: need to decide what to do here: as written, will get missing output; could write roxieconfig output, but would not match in case where failure expected (if there are any)
|
|
|
+ #MORE: need to decide what to do here: as written, will get missing output; could write ecl publish output, but would not match in case where failure expected (if there are any)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -181,7 +174,7 @@ sub _scan_for_wuid($$$)
|
|
|
{
|
|
|
my ($self, $seq, $line) = @_;
|
|
|
$line =~ s/[\r\n]+$//;
|
|
|
- $self->{engine}->log_write("roxieconfig output: [$line]", !$self->{engine}->{verbose});
|
|
|
+ $self->{engine}->log_write("ecl command output: [$line]", !$self->{engine}->{verbose});
|
|
|
push(@{$self->{deployout}->{$seq}}, $line);
|
|
|
return if($self->{wuids}->{$seq});
|
|
|
return unless($line =~ /(W[\d-]+)/);
|
|
@@ -195,5 +188,4 @@ sub _scan_for_wuid($$$)
|
|
|
|
|
|
=cut
|
|
|
|
|
|
-1;
|
|
|
-
|
|
|
+1;
|