From 6d5d16d6675a63bea72ed955f24cbb171ba99469 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 12 Jan 2026 12:29:54 -0600 Subject: [PATCH] Enhancement: Add check for existing NumPy baseline support before reinstalling legacy NumPy to avoid unnecessary installations. --- docker/entrypoint.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b28311fc..1622097b 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -29,9 +29,14 @@ echo_with_timestamp() { # --- NumPy version switching for legacy hardware --- if [ "$USE_LEGACY_NUMPY" = "true" ]; then - echo_with_timestamp "🔧 Switching to legacy NumPy (no CPU baseline)..." - /dispatcharrpy/bin/pip install --no-cache-dir --force-reinstall --no-deps /opt/numpy-*.whl - echo_with_timestamp "✅ Legacy NumPy installed" + # Check if NumPy was compiled with baseline support + if /dispatcharrpy/bin/python -c "import numpy; print(str(numpy.show_config()).lower())" 2>/dev/null | grep -q "baseline"; then + echo_with_timestamp "🔧 Switching to legacy NumPy (no CPU baseline)..." + /dispatcharrpy/bin/pip install --no-cache-dir --force-reinstall --no-deps /opt/numpy-*.whl + echo_with_timestamp "✅ Legacy NumPy installed" + else + echo_with_timestamp "✅ Legacy NumPy (no baseline) already installed, skipping reinstallation" + fi fi # Set PostgreSQL environment variables