-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Closer to establishing a true Engine-Job-Results pipeline
- Loading branch information
1 parent
dd90aea
commit b131cc4
Showing
26 changed files
with
643 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/Contracts/TranslationBuildStartedDto.cs → ...rval.Shared/Contracts/BuildFinishedDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Contracts/TranslationBuildFinishedDto.cs → ...erval.Shared/Contracts/BuildStartedDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Serval.Shared.Contracts; | ||
|
||
public enum EngineType | ||
{ | ||
Translation, | ||
Assessment, | ||
WordAlignment | ||
} | ||
|
||
public class EngineTypeResolver | ||
{ | ||
public static EngineType GetEngineType(string engineType) | ||
{ | ||
return engineType switch | ||
{ | ||
"SmtTransfer" => EngineType.Translation, | ||
"Nmt" => EngineType.Translation, | ||
"Assessment" => EngineType.Assessment, | ||
"WordAlignment" => EngineType.WordAlignment, | ||
_ => throw new ArgumentException($"Unknown engine type: {engineType}") | ||
}; | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
...red/Contracts/TranslationBuildFinished.cs → ...rc/Serval.Shared/Contracts/JobFinished.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
namespace Serval.Shared.Contracts; | ||
|
||
public record TranslationBuildFinished | ||
public record JobFinished | ||
{ | ||
public required string BuildId { get; init; } | ||
public required string JobId { get; init; } | ||
public required string EngineId { get; init; } | ||
public required string Owner { get; init; } | ||
public required JobState BuildState { get; init; } | ||
public required string Type { get; init; } | ||
public required JobState JobState { get; init; } | ||
public required string Message { get; init; } | ||
public required DateTime DateFinished { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Serval.Shared.Contracts; | ||
|
||
public record JobFinishedDto | ||
{ | ||
public required ResourceLinkDto Job { get; init; } | ||
public required ResourceLinkDto Engine { get; init; } | ||
public required JobState JobState { get; init; } | ||
public required string Message { get; init; } | ||
public required DateTime DateFinished { get; init; } | ||
} |
3 changes: 2 additions & 1 deletion
3
...ared/Contracts/TranslationBuildStarted.cs → ...src/Serval.Shared/Contracts/JobStarted.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
namespace Serval.Shared.Contracts; | ||
|
||
public record TranslationBuildStarted | ||
public record JobStarted | ||
{ | ||
public required string BuildId { get; init; } | ||
public required string EngineId { get; init; } | ||
public required string Owner { get; init; } | ||
public required string Type { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Serval.Shared.Contracts; | ||
|
||
public record JobStartedDto | ||
{ | ||
public required ResourceLinkDto Job { get; init; } | ||
public required ResourceLinkDto Engine { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.