@@ -280,21 +280,55 @@ RUN --mount=type=bind,source=./container/launch_message.txt,target=/workspace/la
280280ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"]
281281CMD []
282282
283- #######################################
284- ########## Local Development #######
285- #######################################
283+ #######################################################################
284+ ########## DEVELOPMENT TARGETS FEATURE MATRIX #########################
285+ #######################################################################
286+ # Feature │ local-dev Target │ dev Target
287+ # ─────────────────────┼─────────────────────┼─────────────────────
288+ # Purpose │ Dev Container │ Command-line with
289+ # │ plugin use only │ run.sh script
290+ # ─────────────────────┼─────────────────────┼─────────────────────
291+ # Default User │ ubuntu user │ root user
292+ # ─────────────────────┼─────────────────────┼─────────────────────
293+ # User Setup │ Full ubuntu user │ No user setup
294+ # │ with UID/GID │
295+ # │ mapping │
296+ # ─────────────────────┼─────────────────────┼─────────────────────
297+ # Permissions │ ubuntu user with │ Root-level
298+ # │ sudo privileges │ permissions
299+ # ─────────────────────┼─────────────────────┼─────────────────────
300+ # Home Directory │ /home/ubuntu │ /root
301+ # ─────────────────────┼─────────────────────┼─────────────────────
302+ # Working Directory │ /home/ubuntu/dynamo │ /workspace
303+ # ─────────────────────┼─────────────────────┼─────────────────────
304+ # Rust Toolchain │ User's home │ System locations
305+ # │ (~/.rustup, │ (/usr/local/rustup,
306+ # │ ~/.cargo) │ /usr/local/cargo)
307+ # ─────────────────────┼─────────────────────┼─────────────────────
308+ # Python Environment │ User-owned venv │ System location
309+ # │ │ (/opt/dynamo/venv)
310+ # ─────────────────────┼─────────────────────┼─────────────────────
311+ # File Permissions │ User-level with │ Root-level
312+ # │ proper ownership │ permissions
313+ # ─────────────────────┼─────────────────────┼─────────────────────
314+ # Compatibility │ MS Plug-in: Dev │ Backward compatibility
315+ # │ Container workflow │ with existing
316+ # │ │ workflows
286317#
287- # PURPOSE: Local development
288- #
289- # This stage adds development tools, utilities, and dependencies specifically
290- # needed for:
291- # - Local development and debugging
292- # - vscode/cursor development
318+ # USAGE GUIDELINES:
319+ # • Use local-dev: VS Code/Cursor Dev Container plugin only
320+ # • Use dev: run.sh script for command-line development
321+
322+
323+ #######################################################################
324+ ########## Development (Dev Container only) ###########################
325+ #######################################################################
293326#
294- # Use this stage when you need a full development environment with additional
295- # tooling beyond the base runtime image.
327+ # This stage is for Dev Container plug-in use only.
328+ # It provides a local development environment with extra tools and dependencies
329+ # not present in the base runtime image.
296330
297- FROM runtime AS dev
331+ FROM runtime AS local- dev
298332
299333# Don't want ubuntu to be editable, just change uid and gid.
300334ENV USERNAME=ubuntu
@@ -395,3 +429,79 @@ RUN mkdir -p /home/$USERNAME/.cache/
395429
396430ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"]
397431CMD []
432+
433+
434+ ###########################################################
435+ ########## Development (run.sh, runs as root user) ########
436+ ###########################################################
437+ #
438+ # PURPOSE: Local development environment for use with run.sh (not Dev Container plug-in)
439+ #
440+ # This stage runs as root and provides:
441+ # - Development tools and utilities for local debugging
442+ # - Support for vscode/cursor development outside the Dev Container plug-in
443+ #
444+ # Use this stage if you need a full-featured development environment with extra tools,
445+ # but do not use it with the Dev Container plug-in.
446+
447+ FROM runtime AS dev
448+
449+ # Don't want ubuntu to be editable, just change uid and gid.
450+ ARG WORKSPACE_DIR=/workspace
451+
452+ # Install utilities as root
453+ RUN apt-get update -y && \
454+ apt-get install -y --no-install-recommends \
455+ # Install utilities
456+ nvtop \
457+ wget \
458+ tmux \
459+ vim \
460+ git \
461+ openssh-client \
462+ iproute2 \
463+ rsync \
464+ zip \
465+ unzip \
466+ htop \
467+ # Build Dependencies
468+ autoconf \
469+ automake \
470+ cmake \
471+ libtool \
472+ meson \
473+ net-tools \
474+ pybind11-dev \
475+ # Rust build dependencies
476+ clang \
477+ libclang-dev \
478+ protobuf-compiler && \
479+ rm -rf /var/lib/apt/lists/*
480+
481+ COPY --from=runtime /usr/local/bin /usr/local/bin
482+
483+ # Set workspace directory variable
484+ ENV WORKSPACE_DIR=${WORKSPACE_DIR} \
485+ DYNAMO_HOME=${WORKSPACE_DIR} \
486+ RUSTUP_HOME=/usr/local/rustup \
487+ CARGO_HOME=/usr/local/cargo \
488+ CARGO_TARGET_DIR=/workspace/target \
489+ VIRTUAL_ENV=/opt/dynamo/venv \
490+ PATH=/usr/local/cargo/bin:$PATH
491+
492+ COPY --from=dynamo_base /usr/local/rustup /usr/local/rustup
493+ COPY --from=dynamo_base /usr/local/cargo /usr/local/cargo
494+
495+ # This is a slow operation (~40s on my cpu)
496+ # Much better than chown -R $USERNAME:$USERNAME /opt/dynamo/venv (~10min on my cpu)
497+ COPY --from=runtime ${VIRTUAL_ENV} ${VIRTUAL_ENV}
498+
499+ # so we can use maturin develop
500+ RUN uv pip install maturin[patchelf]
501+
502+ # Make sure to sync this with the one specified on README.md.
503+ # This is a generic PYTHONPATH which works for all the frameworks, so some paths may not be relevant for this particular framework.
504+ ENV PYTHONPATH=${WORKSPACE_DIR}/components/metrics/src:${WORKSPACE_DIR}/components/frontend/src:${WORKSPACE_DIR}/components/planner/src:${WORKSPACE_DIR}/components/backends/mocker/src:${WORKSPACE_DIR}/components/backends/trtllm/src:${WORKSPACE_DIR}/components/backends/vllm/src:${WORKSPACE_DIR}/components/backends/sglang/src:${WORKSPACE_DIR}/components/backends/llama_cpp/src
505+
506+ ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"]
507+ CMD []
0 commit comments