From 7c8691b2fcbb5230d0d7480a90da00b3cb59a2ca Mon Sep 17 00:00:00 2001 From: Brent George Date: Fri, 27 Sep 2024 12:27:17 -0400 Subject: [PATCH 1/2] add container orchestrator environment variable --- charts/deepgram-self-hosted/CHANGELOG.md | 1 + charts/deepgram-self-hosted/templates/api/api.deployment.yaml | 3 +++ .../templates/engine/engine.deployment.yaml | 4 +++- .../templates/license-proxy/license-proxy.deployment.yaml | 3 +++ docker/docker-compose.license-proxy.yml | 3 +++ docker/docker-compose.standard.yml | 2 ++ podman/podman-compose.license-proxy.yml | 3 +++ podman/podman-compose.standard.yml | 2 ++ 8 files changed, 20 insertions(+), 1 deletion(-) diff --git a/charts/deepgram-self-hosted/CHANGELOG.md b/charts/deepgram-self-hosted/CHANGELOG.md index da5b5f7..a3d491b 100644 --- a/charts/deepgram-self-hosted/CHANGELOG.md +++ b/charts/deepgram-self-hosted/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Added - Automatic model management on AWS now supports model removal. See the `engine.modelManager.models.remove` section in the `values.yaml` file for details. +- Container orchestrator environment variable added to improve support. ### Changed diff --git a/charts/deepgram-self-hosted/templates/api/api.deployment.yaml b/charts/deepgram-self-hosted/templates/api/api.deployment.yaml index a1edcf6..db54d29 100644 --- a/charts/deepgram-self-hosted/templates/api/api.deployment.yaml +++ b/charts/deepgram-self-hosted/templates/api/api.deployment.yaml @@ -50,6 +50,9 @@ spec: envFrom: - secretRef: name: {{ required "Missing Deepgram self-hosted API key - see `global.deepgramSecretRef`" .Values.global.deepgramSecretRef }} + env: + - name: DEEPGRAM_DEPLOYMENT_ORCHESTRATOR + value: helm-{{ include "deepgram-self-hosted.chart" . }} command: [ "stem" ] args: ["-v", "serve", "/etc/config/api.toml"] resources: diff --git a/charts/deepgram-self-hosted/templates/engine/engine.deployment.yaml b/charts/deepgram-self-hosted/templates/engine/engine.deployment.yaml index 894c36d..1aa7730 100644 --- a/charts/deepgram-self-hosted/templates/engine/engine.deployment.yaml +++ b/charts/deepgram-self-hosted/templates/engine/engine.deployment.yaml @@ -50,8 +50,10 @@ spec: envFrom: - secretRef: name: {{ required "Missing Deepgram self-hosted API key - see `global.deepgramSecretRef`" .Values.global.deepgramSecretRef }} - {{- if le (int .Values.engine.resources.requests.gpu) 0 }} env: + - name: DEEPGRAM_DEPLOYMENT_ORCHESTRATOR + value: helm-{{ include "deepgram-self-hosted.chart" . }} + {{- if le (int .Values.engine.resources.requests.gpu) 0 }} - name: NVIDIA_VISIBLE_DEVICES value: "void" {{- end }} diff --git a/charts/deepgram-self-hosted/templates/license-proxy/license-proxy.deployment.yaml b/charts/deepgram-self-hosted/templates/license-proxy/license-proxy.deployment.yaml index 0c14c17..911f309 100644 --- a/charts/deepgram-self-hosted/templates/license-proxy/license-proxy.deployment.yaml +++ b/charts/deepgram-self-hosted/templates/license-proxy/license-proxy.deployment.yaml @@ -50,6 +50,9 @@ spec: envFrom: - secretRef: name: {{ required "Missing Deepgram self-hosted API key - see `global.deepgramSecretRef`" .Values.global.deepgramSecretRef }} + env: + - name: DEEPGRAM_DEPLOYMENT_ORCHESTRATOR + value: helm-{{ include "deepgram-self-hosted.chart" . }} command: [ "hermes" ] args: ["-v", "serve", "/etc/config/license-proxy.toml"] resources: diff --git a/docker/docker-compose.license-proxy.yml b/docker/docker-compose.license-proxy.yml index b48191d..3866716 100644 --- a/docker/docker-compose.license-proxy.yml +++ b/docker/docker-compose.license-proxy.yml @@ -14,6 +14,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path @@ -50,6 +51,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. @@ -92,6 +94,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path diff --git a/docker/docker-compose.standard.yml b/docker/docker-compose.standard.yml index 3d4c16a..3ad872e 100644 --- a/docker/docker-compose.standard.yml +++ b/docker/docker-compose.standard.yml @@ -14,6 +14,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path @@ -46,6 +47,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. diff --git a/podman/podman-compose.license-proxy.yml b/podman/podman-compose.license-proxy.yml index 5c7e7f8..5418083 100644 --- a/podman/podman-compose.license-proxy.yml +++ b/podman/podman-compose.license-proxy.yml @@ -14,6 +14,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "podman-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path @@ -51,6 +52,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "podman-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. @@ -93,6 +95,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "podman-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path diff --git a/podman/podman-compose.standard.yml b/podman/podman-compose.standard.yml index 1bca3cb..878bcfa 100644 --- a/podman/podman-compose.standard.yml +++ b/podman/podman-compose.standard.yml @@ -14,6 +14,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "podman-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path @@ -47,6 +48,7 @@ services: # Make sure you `export` your self-hosted API key secret in your local environment environment: DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "podman-compose" # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. From 593053bca19735dbebf732d21f78b3cda72acca3 Mon Sep 17 00:00:00 2001 From: Brent George Date: Fri, 27 Sep 2024 13:57:09 -0400 Subject: [PATCH 2/2] reduce duplication in Docker Compose files --- docker/docker-compose.license-proxy.yml | 21 +++++++++------------ docker/docker-compose.standard.yml | 16 ++++++++-------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/docker/docker-compose.license-proxy.yml b/docker/docker-compose.license-proxy.yml index 3866716..373e37c 100644 --- a/docker/docker-compose.license-proxy.yml +++ b/docker/docker-compose.license-proxy.yml @@ -1,5 +1,11 @@ # Make sure to replace placeholder paths to config files and model directories +x-env: &env + environment: + # Make sure you `export` your self-hosted API key secret in your local environment + DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + services: # The speech API service. api: @@ -11,10 +17,7 @@ services: ports: - "8080:8080" - # Make sure you `export` your self-hosted API key secret in your local environment - environment: - DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" - DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + <<: *env # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path @@ -48,10 +51,7 @@ services: ports: - "9991:9991" - # Make sure you `export` your self-hosted API key secret in your local environment - environment: - DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" - DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + <<: *env # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. @@ -91,10 +91,7 @@ services: ports: - "8089:8080" - # Make sure you `export` your self-hosted API key secret in your local environment - environment: - DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" - DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + <<: *env # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path diff --git a/docker/docker-compose.standard.yml b/docker/docker-compose.standard.yml index 3ad872e..9ab795b 100644 --- a/docker/docker-compose.standard.yml +++ b/docker/docker-compose.standard.yml @@ -1,5 +1,11 @@ # Make sure to replace placeholder paths to config files and model directories +x-env: &env + environment: + # Make sure you `export` your self-hosted API key secret in your local environment + DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" + DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + services: # The speech API service. api: @@ -11,10 +17,7 @@ services: ports: - "8080:8080" - # Make sure you `export` your self-hosted API key secret in your local environment - environment: - DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" - DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + <<: *env # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path. It must match the path @@ -44,10 +47,7 @@ services: ports: - "9991:9991" - # Make sure you `export` your self-hosted API key secret in your local environment - environment: - DEEPGRAM_API_KEY: "${DEEPGRAM_API_KEY}" - DEEPGRAM_DEPLOYMENT_ORCHESTRATOR: "docker-compose" + <<: *env # The path on the left of the colon ':' should point to files/directories on the host machine. # The path on the right of the colon ':' is an in-container path.