From 5aa0c5a7aee416a7a711ec24bc083c2edf71ee40 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Mon, 3 Nov 2025 12:44:40 -0800 Subject: [PATCH 01/14] initial commit for frontend image deployment Signed-off-by: Tushar Sharma --- container/Dockerfile | 18 ++++++++++++++++++ container/run.sh | 2 +- examples/backends/sglang/deploy/agg.yaml | 10 +++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index b17c57ca7b..0afa72173d 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -401,3 +401,21 @@ RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/l ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] CMD [] + +FROM nvcr.io/nvidia/distroless/python:3.12-v3.5.0 as frontend + +COPY --from=dev /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ + +RUN pip install /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl /opt/dynamo/wheelhouse/ai_dynamo*any.whl /opt/dynamo/wheelhouse/nixl/nixl*.whl +RUN if [ "$ENABLE_KVBM" = "true" ]; then \ + pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ + fi + +COPY benchmarks/ /opt/dynamo/benchmarks/ +RUN pip install /opt/dynamo/benchmarks/ + +COPY launch/ /opt/dynamo/launch/ +COPY lib/ /opt/dynamo/lib/ +COPY components/ /opt/dynamo/components/ + +CMD [] \ No newline at end of file diff --git a/container/run.sh b/container/run.sh index 2f16b3e729..2b2e62f0dd 100755 --- a/container/run.sh +++ b/container/run.sh @@ -42,7 +42,7 @@ ENVIRONMENT_VARIABLES= REMAINING_ARGS= INTERACTIVE= USE_NIXL_GDS= -RUNTIME=nvidia +RUNTIME= WORKDIR=/workspace NETWORK=host diff --git a/examples/backends/sglang/deploy/agg.yaml b/examples/backends/sglang/deploy/agg.yaml index c6302906b6..7f14bf937d 100644 --- a/examples/backends/sglang/deploy/agg.yaml +++ b/examples/backends/sglang/deploy/agg.yaml @@ -4,19 +4,19 @@ apiVersion: nvidia.com/v1alpha1 kind: DynamoGraphDeployment metadata: - name: sglang-agg + name: tusharma-sglang-agg spec: services: Frontend: - dynamoNamespace: sglang-agg + dynamoNamespace: tusharma componentType: frontend replicas: 1 extraPodSpec: mainContainer: - image: my-registry/sglang-runtime:my-tag + image: nvcr.io/nvidian/dynamo-dev/tusharma-frontend:0.2.0 decode: envFromSecret: hf-token-secret - dynamoNamespace: sglang-agg + dynamoNamespace: tusharma componentType: worker replicas: 1 resources: @@ -24,7 +24,7 @@ spec: gpu: "1" extraPodSpec: mainContainer: - image: my-registry/sglang-runtime:my-tag + image: nvcr.io/nvidia/ai-dynamo/sglang-runtime:0.6.0 workingDir: /workspace/examples/backends/sglang command: - python3 From 48ced8fe20af83e4ff44c0ce1d5757b6d6af58f0 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 4 Nov 2025 10:37:54 -0800 Subject: [PATCH 02/14] fixes Signed-off-by: Tushar Sharma --- container/Dockerfile | 55 +++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index 0afa72173d..82bbd22fc5 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -7,12 +7,12 @@ ################################## # Base image configuration -ARG BASE_IMAGE="nvcr.io/nvidia/cuda-dl-base" +ARG BASE_IMAGE="nvcr.io/nvidia/base/ubuntu" # TODO OPS-612: NCCL will hang with 25.03, so use 25.01 for now # Please check https://github.com/ai-dynamo/dynamo/pull/1065 # for details and reproducer to manually test if the image # can be updated to later versions. -ARG BASE_IMAGE_TAG="25.01-cuda12.8-devel-ubuntu24.04" +ARG BASE_IMAGE_TAG="noble-20250619" # Build configuration ARG ENABLE_KVBM=false @@ -322,9 +322,9 @@ RUN --mount=type=secret,id=aws-key-id,env=AWS_ACCESS_KEY_ID \ fi && \ /tmp/use-sccache.sh show-stats "Dynamo" -############################################## +################################################### ########## Dev entrypoint image ############## -############################################## +################################################### FROM base AS dev @@ -333,7 +333,8 @@ ARG ARCH_ALT # Application environment variables ENV DYNAMO_HOME=/opt/dynamo \ - CARGO_TARGET_DIR=/opt/dynamo/target + CARGO_TARGET_DIR=/opt/dynamo/target \ + CARGO_HOME=/usr/local/cargo # NIXL environment variables ENV NIXL_PREFIX=/opt/nvidia/nvda_nixl \ @@ -402,20 +403,42 @@ RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/l ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] CMD [] -FROM nvcr.io/nvidia/distroless/python:3.12-v3.5.0 as frontend +FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS frontend -COPY --from=dev /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ +# Install uv package manager +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ -RUN pip install /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl /opt/dynamo/wheelhouse/ai_dynamo*any.whl /opt/dynamo/wheelhouse/nixl/nixl*.whl -RUN if [ "$ENABLE_KVBM" = "true" ]; then \ - pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ - fi +# Create and activate virtual environment +ARG PYTHON_VERSION +RUN mkdir -p /opt/dynamo/venv && \ + uv venv /opt/dynamo/venv --python $PYTHON_VERSION -COPY benchmarks/ /opt/dynamo/benchmarks/ -RUN pip install /opt/dynamo/benchmarks/ +ENV VIRTUAL_ENV=/opt/dynamo/venv \ + PATH="/opt/dynamo/venv/bin:${PATH}" -COPY launch/ /opt/dynamo/launch/ -COPY lib/ /opt/dynamo/lib/ -COPY components/ /opt/dynamo/components/ +COPY --from=dev /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ +RUN uv pip install \ + /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ + /opt/dynamo/wheelhouse/ai_dynamo*any.whl \ + /opt/dynamo/wheelhouse/nixl/nixl*.whl && \ + if [ "$ENABLE_KVBM" = "true" ]; then \ + uv pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ + fi \ + && cd /opt/dynamo/benchmarks \ + && UV_GIT_LFS=1 uv pip install --no-cache . \ + && cd - \ + && rm -rf /opt/dynamo/benchmarks +RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \ + UV_GIT_LFS=1 uv pip install \ + --no-cache \ + --requirement /tmp/requirements.txt + +# Setup launch banner +RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/launch_message.txt \ + sed '/^#\s/d' /opt/dynamo/launch_message.txt > ~/.launch_screen && \ + echo "cat ~/.launch_screen" >> ~/.bashrc && \ + echo "source $VIRTUAL_ENV/bin/activate" >> ~/.bashrc + +ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] CMD [] \ No newline at end of file From 55c140b0d99b1a356bc6fc95b2cb1ab4621ec91e Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Wed, 5 Nov 2025 20:29:25 -0800 Subject: [PATCH 03/14] Initial commit for frontend image Signed-off-by: Tushar Sharma --- container/Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/container/Dockerfile b/container/Dockerfile index 82bbd22fc5..4ff237f2ff 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -408,6 +408,11 @@ FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS frontend # Install uv package manager COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ +COPY --from=dev /usr/bin/nats-server /usr/bin/nats-server +COPY --from=dev /usr/local/bin/etcd/ /usr/local/bin/etcd/ +# Add ETCD to PATH +ENV PATH=/usr/local/bin/etcd:$PATH + # Create and activate virtual environment ARG PYTHON_VERSION RUN mkdir -p /opt/dynamo/venv && \ @@ -416,6 +421,7 @@ RUN mkdir -p /opt/dynamo/venv && \ ENV VIRTUAL_ENV=/opt/dynamo/venv \ PATH="/opt/dynamo/venv/bin:${PATH}" +COPY benchmarks/ /opt/dynamo/benchmarks/ COPY --from=dev /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ RUN uv pip install \ /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ @@ -430,9 +436,13 @@ RUN uv pip install \ && rm -rf /opt/dynamo/benchmarks RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \ + --mount=type=bind,source=./container/deps/requirements.test.txt,target=/tmp/requirements.test.txt \ UV_GIT_LFS=1 uv pip install \ --no-cache \ - --requirement /tmp/requirements.txt + --requirement /tmp/requirements.txt \ + --requirement /tmp/requirements.test.txt + +COPY . /workspace/ # Setup launch banner RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/launch_message.txt \ From 75b36ac1fda6d4e53fc4173b0dd56cbfcd77a343 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 14:57:09 -0800 Subject: [PATCH 04/14] Change base image of dev stage Signed-off-by: Tushar Sharma --- container/Dockerfile | 60 ++++++-------------------------------------- 1 file changed, 7 insertions(+), 53 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index 4ff237f2ff..8e5d191a80 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -323,10 +323,10 @@ RUN --mount=type=secret,id=aws-key-id,env=AWS_ACCESS_KEY_ID \ /tmp/use-sccache.sh show-stats "Dynamo" ################################################### -########## Dev entrypoint image ############## +########## Frontend entrypoint image ############## ################################################### -FROM base AS dev +FROM nvcr.io/nvidia/base/ubuntu:noble-20250619 AS frontend ARG ENABLE_KVBM ARG ARCH_ALT @@ -356,6 +356,7 @@ COPY --from=wheel_builder $CARGO_HOME $CARGO_HOME RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ # required for AIC perf files + ca-certificates \ git \ git-lfs \ # rust build packages @@ -365,6 +366,9 @@ RUN apt-get update -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# Install uv package manager +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + # Create and activate virtual environment ARG PYTHON_VERSION RUN mkdir -p /opt/dynamo/venv && \ @@ -400,55 +404,5 @@ RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/l echo "cat ~/.launch_screen" >> ~/.bashrc && \ echo "source $VIRTUAL_ENV/bin/activate" >> ~/.bashrc -ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] -CMD [] - -FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS frontend - -# Install uv package manager -COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ - -COPY --from=dev /usr/bin/nats-server /usr/bin/nats-server -COPY --from=dev /usr/local/bin/etcd/ /usr/local/bin/etcd/ -# Add ETCD to PATH -ENV PATH=/usr/local/bin/etcd:$PATH - -# Create and activate virtual environment -ARG PYTHON_VERSION -RUN mkdir -p /opt/dynamo/venv && \ - uv venv /opt/dynamo/venv --python $PYTHON_VERSION - -ENV VIRTUAL_ENV=/opt/dynamo/venv \ - PATH="/opt/dynamo/venv/bin:${PATH}" - -COPY benchmarks/ /opt/dynamo/benchmarks/ -COPY --from=dev /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ -RUN uv pip install \ - /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ - /opt/dynamo/wheelhouse/ai_dynamo*any.whl \ - /opt/dynamo/wheelhouse/nixl/nixl*.whl && \ - if [ "$ENABLE_KVBM" = "true" ]; then \ - uv pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ - fi \ - && cd /opt/dynamo/benchmarks \ - && UV_GIT_LFS=1 uv pip install --no-cache . \ - && cd - \ - && rm -rf /opt/dynamo/benchmarks - -RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \ - --mount=type=bind,source=./container/deps/requirements.test.txt,target=/tmp/requirements.test.txt \ - UV_GIT_LFS=1 uv pip install \ - --no-cache \ - --requirement /tmp/requirements.txt \ - --requirement /tmp/requirements.test.txt - -COPY . /workspace/ - -# Setup launch banner -RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/launch_message.txt \ - sed '/^#\s/d' /opt/dynamo/launch_message.txt > ~/.launch_screen && \ - echo "cat ~/.launch_screen" >> ~/.bashrc && \ - echo "source $VIRTUAL_ENV/bin/activate" >> ~/.bashrc - -ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] +ENTRYPOINT ["/bin/bash", "-c"] CMD [] \ No newline at end of file From a48f140971a69a61d43766e83280631ba7f3f8d3 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 15:02:15 -0800 Subject: [PATCH 05/14] revert some unncessary changes that were brought in Signed-off-by: Tushar Sharma --- container/Dockerfile | 4 ++-- container/run.sh | 2 +- examples/backends/sglang/deploy/agg.yaml | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index 8e5d191a80..0773d3a6ad 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -7,12 +7,12 @@ ################################## # Base image configuration -ARG BASE_IMAGE="nvcr.io/nvidia/base/ubuntu" +ARG BASE_IMAGE="nvcr.io/nvidia/cuda-dl-base" # TODO OPS-612: NCCL will hang with 25.03, so use 25.01 for now # Please check https://github.com/ai-dynamo/dynamo/pull/1065 # for details and reproducer to manually test if the image # can be updated to later versions. -ARG BASE_IMAGE_TAG="noble-20250619" +ARG BASE_IMAGE_TAG="25.01-cuda12.8-devel-ubuntu24.04" # Build configuration ARG ENABLE_KVBM=false diff --git a/container/run.sh b/container/run.sh index 2b2e62f0dd..2f16b3e729 100755 --- a/container/run.sh +++ b/container/run.sh @@ -42,7 +42,7 @@ ENVIRONMENT_VARIABLES= REMAINING_ARGS= INTERACTIVE= USE_NIXL_GDS= -RUNTIME= +RUNTIME=nvidia WORKDIR=/workspace NETWORK=host diff --git a/examples/backends/sglang/deploy/agg.yaml b/examples/backends/sglang/deploy/agg.yaml index 7f14bf937d..c6302906b6 100644 --- a/examples/backends/sglang/deploy/agg.yaml +++ b/examples/backends/sglang/deploy/agg.yaml @@ -4,19 +4,19 @@ apiVersion: nvidia.com/v1alpha1 kind: DynamoGraphDeployment metadata: - name: tusharma-sglang-agg + name: sglang-agg spec: services: Frontend: - dynamoNamespace: tusharma + dynamoNamespace: sglang-agg componentType: frontend replicas: 1 extraPodSpec: mainContainer: - image: nvcr.io/nvidian/dynamo-dev/tusharma-frontend:0.2.0 + image: my-registry/sglang-runtime:my-tag decode: envFromSecret: hf-token-secret - dynamoNamespace: tusharma + dynamoNamespace: sglang-agg componentType: worker replicas: 1 resources: @@ -24,7 +24,7 @@ spec: gpu: "1" extraPodSpec: mainContainer: - image: nvcr.io/nvidia/ai-dynamo/sglang-runtime:0.6.0 + image: my-registry/sglang-runtime:my-tag workingDir: /workspace/examples/backends/sglang command: - python3 From 4d932ae6af0ab9b621d0c77e2d5312dbe41e1cad Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 19:54:57 -0800 Subject: [PATCH 06/14] commit latest changes from dockerfile Signed-off-by: Tushar Sharma --- .../workflows/container-validation-dynamo.yml | 2 +- container/Dockerfile | 33 +++++++++++++------ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/container-validation-dynamo.yml b/.github/workflows/container-validation-dynamo.yml index f982a2d08a..0e638a17fd 100644 --- a/.github/workflows/container-validation-dynamo.yml +++ b/.github/workflows/container-validation-dynamo.yml @@ -42,7 +42,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} run: | - ./container/build.sh --tag ${{ steps.define_image_tag.outputs.image_tag }} --target dev --framework none + ./container/build.sh --tag ${{ steps.define_image_tag.outputs.image_tag }} --target frontend --framework none - name: Start services with docker-compose working-directory: ./deploy run: | diff --git a/container/Dockerfile b/container/Dockerfile index 7a81b194fe..ed790f6799 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -322,9 +322,14 @@ RUN --mount=type=secret,id=aws-key-id,env=AWS_ACCESS_KEY_ID \ fi && \ /tmp/use-sccache.sh show-stats "Dynamo" + ################################################### ########## Frontend entrypoint image ############## ################################################### +# This is the main frontend image that includes: +# - Python environment with Dynamo packages +# - Rust toolchain for development +# - NATS and ETCD servers FROM nvcr.io/nvidia/base/ubuntu:noble-20250619 AS frontend @@ -334,7 +339,9 @@ ARG ARCH_ALT # Application environment variables ENV DYNAMO_HOME=/opt/dynamo \ CARGO_TARGET_DIR=/opt/dynamo/target \ - CARGO_HOME=/usr/local/cargo + RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ @@ -342,23 +349,24 @@ RUN apt-get update -y \ ca-certificates \ git \ git-lfs \ + # curl for downloading files + curl \ # rust build packages + build-essential \ + gcc \ + g++ \ clang \ libclang-dev \ protobuf-compiler \ - # sudo for dev stage - sudo \ + # libstdc++6 is needed for EPP runtime (included with g++) && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - # Add sudo privileges to dynamo user - && echo "dynamo ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/dynamo \ - && chmod 0440 /etc/sudoers.d/dynamo + && rm -rf /var/lib/apt/lists/* # Create dynamo user with group 0 for OpenShift compatibility RUN userdel -r ubuntu > /dev/null 2>&1 || true \ && useradd -m -s /bin/bash -g 0 dynamo \ && [ `id -u dynamo` -eq 1000 ] \ - && mkdir -p /home/dynamo/.cache \ + && mkdir -p /home/dynamo/.cache /opt/dynamo /workspace \ && chown -R dynamo: /opt/dynamo /home/dynamo /workspace \ && chmod -R g+w /opt/dynamo /home/dynamo/.cache /workspace @@ -390,6 +398,11 @@ ENV NIXL_PREFIX=/opt/nvidia/nvda_nixl \ NIXL_PLUGIN_DIR=/opt/nvidia/nvda_nixl/lib/${ARCH_ALT}-linux-gnu/plugins ENV LD_LIBRARY_PATH=${NIXL_LIB_DIR}:${NIXL_PLUGIN_DIR}:/usr/local/ucx/lib:/usr/local/ucx/lib/ucx:${LD_LIBRARY_PATH} +# Copy NATS and ETCD from base stage +COPY --chown=dynamo: --from=base /usr/bin/nats-server /usr/bin/nats-server +COPY --chown=dynamo: --from=base /usr/local/bin/etcd/ /usr/local/bin/etcd/ +ENV PATH=/usr/local/bin/etcd/:$PATH + # Copy ucx and nixl libs COPY --chown=dynamo: --from=wheel_builder /usr/local/ucx/ /usr/local/ucx/ COPY --chown=dynamo: --from=wheel_builder ${NIXL_PREFIX}/ ${NIXL_PREFIX}/ @@ -399,6 +412,7 @@ COPY --chown=dynamo: --from=wheel_builder /opt/nvidia/nvda_nixl/lib64/. ${NIXL_L COPY --chown=dynamo: --from=wheel_builder /opt/dynamo/dist/nixl/ /opt/dynamo/wheelhouse/nixl/ COPY --chown=dynamo: --from=wheel_builder /opt/dynamo/dist/*.whl /opt/dynamo/wheelhouse/ COPY --chown=dynamo: --from=wheel_builder $CARGO_TARGET_DIR $CARGO_TARGET_DIR +COPY --chown=dynamo: --from=wheel_builder $RUSTUP_HOME $RUSTUP_HOME COPY --chown=dynamo: --from=wheel_builder $CARGO_HOME $CARGO_HOME COPY --chown=dynamo: ./ /workspace/ @@ -425,5 +439,4 @@ RUN chmod 755 /opt/dynamo/.launch_screen && \ USER dynamo -ENTRYPOINT ["/bin/bash", "-c"] -CMD [] \ No newline at end of file +CMD ["/bin/bash"] \ No newline at end of file From 560e5bd4733bae43efd7d9b4d9b34089889040c6 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 21:38:33 -0800 Subject: [PATCH 07/14] Add frontend container to seperately build frontend image with epp Signed-off-by: Tushar Sharma --- container/Dockerfile | 46 +++++----------- container/Dockerfile.frontend | 98 +++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 32 deletions(-) create mode 100644 container/Dockerfile.frontend diff --git a/container/Dockerfile b/container/Dockerfile index ed790f6799..4d3a513004 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -323,50 +323,40 @@ RUN --mount=type=secret,id=aws-key-id,env=AWS_ACCESS_KEY_ID \ /tmp/use-sccache.sh show-stats "Dynamo" -################################################### -########## Frontend entrypoint image ############## -################################################### -# This is the main frontend image that includes: -# - Python environment with Dynamo packages -# - Rust toolchain for development -# - NATS and ETCD servers - -FROM nvcr.io/nvidia/base/ubuntu:noble-20250619 AS frontend +############################################## +########## Dev entrypoint image ############## +############################################## +FROM base AS dev ARG ENABLE_KVBM ARG ARCH_ALT # Application environment variables ENV DYNAMO_HOME=/opt/dynamo \ - CARGO_TARGET_DIR=/opt/dynamo/target \ - RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH + CARGO_TARGET_DIR=/opt/dynamo/target RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ # required for AIC perf files - ca-certificates \ git \ git-lfs \ - # curl for downloading files - curl \ # rust build packages - build-essential \ - gcc \ - g++ \ clang \ libclang-dev \ protobuf-compiler \ - # libstdc++6 is needed for EPP runtime (included with g++) + # sudo for dev stage + sudo \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + # Add sudo privileges to dynamo user + && echo "dynamo ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/dynamo \ + && chmod 0440 /etc/sudoers.d/dynamo # Create dynamo user with group 0 for OpenShift compatibility RUN userdel -r ubuntu > /dev/null 2>&1 || true \ && useradd -m -s /bin/bash -g 0 dynamo \ && [ `id -u dynamo` -eq 1000 ] \ - && mkdir -p /home/dynamo/.cache /opt/dynamo /workspace \ + && mkdir -p /home/dynamo/.cache \ && chown -R dynamo: /opt/dynamo /home/dynamo /workspace \ && chmod -R g+w /opt/dynamo /home/dynamo/.cache /workspace @@ -374,9 +364,6 @@ RUN userdel -r ubuntu > /dev/null 2>&1 || true \ USER dynamo ENV HOME=/home/dynamo -# Install uv package manager -COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ - # Create and activate virtual environment ARG PYTHON_VERSION RUN uv venv /opt/dynamo/venv --python $PYTHON_VERSION @@ -398,11 +385,6 @@ ENV NIXL_PREFIX=/opt/nvidia/nvda_nixl \ NIXL_PLUGIN_DIR=/opt/nvidia/nvda_nixl/lib/${ARCH_ALT}-linux-gnu/plugins ENV LD_LIBRARY_PATH=${NIXL_LIB_DIR}:${NIXL_PLUGIN_DIR}:/usr/local/ucx/lib:/usr/local/ucx/lib/ucx:${LD_LIBRARY_PATH} -# Copy NATS and ETCD from base stage -COPY --chown=dynamo: --from=base /usr/bin/nats-server /usr/bin/nats-server -COPY --chown=dynamo: --from=base /usr/local/bin/etcd/ /usr/local/bin/etcd/ -ENV PATH=/usr/local/bin/etcd/:$PATH - # Copy ucx and nixl libs COPY --chown=dynamo: --from=wheel_builder /usr/local/ucx/ /usr/local/ucx/ COPY --chown=dynamo: --from=wheel_builder ${NIXL_PREFIX}/ ${NIXL_PREFIX}/ @@ -412,7 +394,6 @@ COPY --chown=dynamo: --from=wheel_builder /opt/nvidia/nvda_nixl/lib64/. ${NIXL_L COPY --chown=dynamo: --from=wheel_builder /opt/dynamo/dist/nixl/ /opt/dynamo/wheelhouse/nixl/ COPY --chown=dynamo: --from=wheel_builder /opt/dynamo/dist/*.whl /opt/dynamo/wheelhouse/ COPY --chown=dynamo: --from=wheel_builder $CARGO_TARGET_DIR $CARGO_TARGET_DIR -COPY --chown=dynamo: --from=wheel_builder $RUSTUP_HOME $RUSTUP_HOME COPY --chown=dynamo: --from=wheel_builder $CARGO_HOME $CARGO_HOME COPY --chown=dynamo: ./ /workspace/ @@ -439,4 +420,5 @@ RUN chmod 755 /opt/dynamo/.launch_screen && \ USER dynamo -CMD ["/bin/bash"] \ No newline at end of file +ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] +CMD [] \ No newline at end of file diff --git a/container/Dockerfile.frontend b/container/Dockerfile.frontend new file mode 100644 index 0000000000..7ed8368a13 --- /dev/null +++ b/container/Dockerfile.frontend @@ -0,0 +1,98 @@ +# syntax=docker/dockerfile:1.10.0 +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +ARG DYNAMO_BASE_IMAGE="dynamo:latest-none" +ARG EPP_IMAGE="us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:v0.5.1-dirty" +ARG PYTHON_VERSION=3.12 +ARG ENABLE_KVBM=false + +FROM ${DYNAMO_BASE_IMAGE} AS dynamo_base + +FROM ${EPP_IMAGE} AS epp + +FROM nvcr.io/nvidia/base/ubuntu:noble-20250619 AS frontend + +RUN apt-get update -y \ + && apt-get install -y --no-install-recommends \ + # required for AIC perf files + ca-certificates \ + git \ + git-lfs \ + # curl for downloading files + curl \ + libstdc++6 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR / +COPY --from=epp /epp /epp + +# Create dynamo user with group 0 for OpenShift compatibility +RUN userdel -r ubuntu > /dev/null 2>&1 || true \ + && useradd -m -s /bin/bash -g 0 dynamo \ + && [ `id -u dynamo` -eq 1000 ] \ + && mkdir -p /home/dynamo/.cache /opt/dynamo \ + && chown -R dynamo: /opt/dynamo /home/dynamo/.cache \ + && chmod -R g+w /opt/dynamo /home/dynamo/.cache + +# Set HOME so ModelExpress can find the cache directory +ENV HOME=/home/dynamo + +# Switch to dynamo user +USER dynamo +ENV DYNAMO_HOME=/opt/dynamo + +# Copy NATS and ETCD from base stage +COPY --from=dynamo_base /usr/bin/nats-server /usr/bin/nats-server +COPY --from=dynamo_base /usr/local/bin/etcd/ /usr/local/bin/etcd/ +ENV PATH=/usr/local/bin/etcd/:$PATH + +# Install uv package manager +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + +# Create and activate virtual environment +ARG PYTHON_VERSION +RUN uv venv /opt/dynamo/venv --python $PYTHON_VERSION + +ENV VIRTUAL_ENV=/opt/dynamo/venv \ + PATH="/opt/dynamo/venv/bin:${PATH}" + +# Copy built artifacts and workspace from dynamo_base (dev image) +COPY --chown=dynamo: --from=dynamo_base /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ +COPY --chown=dynamo: --from=dynamo_base /workspace/ /workspace/ + +ARG ENABLE_KVBM +RUN uv pip install \ + /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ + /opt/dynamo/wheelhouse/ai_dynamo*any.whl \ + /opt/dynamo/wheelhouse/nixl/nixl*.whl && \ + if [ "$ENABLE_KVBM" = "true" ]; then \ + uv pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ + fi && \ + cd /workspace/benchmarks && \ + UV_GIT_LFS=1 uv pip install --no-cache . + +# Install common and test dependencies +RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \ + --mount=type=bind,source=./container/deps/requirements.test.txt,target=/tmp/requirements.test.txt \ + UV_GIT_LFS=1 uv pip install \ + --no-cache \ + --requirement /tmp/requirements.txt \ + --requirement /tmp/requirements.test.txt + + +# Setup launch banner in common directory accessible to all users +RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/launch_message.txt \ + sed '/^#\s/d' /opt/dynamo/launch_message.txt > /opt/dynamo/.launch_screen + +# Setup environment for all users +USER root +RUN chmod 755 /opt/dynamo/.launch_screen && \ + echo 'source /opt/dynamo/venv/bin/activate' >> /etc/bash.bashrc && \ + echo 'cat /opt/dynamo/.launch_screen' >> /etc/bash.bashrc + +USER dynamo + +CMD ["/bin/bash"] + From b0a137d04385daf65a06bc992d27304fb9ef9ea0 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 21:41:46 -0800 Subject: [PATCH 08/14] fix spacing in base dockerfile Signed-off-by: Tushar Sharma --- container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index 4d3a513004..4623b4d84a 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -322,10 +322,10 @@ RUN --mount=type=secret,id=aws-key-id,env=AWS_ACCESS_KEY_ID \ fi && \ /tmp/use-sccache.sh show-stats "Dynamo" - ############################################## ########## Dev entrypoint image ############## ############################################## + FROM base AS dev ARG ENABLE_KVBM @@ -421,4 +421,4 @@ RUN chmod 755 /opt/dynamo/.launch_screen && \ USER dynamo ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] -CMD [] \ No newline at end of file +CMD [] From 6573cc16ed600e14c71943a74c722f8c062e7891 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 21:43:06 -0800 Subject: [PATCH 09/14] remove frontend from GHA workflow Signed-off-by: Tushar Sharma --- .github/workflows/container-validation-dynamo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container-validation-dynamo.yml b/.github/workflows/container-validation-dynamo.yml index 0e638a17fd..f982a2d08a 100644 --- a/.github/workflows/container-validation-dynamo.yml +++ b/.github/workflows/container-validation-dynamo.yml @@ -42,7 +42,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} run: | - ./container/build.sh --tag ${{ steps.define_image_tag.outputs.image_tag }} --target frontend --framework none + ./container/build.sh --tag ${{ steps.define_image_tag.outputs.image_tag }} --target dev --framework none - name: Start services with docker-compose working-directory: ./deploy run: | From ac44519e2c62470e891632739cef5e980a794128 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Tue, 11 Nov 2025 21:50:49 -0800 Subject: [PATCH 10/14] update user permissions for frontend container Signed-off-by: Tushar Sharma --- container/Dockerfile.frontend | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/container/Dockerfile.frontend b/container/Dockerfile.frontend index 7ed8368a13..42e1d98c3f 100644 --- a/container/Dockerfile.frontend +++ b/container/Dockerfile.frontend @@ -25,8 +25,6 @@ RUN apt-get update -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -WORKDIR / -COPY --from=epp /epp /epp # Create dynamo user with group 0 for OpenShift compatibility RUN userdel -r ubuntu > /dev/null 2>&1 || true \ @@ -43,6 +41,9 @@ ENV HOME=/home/dynamo USER dynamo ENV DYNAMO_HOME=/opt/dynamo +WORKDIR / +COPY --chown=dynamo: --from=epp /epp /epp + # Copy NATS and ETCD from base stage COPY --from=dynamo_base /usr/bin/nats-server /usr/bin/nats-server COPY --from=dynamo_base /usr/local/bin/etcd/ /usr/local/bin/etcd/ @@ -61,7 +62,6 @@ ENV VIRTUAL_ENV=/opt/dynamo/venv \ # Copy built artifacts and workspace from dynamo_base (dev image) COPY --chown=dynamo: --from=dynamo_base /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ COPY --chown=dynamo: --from=dynamo_base /workspace/ /workspace/ - ARG ENABLE_KVBM RUN uv pip install \ /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ From c0c1f3d991d2e1f6846ff20d514ab169f9650702 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Wed, 12 Nov 2025 09:52:07 -0800 Subject: [PATCH 11/14] add documentation + productionize image Signed-off-by: Tushar Sharma --- container/Dockerfile.frontend | 21 ++++++++++----- container/README.md | 51 +++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/container/Dockerfile.frontend b/container/Dockerfile.frontend index 42e1d98c3f..cd538b5973 100644 --- a/container/Dockerfile.frontend +++ b/container/Dockerfile.frontend @@ -30,9 +30,9 @@ RUN apt-get update -y \ RUN userdel -r ubuntu > /dev/null 2>&1 || true \ && useradd -m -s /bin/bash -g 0 dynamo \ && [ `id -u dynamo` -eq 1000 ] \ - && mkdir -p /home/dynamo/.cache /opt/dynamo \ - && chown -R dynamo: /opt/dynamo /home/dynamo/.cache \ - && chmod -R g+w /opt/dynamo /home/dynamo/.cache + && mkdir -p /home/dynamo/.cache /opt/dynamo /workspace \ + && chown -R dynamo: /opt/dynamo /home/dynamo/.cache /workspace \ + && chmod -R g+w /opt/dynamo /home/dynamo/.cache /workspace # Set HOME so ModelExpress can find the cache directory ENV HOME=/home/dynamo @@ -59,10 +59,10 @@ RUN uv venv /opt/dynamo/venv --python $PYTHON_VERSION ENV VIRTUAL_ENV=/opt/dynamo/venv \ PATH="/opt/dynamo/venv/bin:${PATH}" +ARG ENABLE_KVBM # Copy built artifacts and workspace from dynamo_base (dev image) +COPY --chown=dynamo: benchmarks/ /opt/dynamo/benchmarks/ COPY --chown=dynamo: --from=dynamo_base /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ -COPY --chown=dynamo: --from=dynamo_base /workspace/ /workspace/ -ARG ENABLE_KVBM RUN uv pip install \ /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ /opt/dynamo/wheelhouse/ai_dynamo*any.whl \ @@ -70,7 +70,7 @@ RUN uv pip install \ if [ "$ENABLE_KVBM" = "true" ]; then \ uv pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ fi && \ - cd /workspace/benchmarks && \ + cd /opt/dynamo/benchmarks && \ UV_GIT_LFS=1 uv pip install --no-cache . # Install common and test dependencies @@ -81,6 +81,15 @@ RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requi --requirement /tmp/requirements.txt \ --requirement /tmp/requirements.test.txt +# Copy tests, benchmarks, deploy and components for CI with correct ownership +COPY --chown=dynamo: tests /workspace/tests +COPY --chown=dynamo: examples /workspace/examples +COPY --chown=dynamo: benchmarks /workspace/benchmarks +COPY --chown=dynamo: deploy /workspace/deploy +COPY --chown=dynamo: components/ /workspace/components/ +COPY --chown=dynamo: recipes/ /workspace/recipes/ +# Copy attribution files with correct ownership +COPY --chown=dynamo: ATTRIBUTION* LICENSE /workspace/ # Setup launch banner in common directory accessible to all users RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/launch_message.txt \ diff --git a/container/README.md b/container/README.md index f76ec3dd41..410d61367d 100644 --- a/container/README.md +++ b/container/README.md @@ -15,6 +15,8 @@ The NVIDIA Dynamo project uses containerized development and deployment to maint - `Dockerfile.trtllm` - For TensorRT-LLM inference backend - `Dockerfile.sglang` - For SGLang inference backend - `Dockerfile` - Base/standalone configuration + - `Dockerfile.frontend` - For Kubernetes Gateway API Inference Extension integration with EPP + - `Dockerfile.epp` - For building the Endpoint Picker (EPP) image ### Why Containerization? @@ -192,6 +194,55 @@ The `build.sh --dev-image` option takes a dev image and then builds a local-dev ./build.sh --dev-image dynamo:latest-vllm --framework vllm --dry-run ``` +### Building the Frontend Image + +The frontend image is a specialized container that includes the Dynamo components (NATS, etcd, dynamo, NIXL, etc) along with the Endpoint Picker (EPP) for Kubernetes Gateway API Inference Extension integration. This image is primarily used for inference gateway deployments. + +**Step 1: Build the Custom Dynamo EPP Image** + +Follow the instructions in [`deploy/inference-gateway/README.md`](../deploy/inference-gateway/README.md) under "Build the custom EPP image" section. This process: +- Clones the Gateway API Inference Extension repository +- Applies Dynamo-specific patches for custom routing +- Builds the Dynamo router as a static library +- Creates a custom EPP image with integrated Dynamo routing capabilities + +**Step 2: Build the Dynamo Base Image** + +The base image contains the core Dynamo runtime components, NATS server, etcd, and Python dependencies: +```bash +# Build the base dev image (framework=none for frontend-only deployment) +./build.sh --framework none --target dev +``` + +**Step 3: Build the Frontend Image** + +Now build the frontend image that combines the Dynamo base with the EPP: + +```bash +# 2. Build the frontend image using the pre-built EPP +docker buildx build --load --platform linux/amd64 \ + --build-arg DYNAMO_BASE_IMAGE=dynamo:latest-none-dev \ + --build-arg EPP_IMAGE={EPP_IMAGE_TAG} \ + --build-arg PYTHON_VERSION=3.12 \ + -f container/Dockerfile.frontend \ + -t dynamo:latest-none-frontend \ + . +``` +#### Frontend Image Contents + +The frontend image includes: +- **EPP (Endpoint Picker)**: Handles request routing and load balancing for inference gateway +- **Dynamo Runtime**: Core platform components and routing logic +- **NIXL**: NVIDIA InfiniBand Library for high-performance network communication +- **Benchmarking Tools**: Performance testing utilities (aiperf, aiconfigurator, etc) +- **Python Environment**: Virtual environment with all required dependencies +- **NATS Server**: Message broker for Dynamo's distributed communication +- **etcd**: Distributed key-value store for configuration and coordination + +#### Deployment + +The frontend image is designed for Kubernetes deployment with the Gateway API Inference Extension. See [`deploy/inference-gateway/README.md`](../deploy/inference-gateway/README.md) for complete deployment instructions using Helm charts. + ### run.sh - Container Runtime Manager The `run.sh` script launches Docker containers with the appropriate configuration for development and inference workloads. From e57f00f7ba579a64062abb8e15380256e6c9ba08 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Wed, 12 Nov 2025 10:00:15 -0800 Subject: [PATCH 12/14] fix trailing whitespace Signed-off-by: Tushar Sharma --- container/Dockerfile.frontend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/Dockerfile.frontend b/container/Dockerfile.frontend index cd538b5973..cc21dfb43a 100644 --- a/container/Dockerfile.frontend +++ b/container/Dockerfile.frontend @@ -72,7 +72,7 @@ RUN uv pip install \ fi && \ cd /opt/dynamo/benchmarks && \ UV_GIT_LFS=1 uv pip install --no-cache . - + # Install common and test dependencies RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \ --mount=type=bind,source=./container/deps/requirements.test.txt,target=/tmp/requirements.test.txt \ From ddd1271159ff24f6e5e09834870e02f46597f73f Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Wed, 12 Nov 2025 12:20:10 -0800 Subject: [PATCH 13/14] copy venv from dev stage, remove unnecessary packages Signed-off-by: Tushar Sharma --- container/Dockerfile.frontend | 54 ++++++++--------------------------- 1 file changed, 12 insertions(+), 42 deletions(-) diff --git a/container/Dockerfile.frontend b/container/Dockerfile.frontend index cc21dfb43a..5667cccb93 100644 --- a/container/Dockerfile.frontend +++ b/container/Dockerfile.frontend @@ -5,7 +5,6 @@ ARG DYNAMO_BASE_IMAGE="dynamo:latest-none" ARG EPP_IMAGE="us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:v0.5.1-dirty" ARG PYTHON_VERSION=3.12 -ARG ENABLE_KVBM=false FROM ${DYNAMO_BASE_IMAGE} AS dynamo_base @@ -13,14 +12,11 @@ FROM ${EPP_IMAGE} AS epp FROM nvcr.io/nvidia/base/ubuntu:noble-20250619 AS frontend +ARG PYTHON_VERSION RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ - # required for AIC perf files + # required for EPP ca-certificates \ - git \ - git-lfs \ - # curl for downloading files - curl \ libstdc++6 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -49,39 +45,8 @@ COPY --from=dynamo_base /usr/bin/nats-server /usr/bin/nats-server COPY --from=dynamo_base /usr/local/bin/etcd/ /usr/local/bin/etcd/ ENV PATH=/usr/local/bin/etcd/:$PATH -# Install uv package manager -COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ - -# Create and activate virtual environment -ARG PYTHON_VERSION -RUN uv venv /opt/dynamo/venv --python $PYTHON_VERSION - -ENV VIRTUAL_ENV=/opt/dynamo/venv \ - PATH="/opt/dynamo/venv/bin:${PATH}" - -ARG ENABLE_KVBM -# Copy built artifacts and workspace from dynamo_base (dev image) -COPY --chown=dynamo: benchmarks/ /opt/dynamo/benchmarks/ -COPY --chown=dynamo: --from=dynamo_base /opt/dynamo/wheelhouse/ /opt/dynamo/wheelhouse/ -RUN uv pip install \ - /opt/dynamo/wheelhouse/ai_dynamo_runtime*.whl \ - /opt/dynamo/wheelhouse/ai_dynamo*any.whl \ - /opt/dynamo/wheelhouse/nixl/nixl*.whl && \ - if [ "$ENABLE_KVBM" = "true" ]; then \ - uv pip install /opt/dynamo/wheelhouse/kvbm*.whl; \ - fi && \ - cd /opt/dynamo/benchmarks && \ - UV_GIT_LFS=1 uv pip install --no-cache . - -# Install common and test dependencies -RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \ - --mount=type=bind,source=./container/deps/requirements.test.txt,target=/tmp/requirements.test.txt \ - UV_GIT_LFS=1 uv pip install \ - --no-cache \ - --requirement /tmp/requirements.txt \ - --requirement /tmp/requirements.test.txt - -# Copy tests, benchmarks, deploy and components for CI with correct ownership +COPY --chown=dynamo: container/launch_message.txt /opt/dynamo/.launch_screen +# Copy tests, benchmarks, deploy and components with correct ownership COPY --chown=dynamo: tests /workspace/tests COPY --chown=dynamo: examples /workspace/examples COPY --chown=dynamo: benchmarks /workspace/benchmarks @@ -91,9 +56,14 @@ COPY --chown=dynamo: recipes/ /workspace/recipes/ # Copy attribution files with correct ownership COPY --chown=dynamo: ATTRIBUTION* LICENSE /workspace/ -# Setup launch banner in common directory accessible to all users -RUN --mount=type=bind,source=./container/launch_message.txt,target=/opt/dynamo/launch_message.txt \ - sed '/^#\s/d' /opt/dynamo/launch_message.txt > /opt/dynamo/.launch_screen +ENV VIRTUAL_ENV=/opt/dynamo/venv +ENV PATH="/opt/dynamo/venv/bin:$PATH" +# Copy virtual environment directly from dynamo_base (dev image) +# This includes all installed packages: dynamo, nixl, requirements.txt, requirements.test.txt +# Copy uv to system /bin +COPY --from=dynamo_base /bin/uv /bin/uvx /bin/ +RUN uv python install $PYTHON_VERSION +COPY --chown=dynamo: --from=dynamo_base /opt/dynamo/venv/ /opt/dynamo/venv/ # Setup environment for all users USER root From 9d43a4400b4078e199e5a1ee7cc60f7878df4326 Mon Sep 17 00:00:00 2001 From: Tushar Sharma Date: Wed, 12 Nov 2025 13:03:34 -0800 Subject: [PATCH 14/14] update entrypoint to use epp automatically Signed-off-by: Tushar Sharma --- container/Dockerfile.frontend | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/container/Dockerfile.frontend b/container/Dockerfile.frontend index 5667cccb93..ca65fdb301 100644 --- a/container/Dockerfile.frontend +++ b/container/Dockerfile.frontend @@ -40,11 +40,6 @@ ENV DYNAMO_HOME=/opt/dynamo WORKDIR / COPY --chown=dynamo: --from=epp /epp /epp -# Copy NATS and ETCD from base stage -COPY --from=dynamo_base /usr/bin/nats-server /usr/bin/nats-server -COPY --from=dynamo_base /usr/local/bin/etcd/ /usr/local/bin/etcd/ -ENV PATH=/usr/local/bin/etcd/:$PATH - COPY --chown=dynamo: container/launch_message.txt /opt/dynamo/.launch_screen # Copy tests, benchmarks, deploy and components with correct ownership COPY --chown=dynamo: tests /workspace/tests @@ -73,5 +68,6 @@ RUN chmod 755 /opt/dynamo/.launch_screen && \ USER dynamo +ENTRYPOINT ["/epp"] CMD ["/bin/bash"]