Skip to content

Commit

Permalink
Broken - E2E tests being updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Nov 6, 2024
1 parent 6987a7a commit 089bb5b
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public static IMachineBuilder AddMemoryDataAccess(this IMachineBuilder builder)
builder.Services.AddMemoryDataAccess(o =>
{
o.AddRepository<TranslationEngine>();
o.AddRepository<WordAlignmentEngine>();
o.AddRepository<RWLock>();
o.AddRepository<TrainSegmentPair>();
o.AddRepository<OutboxMessage>();
Expand Down Expand Up @@ -232,6 +233,23 @@ await c.Indexes.CreateOrUpdateAsync(
);
}
);
o.AddRepository<WordAlignmentEngine>(
"word_alignment_engines",
mapSetup: m => m.SetIgnoreExtraElements(true),
init: async c =>
{
await c.Indexes.CreateOrUpdateAsync(
new CreateIndexModel<WordAlignmentEngine>(
Builders<WordAlignmentEngine>.IndexKeys.Ascending(e => e.EngineId)
)
);
await c.Indexes.CreateOrUpdateAsync(
new CreateIndexModel<WordAlignmentEngine>(
Builders<WordAlignmentEngine>.IndexKeys.Ascending(e => e.CurrentBuild!.BuildJobRunner)
)
);
}
);
o.AddRepository<RWLock>("locks");
o.AddRepository<TrainSegmentPair>(
"train_segment_pairs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ private async Task MonitorClearMLTasksPerDomain(IServiceScope scope, Cancellatio
try
{
var translationBuildJobService = scope.ServiceProvider.GetRequiredService<
IBuildJobService<ITrainingEngine>
IBuildJobService<TranslationEngine>
>();
var wordAlignmentBuildJobService = scope.ServiceProvider.GetRequiredService<
IBuildJobService<WordAlignmentEngine>
>();

Dictionary<ITrainingEngine, IBuildJobService<ITrainingEngine>> engineToBuildServiceDict = (
await translationBuildJobService.GetBuildingEnginesAsync(BuildJobRunnerType.ClearML, cancellationToken)
).ToDictionary(e => e, e => translationBuildJobService);
).ToDictionary(e => (ITrainingEngine)e, e => (IBuildJobService<ITrainingEngine>)translationBuildJobService);

foreach (
var engine in await wordAlignmentBuildJobService.GetBuildingEnginesAsync(
Expand Down
Loading

0 comments on commit 089bb5b

Please sign in to comment.