diff --git a/docker/automodel/Dockerfile.nmp-automodel-tasks b/docker/automodel/Dockerfile.nmp-automodel-tasks index 4e70b8a99c..33073e65c9 100644 --- a/docker/automodel/Dockerfile.nmp-automodel-tasks +++ b/docker/automodel/Dockerfile.nmp-automodel-tasks @@ -29,11 +29,15 @@ RUN mkdir -p /home/${USERNAME}/.cache && \ # /app/pyproject.toml is pyproject.workspace.toml (see Dockerfile.platform-workspace). # --inexact: keep PyTorch / Automodel packages already in the base venv; add nmp-automodel + deps. +# nmp-models is only needed for the model_spec task/parallelism helper here; install +# it without resolving the full models-service deployment backend dependency graph. ENV UV_LINK_MODE=copy \ UV_PROJECT_ENVIRONMENT=${VIRTUAL_ENV} RUN --mount=type=cache,target=/root/.cache/uv \ - uv sync --package nmp-automodel --package nmp-models --no-dev --inexact + uv sync --package nmp-automodel --no-dev --inexact && \ + uv pip install --python ${VIRTUAL_ENV}/bin/python --no-cache --no-deps --no-sources \ + -e /app/services/core/models ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" ENTRYPOINT ["/opt/venv/bin/python"] diff --git a/docker/automodel/Dockerfile.platform-workspace b/docker/automodel/Dockerfile.platform-workspace index 9d4854a15c..3aecd10a4d 100644 --- a/docker/automodel/Dockerfile.platform-workspace +++ b/docker/automodel/Dockerfile.platform-workspace @@ -15,10 +15,11 @@ COPY docker/automodel/no_override_requirements.txt docker/automodel/no_override_ COPY docs docs COPY openapi openapi COPY packages/nmp_build_tools packages/nmp_build_tools -COPY packages/models packages/models COPY packages/nmp_common packages/nmp_common COPY packages/nmp_customization_common packages/nmp_customization_common COPY packages/nemo_platform_plugin packages/nemo_platform_plugin COPY sdk/python/nemo-platform sdk/python/nemo-platform COPY services/automodel services/automodel +# Copied for the tasks image only. It is installed outside the reduced uv +# workspace to avoid pulling the full models-service deployment backend graph. COPY services/core/models services/core/models diff --git a/docker/automodel/pyproject.workspace.toml b/docker/automodel/pyproject.workspace.toml index f576d9da0b..6b50704dd0 100644 --- a/docker/automodel/pyproject.workspace.toml +++ b/docker/automodel/pyproject.workspace.toml @@ -14,21 +14,17 @@ constraint-dependencies = ["greenlet>=3.0.0,<3.5"] [tool.uv.workspace] members = [ "packages/nmp_build_tools", - "packages/models", "sdk/python/nemo-platform", "packages/nemo_platform_plugin", "packages/nmp_common", "packages/nmp_customization_common", "services/automodel", - "services/core/models", ] [tool.uv.sources] nmp-build-tools = { workspace = true } -models = { workspace = true } nemo-platform-sdk = { workspace = true } nemo-platform-plugin = { workspace = true } nmp-common = { workspace = true } nmp-customization-common = { workspace = true } nmp-automodel = { workspace = true } -nmp-models = { workspace = true }