From ff18ad0f0367f1b540e66b6d9cfeef691fe06ee5 Mon Sep 17 00:00:00 2001 From: Toshi Pahadia Date: Tue, 29 Sep 2026 16:22:53 +0530 Subject: [PATCH] fix(docker): Fix nightly Docker build dependencies and modernize Google Cloud CLI - Upgrade base image to python:3.12-slim-bookworm in docker_build_dependency_image.sh and maxdiffusion_dependencies.Dockerfile - Replace retired google-cloud-sdk package with google-cloud-cli and modernize GPG keyring handling with gpg --dearmor - Consolidate APT update and install passes into a single RUN layer in maxdiffusion_dependencies.Dockerfile and maxdiffusion_gpu_dependencies.Dockerfile - Update stale comment in maxdiffusion_dependencies.Dockerfile to reference Python 3.12 - Format Wan SVG attention and AOT cache files with pyink --- docker_build_dependency_image.sh | 2 +- maxdiffusion_dependencies.Dockerfile | 23 +++++++++++------------ maxdiffusion_gpu_dependencies.Dockerfile | 20 ++++++++------------ 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/docker_build_dependency_image.sh b/docker_build_dependency_image.sh index 48685b56d..ab5512139 100644 --- a/docker_build_dependency_image.sh +++ b/docker_build_dependency_image.sh @@ -68,7 +68,7 @@ if [[ ${DEVICE} == "gpu" ]]; then docker build --network host --build-arg MODE=${MODE} --build-arg JAX_VERSION=$JAX_VERSION --build-arg DEVICE=$DEVICE --build-arg BASEIMAGE=$BASEIMAGE -f ./maxdiffusion_gpu_dependencies.Dockerfile -t ${LOCAL_IMAGE_NAME} . else # Default to maxdiffusion_dependencies.Dockerfile for non-GPU builds - export BASEIMAGE=${BASEIMAGE:-python:3.12-slim-bullseye} + export BASEIMAGE=${BASEIMAGE:-python:3.12-slim-bookworm} docker build --no-cache \ --network=host \ --build-arg MODE=${MODE} \ diff --git a/maxdiffusion_dependencies.Dockerfile b/maxdiffusion_dependencies.Dockerfile index a87430169..9f9a7d9c4 100644 --- a/maxdiffusion_dependencies.Dockerfile +++ b/maxdiffusion_dependencies.Dockerfile @@ -1,12 +1,12 @@ -# Use Python 3.12-slim-bullseye as the base image unless overridden -ARG BASEIMAGE=python:3.12-slim-bullseye +# Use Python 3.12-slim-bookworm as the base image unless overridden +ARG BASEIMAGE=python:3.12-slim-bookworm FROM $BASEIMAGE # Environment variable for no-cache-dir and pip root user warning ENV PIP_NO_CACHE_DIR=1 ENV PIP_ROOT_USER_ACTION=ignore -# Set environment variables for Google Cloud SDK and Python 3.10 +# Set environment variables for Google Cloud SDK and Python 3.12 ENV PYTHON_VERSION=3.12 ENV CLOUD_SDK_VERSION=latest @@ -16,15 +16,14 @@ ENV DEBIAN_FRONTEND=noninteractive # Upgrade pip to the latest version and install uv RUN python -m pip install --upgrade pip uv --no-warn-script-location -# Install system dependencies -RUN apt-get update && apt-get install -y apt-utils git curl gnupg procps iproute2 ethtool g++ && rm -rf /var/lib/apt/lists/* - -# Add the Google Cloud SDK package repository -RUN curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ - echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list - -# Install the Google Cloud SDK -RUN apt-get update && apt-get install -y google-cloud-sdk && rm -rf /var/lib/apt/lists/* +# Install system dependencies and the Google Cloud CLI +RUN apt-get update && \ + apt-get install -y apt-utils git curl gnupg procps iproute2 ethtool g++ && \ + curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list && \ + apt-get update && \ + apt-get install -y google-cloud-cli && \ + rm -rf /var/lib/apt/lists/* # Install diagnostic and storage dependencies using uv RUN python -m uv pip install --system \ diff --git a/maxdiffusion_gpu_dependencies.Dockerfile b/maxdiffusion_gpu_dependencies.Dockerfile index eebb09212..ba369cf52 100644 --- a/maxdiffusion_gpu_dependencies.Dockerfile +++ b/maxdiffusion_gpu_dependencies.Dockerfile @@ -6,18 +6,14 @@ FROM $BASEIMAGE # Stopgaps measure to circumvent gpg key setup issue. RUN echo "deb [trusted=yes] https://developer.download.nvidia.com/devtools/repos/ubuntu2204/amd64/ /" > /etc/apt/sources.list.d/devtools-ubuntu2204-amd64.list -# Install dependencies for adjusting network rto -RUN apt-get update && apt-get install -y iproute2 ethtool lsof - -# Install DNS util dependencies -RUN apt-get install -y dnsutils - -# Add the Google Cloud SDK package repository -RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list -RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - - -# Install the Google Cloud SDK -RUN apt-get update && apt-get install -y google-cloud-sdk +# Install system dependencies, network/DNS utilities, and Google Cloud CLI +RUN apt-get update && \ + apt-get install -y iproute2 ethtool lsof dnsutils curl gnupg && \ + curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ + apt-get update && \ + apt-get install -y google-cloud-cli && \ + rm -rf /var/lib/apt/lists/* # Set environment variables for Google Cloud SDK ENV PATH="/usr/local/google-cloud-sdk/bin:${PATH}"