mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(proxy): keep Prisma migrations offline on arm64
This commit is contained in:
parent
b200d664ee
commit
ff5fae6639
2 changed files with 8 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ def _get_prisma_env() -> dict:
|
|||
prisma_env = os.environ.copy()
|
||||
if str_to_bool(os.getenv("PRISMA_OFFLINE_MODE")):
|
||||
# These env vars prevent Prisma from attempting downloads
|
||||
prisma_env.setdefault("PRISMA_CLI_QUERY_ENGINE_TYPE", "binary")
|
||||
prisma_env["NPM_CONFIG_PREFER_OFFLINE"] = "true"
|
||||
prisma_env["NPM_CONFIG_CACHE"] = os.getenv(
|
||||
"NPM_CONFIG_CACHE", "/app/.cache/npm"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import pytest
|
|||
|
||||
from litellm_proxy_extras.utils import (
|
||||
ProxyExtrasDBManager,
|
||||
_get_prisma_env,
|
||||
_max_migration_timestamp,
|
||||
_migration_timestamp,
|
||||
)
|
||||
|
|
@ -29,6 +30,12 @@ def _fake_migrate_deploy_failure(returncode: int, stderr: str):
|
|||
return _run
|
||||
|
||||
|
||||
def test_prisma_offline_mode_uses_cached_binary_engine(monkeypatch):
|
||||
monkeypatch.setenv("PRISMA_OFFLINE_MODE", "true")
|
||||
|
||||
assert _get_prisma_env()["PRISMA_CLI_QUERY_ENGINE_TYPE"] == "binary"
|
||||
|
||||
|
||||
def test_v2_p3018_permission_error_raises_runtime_error(monkeypatch, tmp_path):
|
||||
"""v2: a permission failure during migrate deploy raises RuntimeError."""
|
||||
monkeypatch.setenv("DATABASE_URL", "postgresql://u:p@localhost:9/x")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue