diff --git a/.github/workflows/docker-build-push-backend-container-on-tag.yml b/.github/workflows/docker-build-push-backend-container-on-tag.yml index 8b77af29df7..634bba7151c 100644 --- a/.github/workflows/docker-build-push-backend-container-on-tag.yml +++ b/.github/workflows/docker-build-push-backend-container-on-tag.yml @@ -6,26 +6,25 @@ on: - '*' env: - REGISTRY_IMAGE: danswer/danswer-backend + REGISTRY_IMAGE: ghcr.io/stackhpc/danswer/danswer-backend jobs: build-and-push: - # TODO: make this a matrix build like the web containers - runs-on: - group: amd64-image-builders + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Backend Image Docker Build and Push uses: docker/build-push-action@v5 @@ -39,11 +38,13 @@ jobs: ${{ env.REGISTRY_IMAGE }}:latest build-args: | DANSWER_VERSION=${{ github.ref_name }} + cache-from: type=gha + cache-to: type=gha,mode=max - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: # To run locally: trivy image --severity HIGH,CRITICAL danswer/danswer-backend - image-ref: docker.io/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} + image-ref: ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} severity: 'CRITICAL,HIGH' trivyignores: ./backend/.trivyignore diff --git a/.github/workflows/docker-build-push-model-server-container-on-tag.yml b/.github/workflows/docker-build-push-model-server-container-on-tag.yml index 134b77d43c2..e4352b4042c 100644 --- a/.github/workflows/docker-build-push-model-server-container-on-tag.yml +++ b/.github/workflows/docker-build-push-model-server-container-on-tag.yml @@ -5,23 +5,26 @@ on: tags: - '*' +env: + REGISTRY_IMAGE: ghcr.io/stackhpc/danswer/danswer-model-server + jobs: build-and-push: - runs-on: - group: amd64-image-builders + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Model Server Image Docker Build and Push uses: docker/build-push-action@v5 @@ -31,13 +34,15 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - danswer/danswer-model-server:${{ github.ref_name }} - danswer/danswer-model-server:latest + ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} + ${{ env.REGISTRY_IMAGE }}:latest build-args: | DANSWER_VERSION=${{ github.ref_name }} + cache-from: type=gha + cache-to: type=gha,mode=max - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - image-ref: docker.io/danswer/danswer-model-server:${{ github.ref_name }} + image-ref: ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} severity: 'CRITICAL,HIGH' diff --git a/.github/workflows/docker-build-push-web-container-on-tag.yml b/.github/workflows/docker-build-push-web-container-on-tag.yml index 0a97a01f7c8..13f59b7b8b4 100644 --- a/.github/workflows/docker-build-push-web-container-on-tag.yml +++ b/.github/workflows/docker-build-push-web-container-on-tag.yml @@ -6,28 +6,27 @@ on: - '*' env: - REGISTRY_IMAGE: danswer/danswer-web-server + REGISTRY_IMAGE: ghcr.io/stackhpc/danswer/danswer-web-server jobs: build: - runs-on: - group: ${{ matrix.platform == 'linux/amd64' && 'amd64-image-builders' || 'arm64-image-builders' }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: platform: - linux/amd64 - - linux/arm64 + # - linux/arm64 steps: - name: Prepare run: | platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Checkout uses: actions/checkout@v4 - + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -36,16 +35,17 @@ jobs: tags: | type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} type=raw,value=${{ env.REGISTRY_IMAGE }}:latest - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub + + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push by digest id: build uses: docker/build-push-action@v5 @@ -56,17 +56,17 @@ jobs: push: true build-args: | DANSWER_VERSION=${{ github.ref_name }} - # needed due to weird interactions with the builds for different platforms + # needed due to weird interactions with the builds for different platforms no-cache: true labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - + - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - + touch "/tmp/digests/${digest#sha256:}" + - name: Upload digest uses: actions/upload-artifact@v4 with: @@ -86,28 +86,29 @@ jobs: path: /tmp/digests pattern: digests-* merge-multiple: true - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_IMAGE }} - - - name: Login to Docker Hub + + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create manifest list and push working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + - name: Inspect image run: | docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} @@ -115,5 +116,5 @@ jobs: - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - image-ref: docker.io/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} + image-ref: ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} severity: 'CRITICAL,HIGH' diff --git a/.github/workflows/helm-build-push.yml b/.github/workflows/helm-build-push.yml new file mode 100644 index 00000000000..6dc330deace --- /dev/null +++ b/.github/workflows/helm-build-push.yml @@ -0,0 +1,46 @@ +name: Publish Danswer Helm Chart + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + release: + # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions + # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v4 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Build Helm dependencies + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add vespa https://unoplat.github.io/vespa-helm-charts + helm dependency build deployment/helm + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + with: + charts_dir: deployment + pages_branch: helm-publish + mark_as_latest: ${{ github.ref_name == 'main' }} + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CR_RELEASE_NAME_TEMPLATE: "danswer-helm-{{ .Version }}" diff --git a/backend/Dockerfile b/backend/Dockerfile index 17e0be8c239..d8c388801d7 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -2,10 +2,10 @@ FROM python:3.11.7-slim-bookworm LABEL com.danswer.maintainer="founders@danswer.ai" LABEL com.danswer.description="This image is the web/frontend container of Danswer which \ -contains code for both the Community and Enterprise editions of Danswer. If you do not \ -have a contract or agreement with DanswerAI, you are not permitted to use the Enterprise \ -Edition features outside of personal development or testing purposes. Please reach out to \ -founders@danswer.ai for more information. Please visit https://github.com/danswer-ai/danswer" + contains code for both the Community and Enterprise editions of Danswer. If you do not \ + have a contract or agreement with DanswerAI, you are not permitted to use the Enterprise \ + Edition features outside of personal development or testing purposes. Please reach out to \ + founders@danswer.ai for more information. Please visit https://github.com/danswer-ai/danswer" # Default DANSWER_VERSION, typically overriden during builds by GitHub Actions. ARG DANSWER_VERSION=0.3-dev @@ -20,18 +20,18 @@ RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}" # ca-certificates for HTTPS RUN apt-get update && \ apt-get install -y \ - cmake \ - curl \ - zip \ - ca-certificates \ - libgnutls30=3.7.9-2+deb12u3 \ - libblkid1=2.38.1-5+deb12u1 \ - libmount1=2.38.1-5+deb12u1 \ - libsmartcols1=2.38.1-5+deb12u1 \ - libuuid1=2.38.1-5+deb12u1 \ - libxmlsec1-dev \ - pkg-config \ - gcc && \ + cmake \ + curl \ + zip \ + ca-certificates \ + libgnutls30=3.7.9-2+deb12u3 \ + libblkid1=2.38.1-5+deb12u1 \ + libmount1=2.38.1-5+deb12u1 \ + libsmartcols1=2.38.1-5+deb12u1 \ + libuuid1=2.38.1-5+deb12u1 \ + libxmlsec1-dev \ + pkg-config \ + gcc && \ rm -rf /var/lib/apt/lists/* && \ apt-get clean @@ -40,8 +40,8 @@ RUN apt-get update && \ COPY ./requirements/default.txt /tmp/requirements.txt COPY ./requirements/ee.txt /tmp/ee-requirements.txt RUN pip install --no-cache-dir --upgrade \ - -r /tmp/requirements.txt \ - -r /tmp/ee-requirements.txt && \ + -r /tmp/requirements.txt \ + -r /tmp/ee-requirements.txt && \ pip uninstall -y py && \ playwright install chromium && \ playwright install-deps chromium && \ @@ -54,14 +54,14 @@ RUN pip install --no-cache-dir --upgrade \ # perl-base could only be removed with --allow-remove-essential RUN apt-get update && \ apt-get remove -y --allow-remove-essential \ - perl-base \ - xserver-common \ - xvfb \ - cmake \ - libldap-2.5-0 \ - libxmlsec1-dev \ - pkg-config \ - gcc && \ + perl-base \ + xserver-common \ + xvfb \ + cmake \ + libldap-2.5-0 \ + libxmlsec1-dev \ + pkg-config \ + gcc && \ apt-get install -y libxmlsec1-openssl && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* && \ @@ -74,9 +74,9 @@ Tokenizer.from_pretrained('nomic-ai/nomic-embed-text-v1')" # Pre-downloading NLTK for setups with limited egress RUN python -c "import nltk; \ -nltk.download('stopwords', quiet=True); \ -nltk.download('wordnet', quiet=True); \ -nltk.download('punkt', quiet=True);" + nltk.download('stopwords', quiet=True); \ + nltk.download('wordnet', quiet=True); \ + nltk.download('punkt', quiet=True);" # Set up application files WORKDIR /app @@ -98,6 +98,9 @@ COPY ./scripts/force_delete_connector_by_id.py /app/scripts/force_delete_connect # Put logo in assets COPY ./assets /app/assets +# Include the license in the modified image +COPY . ../LICENSE + ENV PYTHONPATH /app # Default command which does nothing diff --git a/backend/danswer/configs/model_configs.py b/backend/danswer/configs/model_configs.py index 9e323c2b539..e5fa5e74a28 100644 --- a/backend/danswer/configs/model_configs.py +++ b/backend/danswer/configs/model_configs.py @@ -62,6 +62,8 @@ GEN_AI_MODEL_PROVIDER = os.environ.get("GEN_AI_MODEL_PROVIDER") or "openai" # If using Azure, it's the engine name, for example: Danswer GEN_AI_MODEL_VERSION = os.environ.get("GEN_AI_MODEL_VERSION") +# The fallback display name to use for default model when using a custom model provider +GEN_AI_DISPLAY_NAME = os.environ.get("GEN_AI_DISPLAY_NAME") or "Custom LLM" # For secondary flows like extracting filters or deciding if a chunk is useful, we don't need # as powerful of a model as say GPT-4 so we can use an alternative that is faster and cheaper diff --git a/backend/danswer/llm/chat_llm.py b/backend/danswer/llm/chat_llm.py index 33b1cc24c81..359e3239b9d 100644 --- a/backend/danswer/llm/chat_llm.py +++ b/backend/danswer/llm/chat_llm.py @@ -277,9 +277,11 @@ def _completion( prompt = [_convert_message_to_dict(HumanMessage(content=prompt))] try: + # When custom LLM provider is supplied, model name doesn't require prefix in LiteLLM + prefix = f"{self.config.model_provider}/" if not self._custom_llm_provider else "" return litellm.completion( # model choice - model=f"{self.config.model_provider}/{self.config.model_name}", + model=f"{prefix}{self.config.model_name}", api_key=self._api_key, base_url=self._api_base, api_version=self._api_version, diff --git a/backend/danswer/llm/llm_initialization.py b/backend/danswer/llm/llm_initialization.py index fef17ca812d..db59b836d7f 100644 --- a/backend/danswer/llm/llm_initialization.py +++ b/backend/danswer/llm/llm_initialization.py @@ -7,6 +7,8 @@ from danswer.configs.model_configs import GEN_AI_API_VERSION from danswer.configs.model_configs import GEN_AI_MODEL_PROVIDER from danswer.configs.model_configs import GEN_AI_MODEL_VERSION +from danswer.configs.model_configs import GEN_AI_LLM_PROVIDER_TYPE +from danswer.configs.model_configs import GEN_AI_DISPLAY_NAME from danswer.db.llm import fetch_existing_llm_providers from danswer.db.llm import update_default_provider from danswer.db.llm import upsert_llm_provider @@ -28,51 +30,82 @@ def load_llm_providers(db_session: Session) -> None: if not GEN_AI_API_KEY or DISABLE_GENERATIVE_AI: return - well_known_provider_name_to_provider = { - provider.name: provider - for provider in fetch_available_well_known_llms() - if provider.name != BEDROCK_PROVIDER_NAME - } + if GEN_AI_MODEL_PROVIDER == "custom": + # Validate that all required env vars are present + for var in ( + GEN_AI_LLM_PROVIDER_TYPE, + GEN_AI_API_ENDPOINT, + GEN_AI_MODEL_VERSION, + GEN_AI_DISPLAY_NAME, + ): + if not var: + logger.error( + "Cannot auto-transition custom LLM provider due to missing env vars." + "The following env vars must all be set:" + "GEN_AI_LLM_PROVIDER_TYPE, GEN_AI_API_ENDPOINT, GEN_AI_MODEL_VERSION, GEN_AI_DISPLAY_NAME" + ) + return None + llm_provider_request = LLMProviderUpsertRequest( + name=GEN_AI_DISPLAY_NAME, + provider=GEN_AI_MODEL_PROVIDER, + api_key=GEN_AI_API_KEY, + api_base=GEN_AI_API_ENDPOINT, + api_version=GEN_AI_API_VERSION, + custom_config={}, + default_model_name=GEN_AI_MODEL_VERSION, + fast_default_model_name=FAST_GEN_AI_MODEL_VERSION, + ) - if GEN_AI_MODEL_PROVIDER not in well_known_provider_name_to_provider: - logger.error(f"Cannot auto-transition LLM provider: {GEN_AI_MODEL_PROVIDER}") - return None + else: - # Azure provider requires custom model names, - # OpenAI / anthropic can just use the defaults - model_names = ( - [ - name - for name in [ - GEN_AI_MODEL_VERSION, - FAST_GEN_AI_MODEL_VERSION, + well_known_provider_name_to_provider = { + provider.name: provider + for provider in fetch_available_well_known_llms() + if provider.name != BEDROCK_PROVIDER_NAME + } + + if GEN_AI_MODEL_PROVIDER not in well_known_provider_name_to_provider: + logger.error( + f"Cannot auto-transition LLM provider: {GEN_AI_MODEL_PROVIDER}" + ) + return None + + # Azure provider requires custom model names, + # OpenAI / anthropic can just use the defaults + model_names = ( + [ + name + for name in [ + GEN_AI_MODEL_VERSION, + FAST_GEN_AI_MODEL_VERSION, + ] + if name ] - if name + if GEN_AI_MODEL_PROVIDER == AZURE_PROVIDER_NAME + else None + ) + + well_known_provider = well_known_provider_name_to_provider[ + GEN_AI_MODEL_PROVIDER ] - if GEN_AI_MODEL_PROVIDER == AZURE_PROVIDER_NAME - else None - ) + llm_provider_request = LLMProviderUpsertRequest( + name=well_known_provider.display_name, + provider=GEN_AI_MODEL_PROVIDER, + api_key=GEN_AI_API_KEY, + api_base=GEN_AI_API_ENDPOINT, + api_version=GEN_AI_API_VERSION, + custom_config={}, + default_model_name=( + GEN_AI_MODEL_VERSION + or well_known_provider.default_model + or well_known_provider.llm_names[0] + ), + fast_default_model_name=( + FAST_GEN_AI_MODEL_VERSION or well_known_provider.default_fast_model + ), + model_names=model_names, + ) - well_known_provider = well_known_provider_name_to_provider[GEN_AI_MODEL_PROVIDER] - llm_provider_request = LLMProviderUpsertRequest( - name=well_known_provider.display_name, - provider=GEN_AI_MODEL_PROVIDER, - api_key=GEN_AI_API_KEY, - api_base=GEN_AI_API_ENDPOINT, - api_version=GEN_AI_API_VERSION, - custom_config={}, - default_model_name=( - GEN_AI_MODEL_VERSION - or well_known_provider.default_model - or well_known_provider.llm_names[0] - ), - fast_default_model_name=( - FAST_GEN_AI_MODEL_VERSION or well_known_provider.default_fast_model - ), - model_names=model_names, - is_public=True, - display_model_names=[], - ) llm_provider = upsert_llm_provider(db_session, llm_provider_request) update_default_provider(db_session, llm_provider.id) logger.notice( diff --git a/deployment/helm/Chart.yaml b/deployment/helm/Chart.yaml index 7763f33bec5..42fbb79e6bc 100644 --- a/deployment/helm/Chart.yaml +++ b/deployment/helm/Chart.yaml @@ -5,8 +5,8 @@ home: https://www.danswer.ai/ sources: - "https://github.com/danswer-ai/danswer" type: application -version: 0.2.0 -appVersion: "latest" +version: 0.5.10 +appVersion: "v0.5.10" annotations: category: Productivity licenses: MIT @@ -22,14 +22,13 @@ dependencies: version: 14.3.1 repository: https://charts.bitnami.com/bitnami condition: postgresql.enabled - - name: vespa + - name: vespa version: 0.2.3 repository: https://unoplat.github.io/vespa-helm-charts condition: vespa.enabled - name: nginx version: 15.14.0 repository: oci://registry-1.docker.io/bitnamicharts - condition: nginx.enabled - + condition: nginx.enabled + - \ No newline at end of file diff --git a/deployment/helm/templates/api-deployment.yaml b/deployment/helm/templates/api-deployment.yaml index 7f10bffafd0..a10932807b8 100644 --- a/deployment/helm/templates/api-deployment.yaml +++ b/deployment/helm/templates/api-deployment.yaml @@ -37,7 +37,7 @@ spec: - name: api-server securityContext: {{- toYaml .Values.api.securityContext | nindent 12 }} - image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.api.image.pullPolicy }} command: - "/bin/sh" diff --git a/deployment/helm/templates/background-deployment.yaml b/deployment/helm/templates/background-deployment.yaml index f4ac25fe0bc..05d4f89432b 100644 --- a/deployment/helm/templates/background-deployment.yaml +++ b/deployment/helm/templates/background-deployment.yaml @@ -37,7 +37,7 @@ spec: - name: background securityContext: {{- toYaml .Values.background.securityContext | nindent 12 }} - image: "{{ .Values.background.image.repository }}:{{ .Values.background.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.background.image.repository }}:{{ .Values.background.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.background.image.pullPolicy }} command: ["/usr/bin/supervisord"] resources: diff --git a/deployment/helm/templates/indexing-model-deployment.yaml b/deployment/helm/templates/indexing-model-deployment.yaml index cc88aefb79a..cc46f4f5b1b 100644 --- a/deployment/helm/templates/indexing-model-deployment.yaml +++ b/deployment/helm/templates/indexing-model-deployment.yaml @@ -6,6 +6,8 @@ metadata: {{- include "danswer-stack.labels" . | nindent 4 }} spec: replicas: 1 + strategy: + {{- .Values.indexCapability.deployment.updateStrategy | toYaml | nindent 4 }} selector: matchLabels: {{- include "danswer-stack.selectorLabels" . | nindent 6 }} @@ -26,9 +28,13 @@ spec: spec: containers: - name: indexing-model-server - image: danswer/danswer-model-server:latest - imagePullPolicy: IfNotPresent + image: "{{ .Values.indexCapability.deployment.image.repository }}:{{ .Values.indexCapability.deployment.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.indexCapability.deployment.image.pullPolicy }} command: [ "uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "9000", "--limit-concurrency", "10" ] + {{- if .Values.indexCapability.deployment.resources }} + resources: + {{- toYaml .Values.indexCapability.deployment.resources | nindent 10 }} + {{- end }} ports: - containerPort: 9000 envFrom: diff --git a/deployment/helm/templates/inference-model-deployment.yaml b/deployment/helm/templates/inference-model-deployment.yaml index 43caddd29c3..391a8e4289b 100644 --- a/deployment/helm/templates/inference-model-deployment.yaml +++ b/deployment/helm/templates/inference-model-deployment.yaml @@ -22,7 +22,7 @@ spec: spec: containers: - name: {{ .Values.inferenceCapability.service.name }} - image: {{ .Values.inferenceCapability.deployment.image.repository }}:{{ .Values.inferenceCapability.deployment.image.tag }} + image: "{{ .Values.inferenceCapability.deployment.image.repository }}:{{ .Values.inferenceCapability.deployment.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.inferenceCapability.deployment.image.pullPolicy }} command: {{ toYaml .Values.inferenceCapability.deployment.command | nindent 14 }} ports: diff --git a/deployment/helm/templates/webserver-deployment.yaml b/deployment/helm/templates/webserver-deployment.yaml index c3505248fc6..a50e4e79b7e 100644 --- a/deployment/helm/templates/webserver-deployment.yaml +++ b/deployment/helm/templates/webserver-deployment.yaml @@ -37,7 +37,7 @@ spec: - name: web-server securityContext: {{- toYaml .Values.webserver.securityContext | nindent 12 }} - image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.webserver.image.repository }}:{{ .Values.webserver.image.tag | default .Values.appVersionOverride | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.webserver.image.pullPolicy }} ports: - name: http diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml index 2167b70438b..9142f5235ee 100644 --- a/deployment/helm/values.yaml +++ b/deployment/helm/values.yaml @@ -5,6 +5,7 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +appVersionOverride: # e.g "v0.3.93" inferenceCapability: service: @@ -24,7 +25,7 @@ inferenceCapability: value: inference-model-server image: repository: danswer/danswer-model-server - tag: latest + tag: pullPolicy: IfNotPresent command: ["uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "9000"] port: 9000 @@ -40,6 +41,23 @@ inferenceCapability: value: inference-model-server indexCapability: + deployment: + image: + repository: danswer/danswer-model-server + tag: + pullPolicy: IfNotPresent + resources: + # For example + # limits: + # nvidia.com/gpu: 1 + # The strategy to use for rolling out deployment updates + # If using GPU indexing with a limited number of GPUs available, + # this can be set to type: Recreate instead. + updateStrategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate service: type: ClusterIP port: 9000 @@ -62,6 +80,7 @@ indexCapability: accessMode: "ReadWriteOnce" storage: "3Gi" + config: envConfigMapName: env-configmap @@ -105,10 +124,10 @@ nginx: webserver: replicaCount: 1 image: - repository: danswer/danswer-web-server + repository: ghcr.io/stackhpc/danswer/danswer-web-server pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: deploymentLabels: app: web-server podAnnotations: {} @@ -168,10 +187,10 @@ webserver: api: replicaCount: 1 image: - repository: danswer/danswer-backend + repository: ghcr.io/stackhpc/danswer/danswer-backend pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: deploymentLabels: app: api-server podAnnotations: {} @@ -236,7 +255,7 @@ background: repository: danswer/danswer-backend pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: latest + tag: podAnnotations: {} podLabels: scope: danswer-backend