diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index fd37691174..6fd59f4b41 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -16,6 +16,9 @@ concurrency: group: frontend-${{ github.ref }} cancel-in-progress: true +env: + ONNXRUNTIME_NODE_INSTALL_CUDA: skip + jobs: # ── Format, i18n, and production build ──────────────────────────────────── format-and-build: diff --git a/Dockerfile b/Dockerfile index c7fb201b4f..4186ce1f9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,8 @@ WORKDIR /app RUN apk add --no-cache git COPY package.json package-lock.json ./ -RUN npm ci --force +# the frontend build never uses onnxruntime-node's CUDA binaries +RUN ONNXRUNTIME_NODE_INSTALL_CUDA=skip npm ci --force COPY . . ENV APP_BUILD_HASH=${BUILD_HASH} diff --git a/hatch_build.py b/hatch_build.py index 623b368b78..4565377d0e 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -15,6 +15,7 @@ class CustomBuildHook(BuildHookInterface): if npm is None: raise RuntimeError('NodeJS `npm` is required for building Open Webui but it was not found') stderr.write('### npm install\n') + os.environ.setdefault('ONNXRUNTIME_NODE_INSTALL_CUDA', 'skip') subprocess.run([npm, 'install', '--force'], check=True) # noqa: S603 stderr.write('\n### npm run build\n') node_options = os.environ.get('NODE_OPTIONS', '')