From eae9dbb400fda8cd9ba3f8c327329462119683cd Mon Sep 17 00:00:00 2001 From: kaenafwi Date: Thu, 12 Nov 2026 00:51:34 +0000 Subject: [PATCH] Updated Dockerfiles based on build artifacts uploaded to the Neuron DLC Builder prod account --- jax/training/0.10.0/Dockerfile.neuronx | 18 ++++++++-- .../torch-neuronx/2.14.0/Dockerfile.neuronx | 36 +++++++++++-------- .../inference/0.29.0.0.2.0/Dockerfile.neuronx | 34 +++++++++--------- .../inference/0.29.0.1.2.0/Dockerfile.neuronx | 34 +++++++++--------- 4 files changed, 72 insertions(+), 50 deletions(-) diff --git a/jax/training/0.10.0/Dockerfile.neuronx b/jax/training/0.10.0/Dockerfile.neuronx index dfbc394..899cbd7 100644 --- a/jax/training/0.10.0/Dockerfile.neuronx +++ b/jax/training/0.10.0/Dockerfile.neuronx @@ -5,6 +5,15 @@ FROM public.ecr.aws/docker/library/ubuntu:26.04 AS base LABEL dlc_major_version="1" LABEL maintainer="Amazon AI" +# SageMaker DLC identification labels. Read by SageMaker/JumpStart tooling to +# identify the container's accelerator, framework, runtime, and OS. +LABEL com.amazonaws.ml.engines.sagemaker.dlc.device.neuron="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.arch.x86="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.python.py314="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.os.ubuntu26-04="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.job.training="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.jax.0-10-0="true" + # Keep apt non-interactive so tzdata's timezone/region prompt can't stall the build ARG DEBIAN_FRONTEND=noninteractive ARG PYTHON=python3.14 @@ -129,6 +138,7 @@ RUN apt-get update \ && cd aws-efa-installer \ && ./efa_installer.sh -y -g --skip-kmod --skip-limit-conf --no-verify \ && cd $HOME \ + && rm -rf $HOME/aws-efa-installer $HOME/aws-efa-installer-latest.tar.gz* $HOME/aws-efa-installer.key \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/tmp* \ && apt-get clean @@ -168,12 +178,12 @@ RUN --mount=type=secret,id=neuron_repo \ && curl $([ -n "${NEURON_REPO_CRED}" ] && echo "-u ${NEURON_REPO_CRED}") --retry 3 --retry-delay 1 --retry-all-errors -fSL "https://${NEURON_APT_REPO}/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB" | gpg --dearmor > /etc/apt/keyrings/neuron.gpg # Neuron SDK components version numbers -ARG NEURONX_RUNTIME_LIB_VERSION=2.35.30.0-d2725ccb8 -ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.43.0-354ad3064 +ARG NEURONX_RUNTIME_LIB_VERSION=2.35.33.0-d2725ccb8 +ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.49.0-354ad3064 ARG NEURONX_TOOLS_VERSION=2.33.38.0-f874d5618 ARG NEURONX_CC_VERSION=2.28.7631.0+8f7b0cf5 -ARG NEURONX_JAX_TRAINING_VERSION=0.10.0.1.0.14198+40d442c2 +ARG NEURONX_JAX_TRAINING_VERSION=0.10.0.1.0.15472+40d442c2 ARG NKI_VERSION=0.7.0+37713544100.gfede04bb ARG NEURON_AGENTIC_DEVELOPMENT_VERSION=1.4 @@ -260,6 +270,8 @@ RUN rm -f /etc/apt/sources.list.d/neuron.list /etc/apt/keyrings/neuron.gpg \ && rm -rf /var/lib/apt/lists/* \ && apt-get clean +RUN find /usr/local/lib/python*/site-packages -path '*/neuron_agentic_development/*' -name 'requirements*.txt' -delete 2>/dev/null || true + # Starts framework ENTRYPOINT ["bash", "-m", "start_with_right_hostname.sh"] CMD ["/bin/bash"] diff --git a/pytorch/torch-neuronx/2.14.0/Dockerfile.neuronx b/pytorch/torch-neuronx/2.14.0/Dockerfile.neuronx index c75be9d..d10634b 100644 --- a/pytorch/torch-neuronx/2.14.0/Dockerfile.neuronx +++ b/pytorch/torch-neuronx/2.14.0/Dockerfile.neuronx @@ -5,11 +5,21 @@ FROM public.ecr.aws/docker/library/ubuntu:26.04 AS base LABEL maintainer="Amazon AI" LABEL dlc_major_version="1" +# SageMaker DLC identification labels. Read by SageMaker/JumpStart tooling to +# identify the container's accelerator, framework, runtime, and OS. +LABEL com.amazonaws.ml.engines.sagemaker.dlc.device.neuron="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.arch.x86="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.python.py314="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.os.ubuntu26-04="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.job.training="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.pytorch.2-14-0="true" + ARG PYTHON=python3.14 ARG PYTHON_VERSION=3.14.7 ARG PIP=pip3 ARG OMPI_VERSION=4.1.5 ARG PYPI_SIMPLE_URL="https://pypi.org/simple/" +ARG TORCH_CPU_INDEX_URL="https://download.pytorch.org/whl/cpu" # Keep apt non-interactive so tzdata's timezone/region prompt can't stall the build ARG DEBIAN_FRONTEND=noninteractive @@ -150,18 +160,11 @@ RUN apt-get update \ && cd aws-efa-installer \ && ./efa_installer.sh -y -g --skip-kmod --skip-limit-conf --no-verify \ && cd $HOME \ + && rm -rf $HOME/aws-efa-installer $HOME/aws-efa-installer-latest.tar.gz* $HOME/aws-efa-installer.key \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/tmp* \ && apt-get clean -# Install some common packages used by training scripts -# Needed for running bert training scripts -RUN pip3 install --no-cache-dir -U \ - graphviz \ - tensorboard \ - accelerate \ - && rm -rf ~/.cache/pip/* - # Copy workaround script for incorrect hostname COPY changehostname.c / COPY --chmod=755 start_with_right_hostname.sh deep_learning_container.py /usr/local/bin/ @@ -188,8 +191,8 @@ RUN --mount=type=secret,id=neuron_repo \ && curl $([ -n "${NEURON_REPO_CRED}" ] && echo "-u ${NEURON_REPO_CRED}") --retry 3 --retry-delay 1 --retry-all-errors -fSL "https://${NEURON_APT_REPO}/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB" | gpg --dearmor > /etc/apt/keyrings/neuron.gpg # Neuron SDK components -ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.43.0-354ad3064 -ARG NEURONX_RUNTIME_LIB_VERSION=2.35.30.0-d2725ccb8 +ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.49.0-354ad3064 +ARG NEURONX_RUNTIME_LIB_VERSION=2.35.33.0-d2725ccb8 ARG NEURONX_TOOLS_VERSION=2.33.38.0-f874d5618 ARG NEURONX_CC_VERSION=2.28.7631.0+8f7b0cf5 @@ -252,12 +255,14 @@ RUN --mount=type=secret,id=neuron_repo \ --index-url ${PIP_REPO_URL} \ --trusted-host ${NEURON_PIP_REPO} \ --extra-index-url ${PYPI_SIMPLE_URL} \ + --extra-index-url ${TORCH_CPU_INDEX_URL} \ neuronx-cc \ nki \ neuron_agentic_development \ -e . \ && ./tools/build --python "${PYTHON#python}" \ - && rm -rf ~/.cache/pip/* + && rm -rf ~/.cache/pip/* ~/.cache/bazel ~/.cache/bazel-torch-neuronx ~/.cache/uv \ + /workspace/torch_neuronx/.venv /workspace/torch_neuronx/uv.lock # Pin torch to the version torch-neuronx was just built against for all later pip installs # in this image (prevents an unconstrained dep, e.g. torchdata, from upgrading torch). @@ -304,12 +309,14 @@ RUN --mount=type=secret,id=neuron_repo \ --index-url ${PIP_REPO_URL} \ --trusted-host ${NEURON_PIP_REPO} \ --extra-index-url ${PYPI_SIMPLE_URL} \ + --extra-index-url ${TORCH_CPU_INDEX_URL} \ neuronx-cc==$NEURONX_CC_VERSION \ nki==$NKI_VERSION \ neuron_agentic_development==$NEURON_AGENTIC_DEVELOPMENT_VERSION \ -e . \ && ./tools/build --python "${PYTHON#python}" \ - && rm -rf ~/.cache/pip/* + && rm -rf ~/.cache/pip/* ~/.cache/bazel ~/.cache/bazel-torch-neuronx ~/.cache/uv \ + /workspace/torch_neuronx/.venv /workspace/torch_neuronx/uv.lock # Pin torch to the version torch-neuronx was just built against for all later pip installs # in this image (prevents an unconstrained dep, e.g. torchdata, from upgrading torch). @@ -336,9 +343,8 @@ RUN rm -rf \ /workspace/torch_neuronx/.github \ /workspace/torch_neuronx/.internal_docs \ /workspace/torchtitan_neuron/.github \ - && find /workspace/torch_neuronx -depth -type d -name .git -exec rm -rf {} + 2>/dev/null || true \ - && find /workspace/torchtitan_neuron -depth -type d -name .git -exec rm -rf {} + 2>/dev/null || true \ - && find /workspace/torch_neuronx -name 'requirements*.txt' -delete 2>/dev/null || true + && find /workspace/torch_neuronx /workspace/torchtitan_neuron -name 'requirements*.txt' -delete 2>/dev/null || true \ + && find /usr/local/lib/python*/site-packages -path '*/neuron_agentic_development/*' -name 'requirements*.txt' -delete 2>/dev/null || true # Upgrade OS packages to latest versions RUN rm -f /etc/apt/sources.list.d/neuron.list /etc/apt/keyrings/neuron.gpg \ diff --git a/vllm-omni/inference/0.29.0.0.2.0/Dockerfile.neuronx b/vllm-omni/inference/0.29.0.0.2.0/Dockerfile.neuronx index de4fbbe..94e4d09 100644 --- a/vllm-omni/inference/0.29.0.0.2.0/Dockerfile.neuronx +++ b/vllm-omni/inference/0.29.0.0.2.0/Dockerfile.neuronx @@ -5,12 +5,20 @@ FROM public.ecr.aws/docker/library/ubuntu:26.04 AS base LABEL dlc_major_version="1" LABEL maintainer="Amazon AI" +# SageMaker DLC identification labels. Read by SageMaker/JumpStart tooling to +# identify the container's accelerator, framework, runtime, and OS. +LABEL com.amazonaws.ml.engines.sagemaker.dlc.device.neuron="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.arch.x86="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.python.py313="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.os.ubuntu26-04="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.job.inference="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.vllm-omni.0-29-0-0-2-0="true" + # Keep apt non-interactive so tzdata's timezone/region prompt can't stall the build ARG DEBIAN_FRONTEND=noninteractive ARG PIP=pip3 ARG PYTHON=python3.13 ARG PYTHON_VERSION=3.13.13 -ARG TORCHSERVE_VERSION=0.11.0 ARG PYPI_SIMPLE_URL="https://pypi.org/simple/" @@ -47,7 +55,6 @@ RUN apt-get update \ libcap-dev \ libhwloc-dev \ openssh-client \ - openjdk-11-jdk \ unzip \ wget \ zlib1g-dev \ @@ -56,11 +63,6 @@ RUN apt-get update \ && apt-get clean -# https://github.com/docker-library/openjdk/issues/261 https://github.com/docker-library/openjdk/pull/263/files -RUN keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /etc/ssl/certs/java/cacerts.jks -deststoretype JKS -srcstorepass changeit -deststorepass changeit -noprompt; \ - mv /etc/ssl/certs/java/cacerts.jks /etc/ssl/certs/java/cacerts; \ - /var/lib/dpkg/info/ca-certificates-java.postinst configure; - RUN curl -L -o ~/miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh \ && chmod +x ~/miniforge.sh \ && ~/miniforge.sh -b -p /opt/conda \ @@ -102,6 +104,7 @@ RUN apt-get update \ && cd aws-efa-installer \ && ./efa_installer.sh -y -g --skip-kmod --skip-limit-conf --no-verify \ && cd $HOME \ + && rm -rf $HOME/aws-efa-installer $HOME/aws-efa-installer-latest.tar.gz* $HOME/aws-efa-installer.key \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/tmp* \ && apt-get clean @@ -147,14 +150,9 @@ RUN ${PIP} install --no-cache-dir -U \ "wheel" \ "jinja2" \ uv \ - torchserve==${TORCHSERVE_VERSION} \ - torch-model-archiver==${TORCHSERVE_VERSION} \ && rm -rf ~/.cache/pip/* -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp /opt/ml/model \ - && chown -R model-server /home/model-server /opt/ml/model -COPY config.properties /home/model-server +RUN mkdir -p /opt/ml/model # Compliance RUN HOME_DIR=/root \ @@ -178,14 +176,14 @@ RUN --mount=type=secret,id=neuron_repo \ && curl $([ -n "${NEURON_REPO_CRED}" ] && echo "-u ${NEURON_REPO_CRED}") --retry 3 --retry-delay 1 --retry-all-errors -fSL "https://${NEURON_APT_REPO}/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB" | gpg --dearmor > /etc/apt/keyrings/neuron.gpg # Neuron SDK components version numbers -ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.43.0-354ad3064 -ARG NEURONX_RUNTIME_LIB_VERSION=2.35.30.0-d2725ccb8 +ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.49.0-354ad3064 +ARG NEURONX_RUNTIME_LIB_VERSION=2.35.33.0-d2725ccb8 ARG NEURONX_TOOLS_VERSION=2.33.38.0-f874d5618 ARG NEURONX_CC_VERSION=2.28.7631.0+8f7b0cf5 ARG NKI_VERSION=0.7.0+37713544100.gfede04bb ARG NEURON_AGENTIC_DEVELOPMENT_VERSION=1.4 -ARG LIBTORCH_NEURONX_LITE_VERSION=2.13.0.1.0.3112+653bc48f +ARG LIBTORCH_NEURONX_LITE_VERSION=2.13.0.1.0.4089+71ce3449 # Primary repo: vllm-omni-neuron ARG GITHUB_REPO=https://github.com/aws-neuron/vllm-omni-neuron.git @@ -305,6 +303,10 @@ RUN conda config --set solver libmamba \ && conda clean -ya \ && rm -rf /opt/conda/pkgs/* +RUN find /opt/conda/lib/python*/site-packages -path '*/neuron_agentic_development/*' -name 'requirements*.txt' -delete 2>/dev/null || true \ + && rm -f /opt/conda/lib/python*/site-packages/benchmarks/requirements.txt \ + /opt/conda/lib/python*/site-packages/samples/requirements.txt + EXPOSE 8080 8081 ENTRYPOINT ["python", "/usr/local/bin/vllm_entrypoint.py"] diff --git a/vllm/inference/0.29.0.1.2.0/Dockerfile.neuronx b/vllm/inference/0.29.0.1.2.0/Dockerfile.neuronx index 7ec4ce8..c392440 100644 --- a/vllm/inference/0.29.0.1.2.0/Dockerfile.neuronx +++ b/vllm/inference/0.29.0.1.2.0/Dockerfile.neuronx @@ -5,12 +5,20 @@ FROM public.ecr.aws/docker/library/ubuntu:26.04 AS base LABEL dlc_major_version="1" LABEL maintainer="Amazon AI" +# SageMaker DLC identification labels. Read by SageMaker/JumpStart tooling to +# identify the container's accelerator, framework, runtime, and OS. +LABEL com.amazonaws.ml.engines.sagemaker.dlc.device.neuron="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.arch.x86="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.python.py314="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.os.ubuntu26-04="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.job.inference="true" +LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.vllm.0-29-0-1-2-0="true" + # Keep apt non-interactive so tzdata's timezone/region prompt can't stall the build ARG DEBIAN_FRONTEND=noninteractive ARG PIP=pip3 ARG PYTHON=python3.14 ARG PYTHON_VERSION=3.14.7 -ARG TORCHSERVE_VERSION=0.11.0 ARG PYPI_SIMPLE_URL="https://pypi.org/simple/" @@ -47,7 +55,6 @@ RUN apt-get update \ libcap-dev \ libhwloc-dev \ openssh-client \ - openjdk-11-jdk \ unzip \ wget \ zlib1g-dev \ @@ -56,11 +63,6 @@ RUN apt-get update \ && apt-get clean -# https://github.com/docker-library/openjdk/issues/261 https://github.com/docker-library/openjdk/pull/263/files -RUN keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /etc/ssl/certs/java/cacerts.jks -deststoretype JKS -srcstorepass changeit -deststorepass changeit -noprompt; \ - mv /etc/ssl/certs/java/cacerts.jks /etc/ssl/certs/java/cacerts; \ - /var/lib/dpkg/info/ca-certificates-java.postinst configure; - RUN curl -L -o ~/miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh \ && chmod +x ~/miniforge.sh \ && ~/miniforge.sh -b -p /opt/conda \ @@ -102,6 +104,7 @@ RUN apt-get update \ && cd aws-efa-installer \ && ./efa_installer.sh -y -g --skip-kmod --skip-limit-conf --no-verify \ && cd $HOME \ + && rm -rf $HOME/aws-efa-installer $HOME/aws-efa-installer-latest.tar.gz* $HOME/aws-efa-installer.key \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/tmp* \ && apt-get clean @@ -147,14 +150,9 @@ RUN ${PIP} install --no-cache-dir -U \ "wheel" \ "jinja2" \ uv \ - torchserve==${TORCHSERVE_VERSION} \ - torch-model-archiver==${TORCHSERVE_VERSION} \ && rm -rf ~/.cache/pip/* -RUN useradd -m model-server \ - && mkdir -p /home/model-server/tmp /opt/ml/model \ - && chown -R model-server /home/model-server /opt/ml/model -COPY config.properties /home/model-server +RUN mkdir -p /opt/ml/model # Compliance RUN HOME_DIR=/root \ @@ -178,14 +176,14 @@ RUN --mount=type=secret,id=neuron_repo \ && curl $([ -n "${NEURON_REPO_CRED}" ] && echo "-u ${NEURON_REPO_CRED}") --retry 3 --retry-delay 1 --retry-all-errors -fSL "https://${NEURON_APT_REPO}/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB" | gpg --dearmor > /etc/apt/keyrings/neuron.gpg # Neuron SDK components version numbers -ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.43.0-354ad3064 -ARG NEURONX_RUNTIME_LIB_VERSION=2.35.30.0-d2725ccb8 +ARG NEURONX_COLLECTIVES_LIB_VERSION=2.35.49.0-354ad3064 +ARG NEURONX_RUNTIME_LIB_VERSION=2.35.33.0-d2725ccb8 ARG NEURONX_TOOLS_VERSION=2.33.38.0-f874d5618 ARG NEURONX_CC_VERSION=2.28.7631.0+8f7b0cf5 ARG NKI_VERSION=0.7.0+37713544100.gfede04bb ARG NEURON_AGENTIC_DEVELOPMENT_VERSION=1.4 -ARG LIBTORCH_NEURONX_LITE_VERSION=2.13.0.1.0.3112+653bc48f +ARG LIBTORCH_NEURONX_LITE_VERSION=2.13.0.1.0.4089+71ce3449 # GitHub repository and branch ARG GITHUB_REPO=https://github.com/vllm-project/vllm-neuron.git @@ -293,6 +291,10 @@ RUN conda config --set solver libmamba \ && conda clean -ya \ && rm -rf /opt/conda/pkgs/* +RUN find /opt/conda/lib/python*/site-packages -path '*/neuron_agentic_development/*' -name 'requirements*.txt' -delete 2>/dev/null || true \ + && rm -f /opt/conda/lib/python*/site-packages/benchmarks/requirements.txt \ + /opt/conda/lib/python*/site-packages/samples/requirements.txt + EXPOSE 8080 8081 ENTRYPOINT ["python", "/usr/local/bin/vllm_entrypoint.py"]