forked from open-webui/open-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (58 loc) · 1.81 KB
/
Copy pathMakefile
File metadata and controls
77 lines (58 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
ifneq ($(shell which docker-compose 2>/dev/null),)
DOCKER_COMPOSE := docker-compose
else
DOCKER_COMPOSE := docker compose
endif
install:
$(DOCKER_COMPOSE) up -d
remove:
@chmod +x confirm_remove.sh
@./confirm_remove.sh
start:
$(DOCKER_COMPOSE) start
startAndBuild:
$(DOCKER_COMPOSE) up -d --build
stop:
$(DOCKER_COMPOSE) stop
update:
# Calls the LLM update script
chmod +x update_ollama_models.sh
@./update_ollama_models.sh
@git pull
$(DOCKER_COMPOSE) down
# Make sure the ollama-webui container is stopped before rebuilding
@docker stop open-webui || true
$(DOCKER_COMPOSE) up --build -d
$(DOCKER_COMPOSE) start
###############################################################################
# Canva targets
###############################################################################
.PHONY: build lint lint-frontend lint-backend format format-frontend format-backend setup test-mysql
NVM_DIR ?= $(HOME)/.nvm
NVM_NODE := $(firstword $(wildcard $(NVM_DIR)/versions/node/v22.*/bin))
NODE_PATH := $(if $(NVM_NODE),$(NVM_NODE),)
NPM := $(if $(NODE_PATH),PATH="$(NODE_PATH):$$PATH" npm,npm)
NPX := $(if $(NODE_PATH),PATH="$(NODE_PATH):$$PATH" npx,npx)
IMAGE_NAME ?= open-webui
IMAGE_TAG ?= latest
setup:
uv sync --all-groups
$(NPM) ci
build:
docker build -t $(IMAGE_NAME):$(IMAGE_TAG) .
lint: format lint-frontend lint-backend
format: format-frontend format-backend
format-frontend:
$(NPX) prettier --write "**/*.{js,ts,svelte,css,md,html,json}"
format-backend:
uv run ruff format . --exclude .venv --exclude venv
lint-frontend:
$(NPX) eslint . --fix
lint-backend:
uv run ruff check --fix .
test-mysql:
cd backend && PYTHONPATH=. uv run pytest \
open_webui/test/test_mysql_migrations.py \
open_webui/test/test_mysql_migration_chain.py \
open_webui/test/test_mysql_queries.py \
-v