From 3c31faf24a0cfbdadcca65db37e6f2acf46062c5 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Thu, 12 Dec 2024 10:07:59 -0500 Subject: [PATCH] Add Serval Architecture --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index a9d6b54b..ce7bba59 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,38 @@ Serval is a REST API for natural language processing services for **all languages**. For the REST documentation use the Swagger site [here](https://prod.serval-api.org/swagger/index.html). +# Serval Architecture + +Serval is designed using a microservice architecture with the following deployments: +* Serval.APIServer + * This is the top level API layer. All REST calls are made through this layer. + * It primarily handles the definition of files and corpora, per-client permissions, validation of requests and assembling NLP requests from files and database entries, such as inserting pretranslations into the USFM structure. + * This includes all components under `./src/Serval/src` except for the auto-generated Client and gRPC projects, which are used to handle communication with the API layer. +* Serval.Machine.EngineServer + * Exposes multiple engine types to the APIServer + * Can be directly invoked by the APIServer + * Handles short-lived NLP requests, including loading SMT models for on-demand word graphs. + * Queues up jobs for the JobServer + * Primary functionality is defined in Serval.Machine.Shared, with the deployment configuration is defined in Serval.Machine.EngineServer + * Reports back status to the APILayer over gRPC +* Serval.Machine.JobServer + * Executes Hangfire NLP jobs + * Queues up ClearML NLP jobs, using the ClearML API and the S3 bucket + * Preprocesses training and inferencing data + * Postprocesses inferencing results and models from the ClearML job + * Primary functionality is defined in Serval.Machine.Shared, with the deployment configuration is defined in Serval.Machine.JobServer + * Reports back status to the APILayer over gRPC +* Echo.EchoTranslationEngine + * The echo engine is for testing both the API layer and the deployment in general. +Other components of the microservice are: +* SIL.DataAccess + * Abstracts all MongoDB operations + * Enables in-memory database for testing purposes + * Replicates the functionality of [EF Core](https://learn.microsoft.com/en-us/ef/core/) +* ServiceToolkit + * Defines common models, configurations and services both used by the Serval.APIServal deployment and the Serval.Machine deployments. + + # Development ## Setting up Your Environment