From a52b3dfbe598d5ef25e29bb02d0c91da977e584f Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Thu, 12 Feb 2026 13:08:25 -0600 Subject: [PATCH 1/2] fix: add support for legacy numpy in celery entrypoint --- docker/entrypoint.celery.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.celery.sh b/docker/entrypoint.celery.sh index 81cece86..e5c2f340 100644 --- a/docker/entrypoint.celery.sh +++ b/docker/entrypoint.celery.sh @@ -4,15 +4,32 @@ set -e cd /app source /dispatcharrpy/bin/activate +# Function to echo with timestamp +echo_with_timestamp() { + echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" +} + # Wait for Django secret key echo 'Waiting for Django secret key...' while [ ! -f /data/jwt ]; do sleep 1; done export DJANGO_SECRET_KEY="$(tr -d '\r\n' < /data/jwt)" +# --- NumPy version switching for legacy hardware --- +if [ "$USE_LEGACY_NUMPY" = "true" ]; then + # Check if NumPy was compiled with baseline support + if $VIRTUAL_ENV/bin/python -c "import numpy; numpy.show_config()" 2>&1 | grep -qi "baseline" || [ $? -ne 0 ]; then + echo_with_timestamp "🔧 Switching to legacy NumPy (no CPU baseline)..." + uv pip install --python $VIRTUAL_ENV/bin/python --no-cache --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 + # Wait for migrations to complete (check that NO unapplied migrations remain) echo 'Waiting for migrations to complete...' until ! python manage.py showmigrations 2>&1 | grep -q '\[ \]'; do - echo 'Migrations not ready yet, waiting...' + echo_with_timestamp 'Migrations not ready yet, waiting...' sleep 2 done From b1376386d5cd8862668aea4c61b27c55e954884f Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Tue, 17 Feb 2026 09:50:50 -0600 Subject: [PATCH 2/2] docs: add legacy NumPy support instructions in docker-compose --- docker/docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 519b288a..bb4397d4 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -117,6 +117,11 @@ services: # Process Priority Configuration (Optional) #- CELERY_NICE_LEVEL=5 # Celery/EPG/Background tasks (default: 5, low priority; Range: -20 to 19) + # Legacy CPU Support (Optional) + # Uncomment to enable legacy NumPy build for older CPUs (circa 2009) + # that lack support for newer baseline CPU features: + #- USE_LEGACY_NUMPY=true + # Django Configuration - DJANGO_SETTINGS_MODULE=dispatcharr.settings - PYTHONUNBUFFERED=1