-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provides the ability to pull out the NLP models into a separate model server which can then be hosted on a GPU instance if desired.
- Loading branch information
1 parent
fe938b6
commit 7433ddd
Showing
20 changed files
with
614 additions
and
85 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.github/workflows/docker-build-push-model-server-container-on-tag.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and Push Backend Images on Tagging | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Backend Image Docker Build and Push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./backend | ||
file: ./backend/Dockerfile.model_server | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
danswer/danswer-model-server:${{ github.ref_name }} | ||
danswer/danswer-model-server:latest | ||
build-args: | | ||
DANSWER_VERSION: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM python:3.11.4-slim-bookworm | ||
|
||
# Default DANSWER_VERSION, typically overriden during builds by GitHub Actions. | ||
ARG DANSWER_VERSION=0.2-dev | ||
ENV DANSWER_VERSION=${DANSWER_VERSION} | ||
|
||
COPY ./requirements/model_server.txt /tmp/requirements.txt | ||
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt | ||
|
||
WORKDIR /app | ||
# Needed for model configs and defaults | ||
COPY ./danswer/configs /app/danswer/configs | ||
# Utils used by model server | ||
COPY ./danswer/utils/logger.py /app/danswer/utils/logger.py | ||
COPY ./danswer/utils/timing.py /app/danswer/utils/timing.py | ||
# Version information | ||
COPY ./danswer/__init__.py /app/danswer/__init__.py | ||
# Shared implementations for running NLP models locally | ||
COPY ./danswer/search/search_nlp_models.py /app/danswer/search/search_nlp_models.py | ||
# Request/Response models | ||
COPY ./shared_models /app/shared_models | ||
# Model Server main code | ||
COPY ./model_server /app/model_server | ||
|
||
ENV PYTHONPATH /app | ||
|
||
CMD ["uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "9000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7433ddd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
internal-search – ./
internal-search.vercel.app
internal-search-git-main-danswer.vercel.app
internal-search-danswer.vercel.app
www.danswer.dev
danswer.dev