mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 03:58:30 +02:00
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:
@@ -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 \
|
||||
|
@@ -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"
|
@@ -46,6 +46,10 @@ class AuthTypeResponse(BaseModel):
|
||||
auth_type: AuthType
|
||||
|
||||
|
||||
class VersionResponse(BaseModel):
|
||||
backend_version: str
|
||||
|
||||
|
||||
class DataRequest(BaseModel):
|
||||
data: str
|
||||
|
||||
|
@@ -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__)
|
||||
|
Reference in New Issue
Block a user