From 25ca52ca0da85fd8a2363767658dc7eae025375c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 8 Jul 2026 16:44:59 +0000 Subject: [PATCH] Fix worker Docker builds for dnspython and py3.9 numpy pin dnspython 2.6.1 requires Python 3.8+, but worker_py3_7 and remote-worker images use Python 3.7. Override to dnspython 2.3.0 during those builds, matching the existing PyJWT version override pattern. Remove numpy==1.18.1 from the prod worker_py3_9 pre-install step. That pin is for older worker stacks and conflicts with scipy/sklearn in worker_py3_9.txt (numpy 1.26.4), causing metadata-generation failures. Co-authored-by: Rishabh Jain --- docker/dev/worker_py3_7/Dockerfile | 4 +++- docker/prod/worker_py3_7/Dockerfile | 4 +++- docker/prod/worker_py3_9/Dockerfile | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/dev/worker_py3_7/Dockerfile b/docker/dev/worker_py3_7/Dockerfile index 91cef20127..7725f0894e 100644 --- a/docker/dev/worker_py3_7/Dockerfile +++ b/docker/dev/worker_py3_7/Dockerfile @@ -49,7 +49,9 @@ WORKDIR /code COPY requirements/ /code/requirements/ # PyJWT>=2.10 requires Python 3.9+; pin a 3.7-compatible release for worker builds. -RUN sed -i 's/^PyJWT==.*/PyJWT==2.8.0/' /code/requirements/common.txt +# dnspython>=2.4 requires Python 3.8+; pin a 3.7-compatible release for worker builds. +RUN sed -i 's/^PyJWT==.*/PyJWT==2.8.0/' /code/requirements/common.txt && \ + sed -i 's/^dnspython==.*/dnspython==2.3.0/' /code/requirements/common.txt # Install Python dependencies with BuildKit cache mount RUN --mount=type=cache,target=/root/.cache/pip \ diff --git a/docker/prod/worker_py3_7/Dockerfile b/docker/prod/worker_py3_7/Dockerfile index a4d96cc81c..3bdd2dbc6e 100644 --- a/docker/prod/worker_py3_7/Dockerfile +++ b/docker/prod/worker_py3_7/Dockerfile @@ -65,7 +65,9 @@ WORKDIR /code COPY requirements/ /code/requirements/ # PyJWT>=2.10 requires Python 3.9+; pin a 3.7-compatible release for worker builds. -RUN sed -i 's/^PyJWT==.*/PyJWT==2.8.0/' /code/requirements/common.txt +# dnspython>=2.4 requires Python 3.8+; pin a 3.7-compatible release for worker builds. +RUN sed -i 's/^PyJWT==.*/PyJWT==2.8.0/' /code/requirements/common.txt && \ + sed -i 's/^dnspython==.*/dnspython==2.3.0/' /code/requirements/common.txt # Install Python dependencies with BuildKit cache mount RUN --mount=type=cache,target=/root/.cache/pip \ diff --git a/docker/prod/worker_py3_9/Dockerfile b/docker/prod/worker_py3_9/Dockerfile index 7784a00e2d..4519757c58 100644 --- a/docker/prod/worker_py3_9/Dockerfile +++ b/docker/prod/worker_py3_9/Dockerfile @@ -70,7 +70,7 @@ COPY requirements/ /code/requirements/ # Note: BuildKit cache mount persists outside container, but we clean internal cache for final image size # Install prerequisite packages first (needed for compiling native extensions) RUN --mount=type=cache,target=/root/.cache/pip \ - pip install --no-cache-dir --no-compile -U cffi service_identity cython==0.29.36 numpy==1.18.1 && \ + pip install --no-cache-dir --no-compile -U cffi service_identity cython==0.29.36 && \ pip install --no-cache-dir --no-compile -r requirements/prod.txt && \ pip install --no-cache-dir --no-compile -r requirements/worker_py3_9.txt