Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions jax/training/0.7/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ENV PYTHONIOENCODING=UTF-8
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/aws/neuron/lib"

Check warning on line 23 in jax/training/0.7/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (0.7, jax/training/0.7)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/amazon/efa/lib"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/amazon/efa/lib64"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/amazon/openmpi/lib64"
Expand Down Expand Up @@ -106,6 +106,7 @@
pip \
requests \
setuptools \
uv \
&& rm -rf ~/.cache/pip/*

# U24 will not allow installation of pip packages outside of venv without this flag
Expand Down Expand Up @@ -156,20 +157,22 @@

# Setting up APT and PIP repo for neuron artifacts
ARG NEURON_APT_REPO=apt.repos.neuron.amazonaws.com
ARG NEURON_APT_REPO_KEY

Check warning on line 160 in jax/training/0.7/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (0.7, jax/training/0.7)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_APT_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG NEURON_PIP_REPO=pip.repos.neuron.amazonaws.com
ARG NEURON_PIP_REPO_KEY

Check warning on line 162 in jax/training/0.7/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (0.7, jax/training/0.7)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_PIP_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
RUN mkdir -p /etc/apt/keyrings \
&& APT_REPO_PREFIX=$([ -n "${NEURON_APT_REPO_KEY}" ] && echo "${NEURON_APT_REPO_KEY}@" || echo "") \
&& echo "deb [signed-by=/etc/apt/keyrings/neuron.gpg] https://${APT_REPO_PREFIX}${NEURON_APT_REPO} jammy main" > /etc/apt/sources.list.d/neuron.list \
&& curl $([ -n "${NEURON_APT_REPO_KEY}" ] && echo "-u ${NEURON_APT_REPO_KEY}") --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.29.40.0-f954cd7a5
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.29.41.0-681fef5f5
ARG NEURONX_TOOLS_VERSION=2.27.33.0-5d9c0b901
ARG NEURONX_CC_VERSION=2.22.12471.0+b4a00d10
ARG NEURONX_JAX_TRAINING_VERSION=0.7.0.1.0.7377+5e6a4049
ARG NEURONX_RUNTIME_LIB_VERSION=2.30.51.0-faafe26f0
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.30.59.0-f5cdefb39
ARG NEURONX_TOOLS_VERSION=2.28.23.0-f1c114a9d

ARG NEURONX_CC_VERSION=2.23.6484.0+3b612583
ARG NEURONX_JAX_TRAINING_VERSION=0.7.0.1.0.7584+5c8f4c3c
ARG NKI_VERSION=0.2.0+g82fdb402

FROM base AS repo

Expand All @@ -190,6 +193,7 @@
--trusted-host ${NEURON_PIP_REPO} \
"neuronx-cc>=2.0" \
jax-neuronx \
nki \
&& rm -rf ~/.cache/pip/*

FROM base AS prod
Expand All @@ -213,6 +217,7 @@
--extra-index-url ${PYPI_SIMPLE_URL} \
neuronx-cc==$NEURONX_CC_VERSION \
jax-neuronx==$NEURONX_JAX_TRAINING_VERSION \
nki==$NKI_VERSION \
&& rm -rf ~/.cache/pip/*

FROM ${BUILD_STAGE} AS final
Expand Down
18 changes: 11 additions & 7 deletions pytorch/inference/2.9.0/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# See http://bugs.python.org/issue19846
ENV LANG=C.UTF-8
ENV LD_LIBRARY_PATH=/opt/aws/neuron/lib:/lib/x86_64-linux-gnu:/opt/conda/lib/:$LD_LIBRARY_PATH

Check warning on line 19 in pytorch/inference/2.9.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (2.9.0, pytorch/inference/2.9.0)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV PATH=/opt/conda/bin:/opt/aws/neuron/bin:$PATH

RUN apt-get update \
Expand Down Expand Up @@ -125,6 +125,7 @@
"awscli<2" \
pandas \
boto3 \
uv \
cryptography \
"protobuf>=3.18.3,<4" \
torchserve==${TORCHSERVE_VERSION} \
Expand Down Expand Up @@ -166,23 +167,24 @@

# Setting up APT and PIP repo for neuron artifacts
ARG NEURON_APT_REPO=apt.repos.neuron.amazonaws.com
ARG NEURON_APT_REPO_KEY

Check warning on line 170 in pytorch/inference/2.9.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (2.9.0, pytorch/inference/2.9.0)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_APT_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG NEURON_PIP_REPO=pip.repos.neuron.amazonaws.com
ARG NEURON_PIP_REPO_KEY

Check warning on line 172 in pytorch/inference/2.9.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (2.9.0, pytorch/inference/2.9.0)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_PIP_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
RUN mkdir -p /etc/apt/keyrings \
&& APT_REPO_PREFIX=$([ -n "${NEURON_APT_REPO_KEY}" ] && echo "${NEURON_APT_REPO_KEY}@" || echo "") \
&& echo "deb [signed-by=/etc/apt/keyrings/neuron.gpg] https://${APT_REPO_PREFIX}${NEURON_APT_REPO} jammy main" > /etc/apt/sources.list.d/neuron.list \
&& curl $([ -n "${NEURON_APT_REPO_KEY}" ] && echo "-u ${NEURON_APT_REPO_KEY}") --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.29.41.0-681fef5f5
ARG NEURONX_RUNTIME_LIB_VERSION=2.29.40.0-f954cd7a5
ARG NEURONX_TOOLS_VERSION=2.27.33.0-5d9c0b901
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.30.59.0-f5cdefb39
ARG NEURONX_RUNTIME_LIB_VERSION=2.30.51.0-faafe26f0
ARG NEURONX_TOOLS_VERSION=2.28.23.0-f1c114a9d

ARG NEURONX_CC_VERSION=2.22.12471.0+b4a00d10
ARG NEURONX_FRAMEWORK_VERSION=2.9.0.2.11.19912+e48cd891
ARG NEURONX_DISTRIBUTED_VERSION=0.16.25997+f431c02e
ARG NEURONX_DISTRIBUTED_INFERENCE_VERSION=0.7.15063+bafa28d5
ARG NEURONX_CC_VERSION=2.23.6484.0+3b612583
ARG NEURONX_FRAMEWORK_VERSION=2.9.0.2.12.22436+0f1dac25
ARG NEURONX_DISTRIBUTED_VERSION=0.17.26814+4b18de63
ARG NEURONX_DISTRIBUTED_INFERENCE_VERSION=0.8.16251+f3ca5575
ARG NKI_VERSION=0.2.0+g82fdb402

FROM base AS repo

Expand All @@ -205,6 +207,7 @@
"torch-neuronx==2.9.*" \
neuronx_distributed \
neuronx_distributed_inference \
nki \
&& rm -rf ~/.cache/pip/*

FROM base AS prod
Expand All @@ -228,6 +231,7 @@
torch-neuronx==$NEURONX_FRAMEWORK_VERSION \
neuronx_distributed==$NEURONX_DISTRIBUTED_VERSION \
neuronx_distributed_inference==$NEURONX_DISTRIBUTED_INFERENCE_VERSION \
nki==$NKI_VERSION \
&& rm -rf ~/.cache/pip/*

FROM ${BUILD_STAGE} AS final
Expand Down
17 changes: 11 additions & 6 deletions pytorch/training/2.9.0/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
ENV PYTHONIOENCODING=UTF-8
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/aws/neuron/lib"

Check warning on line 24 in pytorch/training/2.9.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (2.9.0, pytorch/training/2.9.0)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/amazon/efa/lib"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/amazon/efa/lib64"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/amazon/openmpi/lib64"
Expand Down Expand Up @@ -128,6 +128,7 @@
psutil==5.6.7 \
dataset \
Pillow \
uv \
&& rm -rf ~/.cache/pip/*

RUN mkdir -p /etc/pki/tls/certs && cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
Expand Down Expand Up @@ -202,22 +203,24 @@

# Setting up APT and PIP repo for neuron artifacts
ARG NEURON_APT_REPO=apt.repos.neuron.amazonaws.com
ARG NEURON_APT_REPO_KEY

Check warning on line 206 in pytorch/training/2.9.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (2.9.0, pytorch/training/2.9.0)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_APT_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG NEURON_PIP_REPO=pip.repos.neuron.amazonaws.com
ARG NEURON_PIP_REPO_KEY

Check warning on line 208 in pytorch/training/2.9.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (2.9.0, pytorch/training/2.9.0)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_PIP_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
RUN mkdir -p /etc/apt/keyrings \
&& APT_REPO_PREFIX=$([ -n "${NEURON_APT_REPO_KEY}" ] && echo "${NEURON_APT_REPO_KEY}@" || echo "") \
&& echo "deb [signed-by=/etc/apt/keyrings/neuron.gpg] https://${APT_REPO_PREFIX}${NEURON_APT_REPO} jammy main" > /etc/apt/sources.list.d/neuron.list \
&& curl $([ -n "${NEURON_APT_REPO_KEY}" ] && echo "-u ${NEURON_APT_REPO_KEY}") --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.29.41.0-681fef5f5
ARG NEURONX_RUNTIME_LIB_VERSION=2.29.40.0-f954cd7a5
ARG NEURONX_TOOLS_VERSION=2.27.33.0-5d9c0b901
ARG NEURONX_FRAMEWORK_VERSION=2.9.0.2.11.19912+e48cd891
ARG NEURONX_CC_VERSION=2.22.12471.0+b4a00d10
ARG NEURONX_DISTRIBUTED_VERSION=0.16.25997+f431c02e
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.30.59.0-f5cdefb39
ARG NEURONX_RUNTIME_LIB_VERSION=2.30.51.0-faafe26f0
ARG NEURONX_TOOLS_VERSION=2.28.23.0-f1c114a9d

ARG NEURONX_FRAMEWORK_VERSION=2.9.0.2.12.22436+0f1dac25
ARG NEURONX_CC_VERSION=2.23.6484.0+3b612583
ARG NEURONX_DISTRIBUTED_VERSION=0.17.26814+4b18de63
ARG NEURONX_DISTRIBUTED_TRAINING_VERSION=1.7.0
ARG NKI_VERSION=0.2.0+g82fdb402

FROM base AS repo

Expand All @@ -240,6 +243,7 @@
"neuronx-cc>=2.0" \
neuronx_distributed \
neuronx_distributed_training \
nki \
&& rm -rf ~/.cache/pip/*

FROM base AS prod
Expand All @@ -263,6 +267,7 @@
neuronx-cc==$NEURONX_CC_VERSION \
neuronx_distributed==$NEURONX_DISTRIBUTED_VERSION \
neuronx_distributed_training==$NEURONX_DISTRIBUTED_TRAINING_VERSION \
nki==$NKI_VERSION \
&& rm -rf ~/.cache/pip/*

FROM ${BUILD_STAGE} AS final
Expand Down
47 changes: 20 additions & 27 deletions vllm/inference/0.13.0/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# See http://bugs.python.org/issue19846
ENV LANG=C.UTF-8
ENV LD_LIBRARY_PATH=/opt/aws/neuron/lib:/lib/x86_64-linux-gnu:/opt/conda/lib/:$LD_LIBRARY_PATH

Check warning on line 18 in vllm/inference/0.13.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (0.13.0, vllm/inference/0.13.0)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV PATH=/opt/conda/bin:/opt/aws/neuron/bin:$PATH

RUN apt-get update \
Expand Down Expand Up @@ -123,6 +123,7 @@
"cmake>=3.26" \
"setuptools-scm>=8" \
"jinja2" \
uv \
torchserve==${TORCHSERVE_VERSION} \
torch-model-archiver==${TORCHSERVE_VERSION} \
&& rm -rf ~/.cache/pip/*
Expand All @@ -146,39 +147,37 @@

# Setting up APT and PIP repo for neuron artifacts
ARG NEURON_APT_REPO=apt.repos.neuron.amazonaws.com
ARG NEURON_APT_REPO_KEY

Check warning on line 150 in vllm/inference/0.13.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (0.13.0, vllm/inference/0.13.0)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_APT_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG NEURON_PIP_REPO=pip.repos.neuron.amazonaws.com
ARG NEURON_PIP_REPO_KEY

Check warning on line 152 in vllm/inference/0.13.0/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / build (0.13.0, vllm/inference/0.13.0)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "NEURON_PIP_REPO_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
RUN mkdir -p /etc/apt/keyrings \
&& APT_REPO_PREFIX=$([ -n "${NEURON_APT_REPO_KEY}" ] && echo "${NEURON_APT_REPO_KEY}@" || echo "") \
&& echo "deb [signed-by=/etc/apt/keyrings/neuron.gpg] https://${APT_REPO_PREFIX}${NEURON_APT_REPO} jammy main" > /etc/apt/sources.list.d/neuron.list \
&& curl $([ -n "${NEURON_APT_REPO_KEY}" ] && echo "-u ${NEURON_APT_REPO_KEY}") --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.29.41.0-681fef5f5
ARG NEURONX_RUNTIME_LIB_VERSION=2.29.40.0-f954cd7a5
ARG NEURONX_TOOLS_VERSION=2.27.33.0-5d9c0b901
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.30.59.0-f5cdefb39
ARG NEURONX_RUNTIME_LIB_VERSION=2.30.51.0-faafe26f0
ARG NEURONX_TOOLS_VERSION=2.28.23.0-f1c114a9d

ARG NEURONX_CC_VERSION=2.22.12471.0+b4a00d10
ARG NEURONX_FRAMEWORK_VERSION=2.9.0.2.11.19912+e48cd891
ARG NEURONX_DISTRIBUTED_VERSION=0.16.25997+f431c02e
ARG NEURONX_DISTRIBUTED_INFERENCE_VERSION=0.7.15063+bafa28d5
ARG NKI_VERSION=0.1.0+g432b459e
ARG NEURONX_CC_VERSION=2.23.6484.0+3b612583
ARG NEURONX_FRAMEWORK_VERSION=2.9.0.2.12.22436+0f1dac25
ARG NEURONX_DISTRIBUTED_VERSION=0.17.26814+4b18de63
ARG NEURONX_DISTRIBUTED_INFERENCE_VERSION=0.8.16251+f3ca5575
ARG NKI_VERSION=0.2.0+g82fdb402

# vLLM branch names
ARG VLLM_PRIVATE_BRANCH=release-0.3.0
ARG VLLM_PUBLIC_BRANCH=release-0.3.0
# GitHub repository and branch
ARG GITHUB_REPO=https://github.com/vllm-project/vllm-neuron.git
ARG GITHUB_REPO_BRANCH=release-0.4.1

FROM base AS vllm-clone
# Configure SSH access
RUN mkdir -p /root/.ssh \
&& echo "StrictHostKeyChecking no" >> /root/.ssh/config \
&& ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts

RUN mkdir -p /root/.ssh && \
echo "StrictHostKeyChecking no" >> /root/.ssh/config && \
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts

WORKDIR /vllm

RUN --mount=type=secret,id=ssh_key,target=/root/.ssh/id_ed25519,mode=0600 \
git clone -b ${VLLM_PRIVATE_BRANCH} git@github.com:aws-neuron/private-vllm-neuron.git .
# Clone vllm-neuronx repository
RUN --mount=type=secret,id=containers_github_ssh_key,target=/root/.ssh/id_ed25519,mode=0600 \
git clone -b ${GITHUB_REPO_BRANCH} ${GITHUB_REPO} /opt/vllm

FROM base AS repo

Expand All @@ -193,9 +192,6 @@
&& rm -rf /tmp/tmp* \
&& apt-get clean

# Install VLLM from source
COPY --from=vllm-clone /vllm /opt/vllm

RUN PIP_REPO_URL=$([ -n "${NEURON_PIP_REPO_KEY}" ] && echo "https://${NEURON_PIP_REPO_KEY}@${NEURON_PIP_REPO}" || echo "https://${NEURON_PIP_REPO}") \
&& ${PIP} install --no-cache-dir \
--index-url ${PIP_REPO_URL} \
Expand All @@ -221,9 +217,6 @@
&& rm -rf /tmp/tmp* \
&& apt-get clean

# Clone VLLM source before pip installations
RUN git clone -b "${VLLM_PUBLIC_BRANCH}" https://github.com/vllm-project/vllm-neuron.git /opt/vllm

RUN PIP_REPO_URL=$([ -n "${NEURON_PIP_REPO_KEY}" ] && echo "https://${NEURON_PIP_REPO_KEY}@${NEURON_PIP_REPO}" || echo "https://${NEURON_PIP_REPO}") \
&& ${PIP} install --no-cache-dir \
--index-url ${PIP_REPO_URL} \
Expand All @@ -243,4 +236,4 @@

ENTRYPOINT ["python", "/usr/local/bin/vllm_entrypoint.py"]
CMD ["/bin/bash"]
HEALTHCHECK CMD curl --fail http://localhost:8080/ping || exit 1
HEALTHCHECK CMD curl --fail http://localhost:8080/ping || exit 1
Loading