Implemented Danswer versioning system. (#649)

* Web & API server versioning system. Displayed on UI.

* Remove some debugging code.

* Integrated backend version into GitHub Action & Docker build workflow using env variables.

* Fixed web container environment variable name.

* Revise Dockerfiles for GitHub Actions workflow.

* Added system information page to admin panel with version info. Updated github workflows to include tagged version, and corresponding changes in the dockerfiles and codebases for web&backend to use env variables if present. Changed to 'dev' naming scheme if no env var is present to indicate local setup. Removed version from admin panel header.

* Added missing systeminfo dir to remote repo.
This commit is contained in:
Bradley
2023-11-03 18:02:39 -07:00
committed by GitHub
parent d9581ce0ae
commit 551705ad62
14 changed files with 141 additions and 4 deletions

View File

@@ -1,5 +1,12 @@
FROM python:3.11.4-slim-bookworm
# Default DANSWER_VERSION build argument set here.
# This can be overridden by passing in a build arg, typically from GitHub Actions.
ARG DANSWER_VERSION=0.1.0
# Then passed to the container environment.
ENV DANSWER_VERSION=${DANSWER_VERSION}
# Install system dependencies
RUN apt-get update && \
apt-get install -y git cmake pkg-config libprotobuf-c-dev protobuf-compiler \

View File

@@ -0,0 +1,4 @@
import os
# Pulls the version from the environment variable DANSWER_VERSION, or defaults to 0.1.0dev.
__version__ = os.environ.get("DANSWER_VERSION", "") or "0.1.0dev"

View File

@@ -46,6 +46,10 @@ class AuthTypeResponse(BaseModel):
auth_type: AuthType
class VersionResponse(BaseModel):
backend_version: str
class DataRequest(BaseModel):
data: str

View File

@@ -1,9 +1,10 @@
from fastapi import APIRouter
from danswer import __version__
from danswer.configs.app_configs import AUTH_TYPE
from danswer.server.models import AuthTypeResponse
from danswer.server.models import StatusResponse
from danswer.server.models import VersionResponse
router = APIRouter()
@@ -16,3 +17,8 @@ def healthcheck() -> StatusResponse:
@router.get("/auth/type")
def get_auth_type() -> AuthTypeResponse:
return AuthTypeResponse(auth_type=AUTH_TYPE)
@router.get("/version")
def get_version() -> VersionResponse:
return VersionResponse(backend_version=__version__)