mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
* chore(build): move the Admin UI toolchain to Node 24 Node 18 and Node 20 both reached end of life (2025-04-30 and 2026-04-30), and the release images along with every CI lane were still building on them. Node 24 is the current LTS through 2028-04-30, so this moves the four UI build images, the CircleCI lanes, and the four GitHub Actions workflows onto it Node 24 also ships npm 11.17, which is the first line that implements the min-release-age setting this repo already carries in its .npmrc files. On npm 10 the key is parsed and discarded, so the release-age gate has had no effect regardless of its value. Tightening the dashboard's engines range and turning on engine-strict makes an unsupported npm fail loudly rather than skip the gate quietly, and a new step in the UI build workflow probes an impossible cooldown so an inert setting cannot pass unnoticed again Node 24's bundled undici tightened its brand check on RequestInit.signal, which rejects the AbortSignal jsdom installs and broke the two cases in src/lib/http/api.test.ts that rebase a request onto a runtime base url. Under jsdom the Request global comes from Node while AbortSignal comes from jsdom; tests/jsdomFetchEnv.ts delegates to the jsdom environment and then restores Node's native AbortController and AbortSignal so both come from one realm. Upgrading jsdom does not address this, as jsdom still does not own Request The workflows now read ui/litellm-dashboard/.nvmrc instead of repeating a literal, so the Node version has a single source of truth, and ui/Dockerfile is pinned by digest to match the other three build images. The lockfile changes are npm 11 normalising the engines range and dropping optional peer entries it no longer records * fix(build): point every Admin UI build script at .nvmrc The enterprise Docker path was left on Node 18. docker/build_admin_ui.sh runs only when enterprise/enterprise_ui/enterprise_colors.json is present, which it never is in the OSS tree, so neither CI nor a default image build reaches it; it pinned nvm to v18.17.0 and then built the dashboard, which now requires Node 24, so a customized enterprise image would have failed EBADENGINE All three UI build scripts now resolve the version from ui/litellm-dashboard/.nvmrc rather than carrying their own pin, so the Node version has a single home across Docker, CI, and local builds. build_ui.sh was on v20 and build_ui_custom_path.sh on v18.17.0 Also drops the dependency-cooldown probe from the UI build workflow. The engines floor plus engine-strict already fails an unsupported npm loudly at install time, so the probe was redundant, and treating any nonzero exit from a live registry call as proof of enforcement made it unsound besides
72 lines
No EOL
1.9 KiB
Bash
Executable file
72 lines
No EOL
1.9 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# # try except this script
|
|
# set -e
|
|
|
|
# print current dir
|
|
echo
|
|
pwd
|
|
|
|
|
|
# only run this step for litellm enterprise, we run this if enterprise/enterprise_ui/_enterprise.json exists
|
|
if [ ! -f "enterprise/enterprise_ui/enterprise_colors.json" ]; then
|
|
echo "Admin UI - using default LiteLLM UI"
|
|
exit 0
|
|
fi
|
|
|
|
echo "Building Custom Admin UI..."
|
|
|
|
# Install dependencies
|
|
# Check if we are on macOS
|
|
if [[ "$(uname)" == "Darwin" ]]; then
|
|
# Install dependencies using Homebrew
|
|
if ! command -v brew &> /dev/null; then
|
|
echo "Error: Homebrew not found. Please install Homebrew and try again."
|
|
exit 1
|
|
fi
|
|
brew update
|
|
brew install curl
|
|
else
|
|
# Assume Linux, try using apt-get
|
|
if command -v apt-get &> /dev/null; then
|
|
apt-get update
|
|
apt-get install -y curl
|
|
elif command -v apk &> /dev/null; then
|
|
# Try using apk if apt-get is not available
|
|
apk update
|
|
apk add curl
|
|
else
|
|
echo "Error: Unsupported package manager. Cannot install dependencies."
|
|
exit 1
|
|
fi
|
|
fi
|
|
NVM_VERSION="v0.40.4"
|
|
NVM_CHECKSUM="4b7412c49960c7d31e8df72da90c1fb5b8cccb419ac99537b737028d497aba4f"
|
|
NVM_SCRIPT=$(mktemp)
|
|
trap 'rm -f "$NVM_SCRIPT"' EXIT
|
|
curl -fsSL "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" -o "$NVM_SCRIPT"
|
|
if command -v sha256sum &>/dev/null; then
|
|
echo "${NVM_CHECKSUM} ${NVM_SCRIPT}" | sha256sum -c -
|
|
elif command -v shasum &>/dev/null; then
|
|
echo "${NVM_CHECKSUM} ${NVM_SCRIPT}" | shasum -a 256 -c -
|
|
else
|
|
echo "No sha256 tool found; cannot verify nvm checksum"; exit 1
|
|
fi || { echo "nvm checksum verification failed"; exit 1; }
|
|
bash "$NVM_SCRIPT"
|
|
source ~/.nvm/nvm.sh
|
|
NODE_VERSION="$(cat ui/litellm-dashboard/.nvmrc)"
|
|
nvm install "v${NODE_VERSION}"
|
|
nvm use "v${NODE_VERSION}"
|
|
|
|
|
|
# cd in to /ui/litellm-dashboard
|
|
cd ui/litellm-dashboard
|
|
|
|
# ensure have access to build_ui.sh
|
|
chmod +x ./build_ui.sh
|
|
|
|
# run ./build_ui.sh
|
|
./build_ui.sh
|
|
|
|
# return to root directory
|
|
cd ../.. |