Skip to content

Commit 341ba14

Browse files
committed
Merge remote-tracking branch 'origin/relationalai' into relationalai-20231201
2 parents 499edd8 + 1180136 commit 341ba14

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/lib/Hydra/Controller/JobsetEval.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,13 @@ sub all_builds : Chained('evalChain') PathPart('builds') Args(0) {
195195
);
196196
}
197197

198+
sub finished : Chained('evalChain') PathPart('finished') Args(0) {
199+
my ($self, $c) = @_;
200+
my $notFinished = $c->stash->{eval}->builds->search({ finished => 0 })->count;
201+
$self->status_ok(
202+
$c,
203+
entity => $notFinished == 0 ? 1 : 0,
204+
);
205+
}
198206

199207
1;

src/lib/Hydra/Plugin/RunCommand.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,18 @@ sub _buildFinished {
279279

280280
sub buildFinished {
281281
my ($self, $topbuild, $dependents) = @_;
282+
283+
284+
# tracking builds we have triggered, as for failed jobs, original build can be in dependents
285+
my @builds = ();
282286
foreach my $build ($topbuild, @{$dependents}) {
283-
_buildFinished($self, $build)
287+
my $id = $build->id;
288+
if (grep(/^$id/, @builds)) {
289+
print STDERR "Skipped $id, already triggered.\n";
290+
} else {
291+
_buildFinished($self, $build);
292+
push(@builds, $id);
293+
}
284294
}
285295
}
286296

src/script/hydra-notify

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ while (!$queued_only) {
129129
my $channelName = $message->{"channel"};
130130
my $pid = $message->{"pid"};
131131
my $payload = $message->{"payload"};
132+
print STDERR "Received: $channelName = [$payload]\n";
132133

133134
$prom->inc("notify_event", { channel => $channelName });
134135

0 commit comments

Comments
 (0)