Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
a579f5f8
Commit
a579f5f8
authored
May 22, 2024
by
Jun Siang Cheah
Browse files
feat: add git hash of build everywhere
parent
d0d76e2a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
6 deletions
+24
-6
.github/workflows/docker-build.yaml
.github/workflows/docker-build.yaml
+8
-2
Dockerfile
Dockerfile
+6
-0
backend/main.py
backend/main.py
+3
-1
hatch_build.py
hatch_build.py
+2
-0
src/lib/components/chat/Settings/About.svelte
src/lib/components/chat/Settings/About.svelte
+2
-2
src/lib/constants.ts
src/lib/constants.ts
+1
-0
vite.config.ts
vite.config.ts
+2
-1
No files found.
.github/workflows/docker-build.yaml
View file @
a579f5f8
...
...
@@ -84,6 +84,8 @@ jobs:
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-to
:
type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
build-args
:
|
BUILD_HASH=${{ github.sha }}
-
name
:
Export digest
run
:
|
...
...
@@ -170,7 +172,9 @@ jobs:
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-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
run
:
|
...
...
@@ -257,7 +261,9 @@ jobs:
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-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
run
:
|
...
...
Dockerfile
View file @
a579f5f8
...
...
@@ -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.
ARG
USE_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
ARG
USE_RERANKING_MODEL=""
ARG
BUILD_HASH=dev-build
# Override at your own risk - non-root configurations are untested
ARG
UID=0
ARG
GID=0
######## WebUI frontend ########
FROM
--platform=$BUILDPLATFORM node:21-alpine3.19 as build
ARG
BUILD_HASH
WORKDIR
/app
...
...
@@ -24,6 +26,7 @@ COPY package.json package-lock.json ./
RUN
npm ci
COPY
. .
ENV
WEBUI_VERSION=${BUILD_HASH}
RUN
npm run build
######## WebUI backend ########
...
...
@@ -35,6 +38,7 @@ ARG USE_OLLAMA
ARG
USE_CUDA_VER
ARG
USE_EMBEDDING_MODEL
ARG
USE_RERANKING_MODEL
ARG
BUILD_HASH
ARG
UID
ARG
GID
...
...
@@ -155,4 +159,6 @@ HEALTHCHECK CMD curl --silent --fail http://localhost:8080/health | jq -e '.stat
USER
$UID:$GID
ENV
WEBUI_VERSION=${BUILD_HASH}
CMD
[ "bash", "start.sh"]
backend/main.py
View file @
a579f5f8
...
...
@@ -61,6 +61,7 @@ from config import (
WEBHOOK_URL
,
ENABLE_ADMIN_EXPORT
,
AppConfig
,
WEBUI_VERSION
,
)
from
constants
import
ERROR_MESSAGES
...
...
@@ -91,6 +92,7 @@ print(
v
{
VERSION
}
- building the best open-source AI user interface.
{
f
"Commit:
{
WEBUI_VERSION
}
" if WEBUI_VERSION != "
v1
.
0.0
-
alpha
.
100
" else ""
}
https://github.com/open-webui/open-webui
"""
)
...
...
hatch_build.py
View file @
a579f5f8
# noqa: INP001
import
os
import
shutil
import
subprocess
from
sys
import
stderr
...
...
@@ -18,4 +19,5 @@ class CustomBuildHook(BuildHookInterface):
stderr
.
write
(
"### npm install
\n
"
)
subprocess
.
run
([
npm
,
"install"
],
check
=
True
)
# noqa: S603
stderr
.
write
(
"
\n
### npm run build
\n
"
)
os
.
environ
[
"WEBUI_VERSION"
]
=
version
subprocess
.
run
([
npm
,
"run"
,
"build"
],
check
=
True
)
# noqa: S603
src/lib/components/chat/Settings/About.svelte
View file @
a579f5f8
<script lang="ts">
import { getVersionUpdates } from '$lib/apis';
import { getOllamaVersion } from '$lib/apis/ollama';
import { WEBUI_VERSION } from '$lib/constants';
import {
WEBUI_HASH,
WEBUI_VERSION } from '$lib/constants';
import { WEBUI_NAME, config, showChangelog } from '$lib/stores';
import { compareVersion } from '$lib/utils';
import { onMount, getContext } from 'svelte';
...
...
@@ -54,7 +54,7 @@
<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 gap-1">
<Tooltip content={WEBUI_
VERSION === '0.1.117' ? "🪖 We're just getting started." : ''
}>
<Tooltip content={WEBUI_
HASH
}>
v{WEBUI_VERSION}
</Tooltip>
...
...
src/lib/constants.ts
View file @
a579f5f8
...
...
@@ -14,6 +14,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
WEBUI_VERSION
=
APP_VERSION
;
export
const
WEBUI_HASH
=
APP_HASH
;
export
const
REQUIRED_OLLAMA_VERSION
=
'
0.1.16
'
;
export
const
SUPPORTED_FILE_TYPE
=
[
...
...
vite.config.ts
View file @
a579f5f8
...
...
@@ -18,7 +18,8 @@ import { defineConfig } from 'vite';
export
default
defineConfig
({
plugins
:
[
sveltekit
()],
define
:
{
APP_VERSION
:
JSON
.
stringify
(
process
.
env
.
npm_package_version
)
APP_VERSION
:
JSON
.
stringify
(
process
.
env
.
npm_package_version
),
APP_HASH
:
JSON
.
stringify
(
process
.
env
.
WEBUI_VERSION
||
'
dev-build
'
)
},
worker
:
{
format
:
'
es
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment