From 998616c0fd5ceacf6e5a06b1d662349501d01dda Mon Sep 17 00:00:00 2001 From: Pascal Lim Date: Wed, 4 Sep 2024 20:27:30 +0200 Subject: [PATCH 1/3] fix scripts to point to correct path --- .github/workflows/integration-test.yml | 6 +++--- backend/start_windows.bat | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 8d9dd7aeb..54db965d8 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -157,7 +157,7 @@ jobs: GLOBAL_LOG_LEVEL: debug run: | cd backend - uvicorn main:app --port "8080" --forwarded-allow-ips '*' & + uvicorn open_webui.main:app --port "8080" --forwarded-allow-ips '*' & UVICORN_PID=$! # Wait up to 40 seconds for the server to start for i in {1..40}; do @@ -184,7 +184,7 @@ jobs: DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres run: | cd backend - uvicorn main:app --port "8081" --forwarded-allow-ips '*' & + uvicorn open_webui.main:app --port "8081" --forwarded-allow-ips '*' & UVICORN_PID=$! # Wait up to 20 seconds for the server to start for i in {1..20}; do @@ -230,7 +230,7 @@ jobs: # DATABASE_URL: mysql://root:mysql@localhost:3306/mysql # run: | # cd backend -# uvicorn main:app --port "8083" --forwarded-allow-ips '*' & +# uvicorn open_webui.main:app --port "8083" --forwarded-allow-ips '*' & # UVICORN_PID=$! # # Wait up to 20 seconds for the server to start # for i in {1..20}; do diff --git a/backend/start_windows.bat b/backend/start_windows.bat index b2498f9c2..3e8c6b97c 100644 --- a/backend/start_windows.bat +++ b/backend/start_windows.bat @@ -30,4 +30,4 @@ IF "%WEBUI_SECRET_KEY%%WEBUI_JWT_SECRET_KEY%" == " " ( :: Execute uvicorn SET "WEBUI_SECRET_KEY=%WEBUI_SECRET_KEY%" -uvicorn main:app --host "%HOST%" --port "%PORT%" --forwarded-allow-ips '*' +uvicorn open_webui.main:app --host "%HOST%" --port "%PORT%" --forwarded-allow-ips '*' From 004700c1250dcf5403197201ca1efe4fc1c434c4 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 4 Sep 2024 22:33:40 +0200 Subject: [PATCH 2/3] feat: add `OVERRIDE_PIP_INSTALL` environment variable --- backend/open_webui/env.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index b803b5863..a509fd1a0 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -95,6 +95,8 @@ try: except importlib.metadata.PackageNotFoundError: pass +OVERRIDE_PIP_INSTALL = os.environ.get("OVERRIDE_PIP_INSTALL") +PIP_INSTALL = OVERRIDE_PIP_INSTALL if (OVERRIDE_PIP_INSTALL != None) else PIP_INSTALL if PIP_INSTALL: PACKAGE_DATA = {"version": importlib.metadata.version("open-webui")} From a0be3822bf40dd1d448ff51dce094783fe23d4e9 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 4 Sep 2024 23:00:01 +0200 Subject: [PATCH 3/3] refac --- backend/open_webui/env.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index a509fd1a0..26ccdf7ec 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -95,8 +95,10 @@ try: except importlib.metadata.PackageNotFoundError: pass -OVERRIDE_PIP_INSTALL = os.environ.get("OVERRIDE_PIP_INSTALL") -PIP_INSTALL = OVERRIDE_PIP_INSTALL if (OVERRIDE_PIP_INSTALL != None) else PIP_INSTALL + +PIP_INSTALL = ( + os.environ.get("PIP_INSTALL") if os.environ.get("PIP_INSTALL") else PIP_INSTALL +) if PIP_INSTALL: PACKAGE_DATA = {"version": importlib.metadata.version("open-webui")}