From c53e70a7aead9aacab535e27b89f8dc42db78af0 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Fri, 13 Oct 2023 08:58:20 -0400 Subject: [PATCH] Change DummyBuild to Staging (standard naming) Create staging env for Serval and Echo --- README.md | 9 +++++++++ deploy/qa-ext-values.yaml | 2 +- deploy/qa-int-values.yaml | 2 +- deploy/serval/templates/echo-deployment.yaml | 2 +- deploy/serval/templates/machine-engine-deployment.yaml | 2 +- deploy/serval/templates/machine-job-deployment.yaml | 2 +- deploy/serval/templates/serval-api-deployment.yaml | 6 ++---- deploy/values.yaml | 2 +- docker-compose.yml | 8 ++++---- samples/EchoTranslationEngine/appsettings.Staging.json | 8 ++++++++ src/Serval.ApiServer/appsettings.Staging.json | 8 ++++++++ 11 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 samples/EchoTranslationEngine/appsettings.Staging.json create mode 100644 src/Serval.ApiServer/appsettings.Staging.json diff --git a/README.md b/README.md index 9a314b33..4ab3663b 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,15 @@ There are 3 different environments that Serval is deployed to: - `kubectl config use-context aws-rke` - `helm upgrade serval deploy/serval -n serval -f deploy/values.yaml` +### Environments: +- Production: + - Full deployment, full NMT and SMT builds +- Staging: + - Full Deploymnet, dummy NMT building (10 steps, small model) + - Also used for Docker-compose local staging +- Development: + - Non-docker use only + ## Debugging ### To access Serval API * Internal QA: diff --git a/deploy/qa-ext-values.yaml b/deploy/qa-ext-values.yaml index 916e0677..3b7b6a35 100644 --- a/deploy/qa-ext-values.yaml +++ b/deploy/qa-ext-values.yaml @@ -1,4 +1,5 @@ externalHost: qa.serval-api.org +environment: Staging enableTls: true namespace: serval auth0Domain: dev-sillsdev.auth0.com @@ -6,7 +7,6 @@ lokiTenent: serval-tenant lokiUrl: http://loki-distributed-gateway.loki.svc.cluster.local servalImage: ghcr.io/sillsdev/serval:0.7.1 machineImage: ghcr.io/sillsdev/machine:3.3.2 -machineEnvironment: DummyBuild ClearMLDockerImage: ghcr.io/sillsdev/machine.py:0.9.5 ClearMLMaxSteps: 10 ClearMLQueue: lambert_24gb diff --git a/deploy/qa-int-values.yaml b/deploy/qa-int-values.yaml index a9b956e8..1a07146d 100644 --- a/deploy/qa-int-values.yaml +++ b/deploy/qa-int-values.yaml @@ -1,4 +1,5 @@ externalHost: qa-int.serval-api.org +environment: Staging enableTls: true namespace: nlp auth0Domain: sil-appbuilder.auth0.com @@ -6,7 +7,6 @@ lokiTenent: nlp-tenant lokiUrl: http://loki-distributed-gateway.loki.svc.cluster.local servalImage: ghcr.io/sillsdev/serval:0.7.1 machineImage: ghcr.io/sillsdev/machine:3.3.2 -machineEnvironment: DummyBuild ClearMLDockerImage: ghcr.io/sillsdev/machine.py:0.9.5 ClearMLMaxSteps: 10 ClearMLQueue: lambert_24gb diff --git a/deploy/serval/templates/echo-deployment.yaml b/deploy/serval/templates/echo-deployment.yaml index f55ecff7..fd53f07e 100644 --- a/deploy/serval/templates/echo-deployment.yaml +++ b/deploy/serval/templates/echo-deployment.yaml @@ -25,7 +25,7 @@ spec: workingDir: /app/echo_server env: - name: ASPNETCORE_ENVIRONMENT - value: Production + value: {{ .Values.environment}} - name: ASPNETCORE_Kestrel__Endpoints__Grpc__Url value: http://*:80 - name: ASPNETCORE_Kestrel__Endpoints__Grpc__Protocols diff --git a/deploy/serval/templates/machine-engine-deployment.yaml b/deploy/serval/templates/machine-engine-deployment.yaml index 203d4b8b..806f1593 100644 --- a/deploy/serval/templates/machine-engine-deployment.yaml +++ b/deploy/serval/templates/machine-engine-deployment.yaml @@ -24,7 +24,7 @@ spec: workingDir: /app/engine_server env: - name: ASPNETCORE_ENVIRONMENT - value: {{ .Values.machineEnvironment }} + value: {{ .Values.environment }} - name: ASPNETCORE_Kestrel__Endpoints__Grpc__Url value: http://*:80 - name: ASPNETCORE_Kestrel__Endpoints__Grpc__Protocols diff --git a/deploy/serval/templates/machine-job-deployment.yaml b/deploy/serval/templates/machine-job-deployment.yaml index 407c31aa..22ed1236 100644 --- a/deploy/serval/templates/machine-job-deployment.yaml +++ b/deploy/serval/templates/machine-job-deployment.yaml @@ -24,7 +24,7 @@ spec: workingDir: /app/job_server env: - name: ASPNETCORE_ENVIRONMENT - value: {{ .Values.machineEnvironment}} + value: {{ .Values.environment}} - name: ASPNETCORE_Kestrel__Endpoints__Grpc__Url value: http://*:80 - name: ASPNETCORE_Kestrel__Endpoints__Grpc__Protocols diff --git a/deploy/serval/templates/serval-api-deployment.yaml b/deploy/serval/templates/serval-api-deployment.yaml index ff563720..76444243 100644 --- a/deploy/serval/templates/serval-api-deployment.yaml +++ b/deploy/serval/templates/serval-api-deployment.yaml @@ -25,6 +25,8 @@ spec: env: - name: Auth__Domain value: {{ .Values.auth0Domain}} + - name: ASPNETCORE_ENVIRONMENT + value: {{ .Values.environment}} - name: ASPNETCORE_Kestrel__Endpoints__Http__Url value: http://*:80 - name: ASPNETCORE_Kestrel__Endpoints__Http2__Url @@ -35,10 +37,6 @@ spec: value: mongodb://mongo:27017/serval_jobs?replicaSet=myRS - name: ASPNETCORE_ConnectionStrings__Mongo value: mongodb://mongo:27017/serval?replicaSet=myRS - - name: ASPNETCORE_Logging__LogLevel__Default - value: Information - - name: ASPNETCORE_Logging__LogLevel__Microsoft.AspNetCore - value: Warning - name: ASPNETCORE_Translation__Engines__0__Type value: Echo - name: ASPNETCORE_Translation__Engines__0__Address diff --git a/deploy/values.yaml b/deploy/values.yaml index 4a951620..5129c9ee 100644 --- a/deploy/values.yaml +++ b/deploy/values.yaml @@ -1,4 +1,5 @@ externalHost: prod.serval-api.org +environment: Production enableTls: true namespace: serval auth0Domain: languagetechnology.auth0.com @@ -6,7 +7,6 @@ lokiTenent: nlp-tenant lokiUrl: http://loki-distributed-gateway.loki.svc.cluster.local servalImage: ghcr.io/sillsdev/serval:0.7.1 machineImage: ghcr.io/sillsdev/machine:3.3.2 -machineEnvironment: Production ClearMLDockerImage: ghcr.io/sillsdev/machine.py:0.9.5 ClearMLMaxSteps: 20000 ClearMLQueue: production diff --git a/docker-compose.yml b/docker-compose.yml index fc4a12e8..6db09c1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: context: . dockerfile: dockerfile.development environment: - - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_ENVIRONMENT=Staging - Auth__Domain=sil-appbuilder.auth0.com - Auth__Audience=https://machine.sil.org - ASPNETCORE_Kestrel__Endpoints__Http__Url=http://*:80 @@ -48,7 +48,7 @@ services: context: . dockerfile: dockerfile.development environment: - - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_ENVIRONMENT=Staging - ASPNETCORE_Kestrel__Endpoints__Http__Url=http://*:80 - ASPNETCORE_Kestrel__EndpointDefaults__Protocols=Http2 - ASPNETCORE_ConnectionStrings__TranslationPlatformApi=http://serval-api:81 @@ -79,7 +79,7 @@ services: dockerfile: ../machine/dockerfile.development environment: - - ASPNETCORE_ENVIRONMENT=DummyBuild + - ASPNETCORE_ENVIRONMENT=Staging - ASPNETCORE_Kestrel__Endpoints__Https__Url=http://*:80 - ASPNETCORE_Kestrel__EndpointDefaults__Protocols=Http2 - ASPNETCORE_ConnectionStrings__Hangfire=mongodb://mongo:27017/machine_jobs?replicaSet=myRS @@ -124,7 +124,7 @@ services: context: ../machine dockerfile: ../machine/dockerfile.development environment: - - ASPNETCORE_ENVIRONMENT=DummyBuild + - ASPNETCORE_ENVIRONMENT=Staging - ASPNETCORE_ConnectionStrings__Hangfire=mongodb://mongo:27017/machine_jobs?replicaSet=myRS - ASPNETCORE_ConnectionStrings__Mongo=mongodb://mongo:27017/machine?replicaSet=myRS - ASPNETCORE_ConnectionStrings__Serval=http://serval-api:81 diff --git a/samples/EchoTranslationEngine/appsettings.Staging.json b/samples/EchoTranslationEngine/appsettings.Staging.json new file mode 100644 index 00000000..1b2d3baf --- /dev/null +++ b/samples/EchoTranslationEngine/appsettings.Staging.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} \ No newline at end of file diff --git a/src/Serval.ApiServer/appsettings.Staging.json b/src/Serval.ApiServer/appsettings.Staging.json new file mode 100644 index 00000000..1b2d3baf --- /dev/null +++ b/src/Serval.ApiServer/appsettings.Staging.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} \ No newline at end of file