sillsdev / serval

A REST API for natural language processing services
MIT License
4 stars 0 forks source link

Integration & Unit Tests End-To-End Tests codecov

Serval

Serval is a REST API for natural language processing services.

Development

Development in Docker Compose

This is the simplest way to develop. First, git clone the repo:

  git clone https://github.com/sillsdev/serval.git

Then build Serval:

  dotnet build serval

Clone the Machine repo into an adjacent folder to Serval:

  git clone https://github.com/sillsdev/machine.git

Build the Machine repo:

  dotnet build machine

Now, if you are using a local docker image and have a GPU with at least 12 GB of RAM:

In the Serval root, run docker compose up

  cd serval && docker compose up

If using vscode, launch "DockerComb" to debug Serval and the for-testing-only Echo Engine.

Development locally

Alternatively, you can develop without containerizing Serval.

Install MongoDB 6.0 as a replica set run it on localhost:27017. (You can run docker compose -f docker-compose.mongo.yml up from the root of the serval repo to do so).

Make sure that the environment variable ASPNETCORE_ENVIRONMENT is set to "Development" by running export ASPNETCORE_ENVIRONMENT=Development or adding it to your .bashrc.

Open "Serval.sln" and debug the ApiServer.

Deployment on kubernetes

There are 3 different environments that Serval is deployed to:

To update the cluster

Environments:

Debugging

To access Serval API

To view pod logs:

Running the API E2E Tests

In order to run the E2E tests, you will need to have the appropriate credentials

Debugging the S3 bucket

To view files stored in the bucket, run

  aws s3 ls s3://silnlp/<deployment environment>

Mongo debugging

Development Notes

CSharpier

All C# code should be formatted using CSharpier. The best way to enable support for CSharpier is to install the appropriate IDE extension and configure it to format on save.

Coding conventions

Here is a good overview of naming conventions. Here is a good overview of coding conventions. If you want to get in to even more detail, check out the Framework design guidelines.

Documentation

See the Swagger documentation for Serval here.

Special thanks to

BugSnag for error reporting:

bugsnag