mirror of
https://github.com/open-webui/open-webui
synced 2025-03-06 20:42:49 +00:00
Merge pull request #2562 from cheahjs/feat/include-git-hash-everywhere
feat: add git hash of build everywhere
This commit is contained in:
commit
00f32e2651
10
.github/workflows/docker-build.yaml
vendored
10
.github/workflows/docker-build.yaml
vendored
@ -84,6 +84,8 @@ jobs:
|
|||||||
outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
||||||
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
|
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
|
||||||
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
|
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
|
||||||
|
build-args: |
|
||||||
|
BUILD_HASH=${{ github.sha }}
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
run: |
|
run: |
|
||||||
@ -170,7 +172,9 @@ jobs:
|
|||||||
outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
||||||
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
|
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
|
||||||
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
|
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
|
||||||
build-args: USE_CUDA=true
|
build-args: |
|
||||||
|
BUILD_HASH=${{ github.sha }}
|
||||||
|
USE_CUDA=true
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
run: |
|
run: |
|
||||||
@ -257,7 +261,9 @@ jobs:
|
|||||||
outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
||||||
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
|
cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
|
||||||
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
|
cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
|
||||||
build-args: USE_OLLAMA=true
|
build-args: |
|
||||||
|
BUILD_HASH=${{ github.sha }}
|
||||||
|
USE_OLLAMA=true
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
run: |
|
run: |
|
||||||
|
@ -11,12 +11,14 @@ ARG USE_CUDA_VER=cu121
|
|||||||
# IMPORTANT: If you change the embedding model (sentence-transformers/all-MiniLM-L6-v2) and vice versa, you aren't able to use RAG Chat with your previous documents loaded in the WebUI! You need to re-embed them.
|
# IMPORTANT: If you change the embedding model (sentence-transformers/all-MiniLM-L6-v2) and vice versa, you aren't able to use RAG Chat with your previous documents loaded in the WebUI! You need to re-embed them.
|
||||||
ARG USE_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
|
ARG USE_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
|
||||||
ARG USE_RERANKING_MODEL=""
|
ARG USE_RERANKING_MODEL=""
|
||||||
|
ARG BUILD_HASH=dev-build
|
||||||
# Override at your own risk - non-root configurations are untested
|
# Override at your own risk - non-root configurations are untested
|
||||||
ARG UID=0
|
ARG UID=0
|
||||||
ARG GID=0
|
ARG GID=0
|
||||||
|
|
||||||
######## WebUI frontend ########
|
######## WebUI frontend ########
|
||||||
FROM --platform=$BUILDPLATFORM node:21-alpine3.19 as build
|
FROM --platform=$BUILDPLATFORM node:21-alpine3.19 as build
|
||||||
|
ARG BUILD_HASH
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -24,6 +26,7 @@ COPY package.json package-lock.json ./
|
|||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ENV APP_BUILD_HASH=${BUILD_HASH}
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
######## WebUI backend ########
|
######## WebUI backend ########
|
||||||
@ -35,6 +38,7 @@ ARG USE_OLLAMA
|
|||||||
ARG USE_CUDA_VER
|
ARG USE_CUDA_VER
|
||||||
ARG USE_EMBEDDING_MODEL
|
ARG USE_EMBEDDING_MODEL
|
||||||
ARG USE_RERANKING_MODEL
|
ARG USE_RERANKING_MODEL
|
||||||
|
ARG BUILD_HASH
|
||||||
ARG UID
|
ARG UID
|
||||||
ARG GID
|
ARG GID
|
||||||
|
|
||||||
@ -150,4 +154,6 @@ HEALTHCHECK CMD curl --silent --fail http://localhost:8080/health | jq -e '.stat
|
|||||||
|
|
||||||
USER $UID:$GID
|
USER $UID:$GID
|
||||||
|
|
||||||
|
ENV WEBUI_BUILD_VERSION=${BUILD_HASH}
|
||||||
|
|
||||||
CMD [ "bash", "start.sh"]
|
CMD [ "bash", "start.sh"]
|
||||||
|
@ -13,7 +13,7 @@ from apps.webui.routers import (
|
|||||||
utils,
|
utils,
|
||||||
)
|
)
|
||||||
from config import (
|
from config import (
|
||||||
WEBUI_VERSION,
|
WEBUI_BUILD_HASH,
|
||||||
WEBUI_AUTH,
|
WEBUI_AUTH,
|
||||||
DEFAULT_MODELS,
|
DEFAULT_MODELS,
|
||||||
DEFAULT_PROMPT_SUGGESTIONS,
|
DEFAULT_PROMPT_SUGGESTIONS,
|
||||||
|
@ -166,10 +166,10 @@ CHANGELOG = changelog_json
|
|||||||
|
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# WEBUI_VERSION
|
# WEBUI_BUILD_HASH
|
||||||
####################################
|
####################################
|
||||||
|
|
||||||
WEBUI_VERSION = os.environ.get("WEBUI_VERSION", "v1.0.0-alpha.100")
|
WEBUI_BUILD_HASH = os.environ.get("WEBUI_BUILD_HASH", "dev-build")
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# DATA/FRONTEND BUILD DIR
|
# DATA/FRONTEND BUILD DIR
|
||||||
|
@ -55,6 +55,7 @@ from config import (
|
|||||||
WEBHOOK_URL,
|
WEBHOOK_URL,
|
||||||
ENABLE_ADMIN_EXPORT,
|
ENABLE_ADMIN_EXPORT,
|
||||||
AppConfig,
|
AppConfig,
|
||||||
|
WEBUI_BUILD_HASH,
|
||||||
)
|
)
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ print(
|
|||||||
|
|
||||||
|
|
||||||
v{VERSION} - building the best open-source AI user interface.
|
v{VERSION} - building the best open-source AI user interface.
|
||||||
|
{f"Commit: {WEBUI_BUILD_HASH}" if WEBUI_BUILD_HASH != "dev-build" else ""}
|
||||||
https://github.com/open-webui/open-webui
|
https://github.com/open-webui/open-webui
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# noqa: INP001
|
# noqa: INP001
|
||||||
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from sys import stderr
|
from sys import stderr
|
||||||
@ -18,4 +19,5 @@ class CustomBuildHook(BuildHookInterface):
|
|||||||
stderr.write("### npm install\n")
|
stderr.write("### npm install\n")
|
||||||
subprocess.run([npm, "install"], check=True) # noqa: S603
|
subprocess.run([npm, "install"], check=True) # noqa: S603
|
||||||
stderr.write("\n### npm run build\n")
|
stderr.write("\n### npm run build\n")
|
||||||
|
os.environ["APP_BUILD_HASH"] = version
|
||||||
subprocess.run([npm, "run", "build"], check=True) # noqa: S603
|
subprocess.run([npm, "run", "build"], check=True) # noqa: S603
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getVersionUpdates } from '$lib/apis';
|
import { getVersionUpdates } from '$lib/apis';
|
||||||
import { getOllamaVersion } from '$lib/apis/ollama';
|
import { getOllamaVersion } from '$lib/apis/ollama';
|
||||||
import { WEBUI_VERSION } from '$lib/constants';
|
import { WEBUI_BUILD_HASH, WEBUI_VERSION } from '$lib/constants';
|
||||||
import { WEBUI_NAME, config, showChangelog } from '$lib/stores';
|
import { WEBUI_NAME, config, showChangelog } from '$lib/stores';
|
||||||
import { compareVersion } from '$lib/utils';
|
import { compareVersion } from '$lib/utils';
|
||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<div class="flex w-full justify-between items-center">
|
<div class="flex w-full justify-between items-center">
|
||||||
<div class="flex flex-col text-xs text-gray-700 dark:text-gray-200">
|
<div class="flex flex-col text-xs text-gray-700 dark:text-gray-200">
|
||||||
<div class="flex gap-1">
|
<div class="flex gap-1">
|
||||||
<Tooltip content={WEBUI_VERSION === '0.1.117' ? "🪖 We're just getting started." : ''}>
|
<Tooltip content={WEBUI_BUILD_HASH}>
|
||||||
v{WEBUI_VERSION}
|
v{WEBUI_VERSION}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/images/api/v1`;
|
|||||||
export const RAG_API_BASE_URL = `${WEBUI_BASE_URL}/rag/api/v1`;
|
export const RAG_API_BASE_URL = `${WEBUI_BASE_URL}/rag/api/v1`;
|
||||||
|
|
||||||
export const WEBUI_VERSION = APP_VERSION;
|
export const WEBUI_VERSION = APP_VERSION;
|
||||||
|
export const WEBUI_BUILD_HASH = APP_BUILD_HASH;
|
||||||
export const REQUIRED_OLLAMA_VERSION = '0.1.16';
|
export const REQUIRED_OLLAMA_VERSION = '0.1.16';
|
||||||
|
|
||||||
export const SUPPORTED_FILE_TYPE = [
|
export const SUPPORTED_FILE_TYPE = [
|
||||||
|
@ -18,7 +18,8 @@ import { defineConfig } from 'vite';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
define: {
|
define: {
|
||||||
APP_VERSION: JSON.stringify(process.env.npm_package_version)
|
APP_VERSION: JSON.stringify(process.env.npm_package_version),
|
||||||
|
APP_BUILD_HASH: JSON.stringify(process.env.APP_BUILD_HASH || 'dev-build')
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
|
Loading…
Reference in New Issue
Block a user