Serval is a REST API for natural language processing services.
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:
docker build . -t mpy.local
ClearML__Queue
to be the queue that your computer (agent) is listening to
If you will use the standard Machine.py images:ClearML__Queue
and ClearML__DockerImage
to the appropriate valuesIn 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.
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.
There are 3 different environments that Serval is deployed to:
kubectl config use-context dallas-rke
helm install serval-pvc deploy/serval-pvc -n nlp -f deploy/qa-int-values.yaml
helm install serval deploy/serval -n nlp -f deploy/qa-int-values.yaml
kubectl config use-context dallas-stage
helm upgrade serval deploy/serval -n nlp -f deploy/qa-int-values.yaml
kubectl config use-context dallas-rke
helm upgrade serval deploy/serval -n serval -f deploy/qa-ext-values.yaml
kubectl config use-context aws-rke
helm upgrade serval deploy/serval -n serval -f deploy/values.yaml
C:\Windows\System32\drivers\etc\hosts
, enter in a line for 10.3.0.119 serval-api.org
https://machine-api.org/swagger
and accept the security warninghttps://qa.serval-api.org/swagger
and accept the security warningkubectl get pods
to get the currently running podskubectl logs <pod name>
kubectl describe pod <pod name>
to check a stalled pod stuck in containercreatingIn order to run the E2E tests, you will need to have the appropriate credentials
Client ID
into Environment variable SERVAL_CLIENT_ID
Client Secret
into Environment variable SERVAL_CLIENT_SECRET
SERVAL_AUTH_URL
(e.g. SERVAL_AUTH_URL=https://sil-appbuilder.auth0.com
)SERVAL_HOST_URL
to the api's URL (e.g. SERVAL_HOST_URL=http://localhost
)
Now, when you run the tests from Serval.E2ETests
, the token will automatically be retrieved from Auth0.To view files stored in the bucket, run
aws s3 ls s3://silnlp/<deployment environment>
kubectl get pods -n serval
kubectl port-forward <pod name> 28015:27017 -n serval
mongodb://localhost:28015/?directConnection=true
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.
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.
See the Swagger documentation for Serval here.
BugSnag for error reporting: