Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM nixl:v0.1.0.dev.0704dc0

# 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 && \
# 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
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Slim down the image and harden sudo setup

  1. Add --no-install-recommends to the apt-get install line – it cuts bloat by skipping docs and ancillary packages.
  2. The comment says “Add all users to sudo group” but in reality you only relax /etc/sudoers; if the ubuntu user (or any other) is not already in the sudo group it will still lack sudo rights. Either ensure the user is added (usermod -aG sudo ubuntu) or re-phrase the comment.
  3. Fetching a remote install script (llvm.sh) at build-time without pinning a checksum makes reproducibility brittle. At minimum, pin the expected SHA256 or an explicit LLVM version (LLVM_VERSION=17 bash …) so future upstream changes don’t silently break the build.
-    apt-get install -y sudo wget lsb-release software-properties-common gnupg ca-certificates && \
+    apt-get install -y --no-install-recommends \
+        sudo wget lsb-release software-properties-common gnupg ca-certificates && \
+    usermod -aG sudo ubuntu && \
📝 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
RUN apt-get update && \
apt-get install -y sudo wget lsb-release software-properties-common gnupg ca-certificates && \
# 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 apt-get update && \
apt-get install -y --no-install-recommends \
sudo wget lsb-release software-properties-common gnupg ca-certificates && \
usermod -aG sudo ubuntu && \
# 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
🤖 Prompt for AI Agents
In .devcontainer/Dockerfile lines 4 to 11, add --no-install-recommends to the
apt-get install command to reduce image size by skipping unnecessary packages.
Ensure the user (e.g., ubuntu) is added to the sudo group with usermod -aG sudo
ubuntu or update the comment to accurately reflect that only sudoers file is
modified. Also, modify the llvm.sh installation to specify an explicit LLVM
version or verify the script's SHA256 checksum to improve build reproducibility
and security.


47 changes: 21 additions & 26 deletions .devcontainer/devcontainer.json
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": "/home/ubuntu/.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 /work/.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"
]
}
Loading