Skip to content
Closed
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
16 changes: 16 additions & 0 deletions .devcontainer.template/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

FROM nixl:v0.1.0.dev.0780842

# Install sudo, LLVM (latest stable), and configure passwordless sudo for all users
RUN apt-get update && \
apt-get install -y sudo wget lsb-release software-properties-common gnupg ca-certificates git-lfs&& \
# Install latest stable LLVM using official script
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
# Add all users to sudo group and enable passwordless sudo
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

RUN git lfs install
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"name": "NVIDIA Dynamo Development",
"remoteUser": "ubuntu", // Matches our container user
"updateRemoteUserUID": true, // Updates the UID of the remote user to match the host user, avoids permission errors
"image": "dynamo:latest-vllm-local-dev", // Use the latest VLLM local dev image
// "image": "dynamo:latest-vllm-local-dev", // Use the latest VLLM local dev image
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": [
"--gpus=all",
"--network=host",
Expand All @@ -37,51 +40,43 @@
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.cwd": "/home/ubuntu/dynamo",

"python.defaultInterpreterPath": "/opt/dynamo/venv/bin/python",
"python.defaultInterpreterPath": "venv/bin/python",
"python.linting.enabled": true,

"rust-analyzer.memoryLimit": 4096, // larger memory limit to reduce latency
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.checkOnSave.enable": true,
"rust-analyzer.cargo.buildScripts.enable": true,
"rust-analyzer.cargo.targetDir": "/home/ubuntu/dynamo/.build/target",
// "rust-analyzer.cargo.targetDir": "/work/.build/target",
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.completion.autoimport.enable": true,

// Enhanced rust-analyzer configuration
"rust-analyzer.linkedProjects": [
"dynamo/Cargo.toml",
"dynamo/lib/runtime/Cargo.toml",
"dynamo/lib/llm/Cargo.toml",
"dynamo/lib/tokens/Cargo.toml",
"dynamo/lib/bindings/python/Cargo.toml",
"dynamo/launch/dynamo-run/Cargo.toml"
"Cargo.toml",
"lib/bindings/python/Cargo.toml",
],

"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}
}
},
"workspaceFolder": "/home/ubuntu",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/dynamo,type=bind,consistency=cached",
"userEnvProbe": "interactiveShell",
"postCreateCommand": "/bin/bash /home/ubuntu/dynamo/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
"postCreateCommand": "/bin/bash .devcontainer/post-create.sh", // Runs cargo build and pip installs packages
"containerEnv": {
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
"HF_TOKEN": "${localEnv:HF_TOKEN}",
"CARGO_HOME": "/home/ubuntu/dynamo/.build/.cargo",
"RUSTUP_HOME": "/home/ubuntu/dynamo/.build/.rustup"
"CARGO_HOME": "/home/ubuntu/.cargo"
},
"mounts": [
// Default mounts
"source=/tmp/,target=/tmp/,type=bind",
"source=dynamo-bashhistory,target=/home/ubuntu/.commandhistory,type=volume", // For bash history
"source=dynamo-precommit-cache,target=/home/ubuntu/.cache/pre-commit,type=volume" // For pre-commit cache

// Uncomment for additional functionality
// "source=${localEnv:HF_HOME},target=/home/ubuntu/.cache/huggingface,type=bind", // Uncomment to enable HF Cache Mount. Make sure to set HF_HOME env var in you .bashrc
"source=${localEnv:HOME},target=/home/ubuntu,type=bind"
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"userUid": "${localEnv:UID-1000}",
"userGid": "${localEnv:UID-1000}",
"upgradePackages": "false"
}
Comment on lines +72 to +77
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Malformed feature options – UID env var & boolean type
"${localEnv:UID-1000}" is not a valid environment-variable key (dash not allowed). This will resolve to an empty string and the feature will fail.
Also upgradePackages expects a JSONC boolean, not a string.

-            "userUid": "${localEnv:UID-1000}",
-            "userGid": "${localEnv:UID-1000}",
-            "upgradePackages": "false"
+            "userUid": "${localEnv:UID}",
+            "userGid": "${localEnv:UID}",
+            "upgradePackages": false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"userUid": "${localEnv:UID-1000}",
"userGid": "${localEnv:UID-1000}",
"upgradePackages": "false"
}
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"userUid": "${localEnv:UID}",
"userGid": "${localEnv:UID}",
"upgradePackages": false
}
🤖 Prompt for AI Agents
In .devcontainer/devcontainer.json around lines 72 to 77, the userUid and
userGid options use an invalid environment variable key with a dash, causing
them to resolve to empty strings; replace "${localEnv:UID-1000}" with a valid
key like "${localEnv:UID_1000}" or another valid environment variable without
dashes. Also, change the upgradePackages value from the string "false" to the
boolean false without quotes to match the expected JSONC boolean type.

},
"overrideFeatureInstallOrder": [
"ghcr.io/devcontainers/features/common-utils"
]
}
92 changes: 92 additions & 0 deletions .devcontainer.template/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

trap 'echo "❌ ERROR: Command failed at line $LINENO: $BASH_COMMAND"; echo "⚠️ This was unexpected and setup was not completed. Can try to resolve yourself and then manually run the rest of the commands in this file or file a bug."' ERR

retry() {
# retries for connectivity issues in installs
local retries=3
local count=0
until "$@"; do
exit_code=$?
wait_time=$((2 ** count))
echo "Command failed with exit code $exit_code. Retrying in $wait_time seconds..."
sleep $wait_time
count=$((count + 1))
if [ $count -ge $retries ]; then
echo "Command failed after $retries attempts."
return $exit_code
fi
done
return 0
}

set -xe

# Create virtual environment if it doesn't exist
VENV_PATH="venv"
if [ ! -d "$VENV_PATH" ]; then
echo "🐍 Creating virtual environment at $VENV_PATH..."
uv venv "$VENV_PATH"
echo "✅ Virtual environment created successfully"
else
echo "🐍 Virtual environment already exists at $VENV_PATH"
fi

# Activate the virtual environment for this script
source "$VENV_PATH/bin/activate"

uv pip install -r .devcontainer/requirements.txt

pre-commit install


# # Changing permission to match local user since volume mounts default to root ownership
# sudo chown -R ubuntu:ubuntu ~/.cache/pre-commit

# # Pre-commit hooks
# cd $HOME/dynamo && pre-commit install && retry pre-commit install-hooks
# pre-commit run --all-files || true # don't fail the build if pre-commit hooks fail

# # Set build directory
# mkdir -p $HOME/dynamo/.build/target
# export CARGO_TARGET_DIR=$HOME/dynamo/.build/target

# # build project, it will be saved at $HOME/dynamo/.build/target
# cargo build --locked --profile dev --features mistralrs
# cargo doc --no-deps

# # create symlinks for the binaries in the deploy directory
# mkdir -p $HOME/dynamo/deploy/sdk/src/dynamo/sdk/cli/bin
# ln -sf $HOME/dynamo/.build/target/debug/dynamo-run $HOME/dynamo/deploy/sdk/src/dynamo/sdk/cli/bin/dynamo-run

# # install the python bindings
# cd $HOME/dynamo/lib/bindings/python && retry maturin develop

# # installs overall python packages, grabs binaries from .build/target/debug
# cd $HOME/dynamo && retry env DYNAMO_BIN_PATH=$HOME/dynamo/.build/target/debug uv pip install -e .

# export PYTHONPATH=/home/ubuntu/dynamo/components/planner/src:$PYTHONPATH

# # TODO: Deprecated except vLLM v0
# if ! grep -q "export VLLM_KV_CAPI_PATH=" ~/.bashrc; then
# echo "export VLLM_KV_CAPI_PATH=$HOME/dynamo/.build/target/debug/libdynamo_llm_capi.so" >> ~/.bashrc
# fi

# if ! grep -q "export GPG_TTY=" ~/.bashrc; then
# echo "export GPG_TTY=$(tty)" >> ~/.bashrc
# fi
6 changes: 6 additions & 0 deletions .devcontainer.template/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

maturin
patchelf
pre-commit
74 changes: 0 additions & 74 deletions .devcontainer/post-create.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.devcontainer

.idea
.vs/
.vscode/
Expand Down
Loading