Skip to content

Commit 305cd8f

Browse files
committed
Merge remote-tracking branch 'origin/main' into kvbm-big-offload-pr
2 parents 60e41ef + a91e634 commit 305cd8f

File tree

1,086 files changed

+146932
-60109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,086 files changed

+146932
-60109
lines changed

.coderabbit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ reviews:
1919
auto_incremental_review: false
2020
suggested_labels: false
2121
suggested_reviewers: false
22+
sequence_diagrams: false
23+
related_issues: false
24+
related_prs: false
2225
finishing_touches:
2326
docstrings:
2427
enabled: false

.devcontainer/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ This setup allows you to use Git commands normally within the container without
211211
### Step 5: Wait for Initialization
212212

213213
The container will automatically:
214-
- Mount your local code to `/home/ubuntu/dynamo`
214+
- Mount your local code to `/workspace`
215215
- Run `post-create.sh` to build the project and configure the environment
216216

217217
If `post-create.sh` fails, you can try to debug or [submit](https://github.com/ai-dynamo/dynamo/issues) an issue on GitHub.
@@ -223,13 +223,13 @@ If `post-create.sh` fails, you can try to debug or [submit](https://github.com/a
223223
If you make changes to Rust code and want to compile, use [cargo build](https://doc.rust-lang.org/cargo/commands/cargo-build.html). This will update Rust binaries such as dynamo-run.
224224

225225
```bash
226-
cd /home/ubuntu/dynamo && cargo build --locked --profile dev
226+
cd /workspace && cargo build --locked --profile dev
227227
```
228228

229-
Verify that builds are in the pre-defined `dynamo/.build/target` and not `dynamo/workspace`:
229+
Verify that builds are in the pre-defined `target` directory:
230230
```bash
231231
$ cargo metadata --format-version=1 | jq -r '.target_directory'
232-
/home/ubuntu/dynamo/.build/target <-- this is the target path
232+
/workspace/target <-- this is the target path
233233
```
234234

235235
If cargo is not installed and configured properly, you will see one or more errors, such as the following:
@@ -244,22 +244,22 @@ Lastly, before pushing code to GitHub, remember to run `cargo fmt` and `cargo cl
244244
If you make changes to Rust code and want to propagate to Python bindings then can use [maturin](https://www.maturin.rs/#usage) (pre-installed). This will update the Python bindings with your new Rust changes.
245245

246246
```bash
247-
cd /home/ubuntu/dynamo/lib/bindings/python && maturin develop
247+
cd /workspace/lib/bindings/python && maturin develop
248248
```
249249

250250
## What's Inside
251251
Development Environment:
252252
- Rust and Python toolchains
253253
- GPU acceleration
254254
- VS Code or Cursor extensions for Rust and Python
255-
- Persistent build cache in `.build/` directory enables fast incremental builds (only changed files are recompiled) via `cargo build --locked --profile dev`
255+
- Persistent build cache in `target/` directory enables fast incremental builds (only changed files are recompiled) via `cargo build --locked --profile dev`
256256
- Edits to files are propagated to local repo due to the volume mount
257257
- SSH and GPG agent passthrough orchestrated by devcontainer
258258

259259
File Structure:
260-
- Local dynamo repo mounts to `/home/ubuntu/dynamo`
260+
- Local dynamo repo mounts to `/workspace`
261261
- Python venv in `/opt/dynamo/venv`
262-
- Build artifacts in `dynamo/.build/target`
262+
- Build artifacts in `/workspace/target`
263263
- Hugging Face cache preserved between sessions (either mounting your host .cache to the container, or your `HF_HOME` to `/home/ubuntu/.cache/huggingface`)
264264
- Bash memory preserved between sessions at `/home/ubuntu/.commandhistory` using docker volume `dynamo-bashhistory`
265265
- Precommit preserved between sessions at `/home/ubuntu/.cache/precommit` using docker volume `dynamo-precommit-cache`
@@ -268,7 +268,7 @@ File Structure:
268268

269269
To look at the docs run:
270270
```bash
271-
cd ~/dynamo/.build/target/doc && python3 -m http.server 8000
271+
cd /workspace/target/doc && python3 -m http.server 8000
272272
```
273273

274274
VSCode will automatically port-forward and you can check them out in your browser.
@@ -376,7 +376,7 @@ If you encounter build errors or strange compilation issues, try running `cargo
376376
If `cargo clean` doesn't resolve the issue, it is possible that some of the files were created by root (using the `run.sh` script). You can manually remove the build target by going to your host (outside the container), and remove the target:
377377

378378
```bash
379-
sudo rm -rf <your dynamo path on the host machine>/.build/target
379+
sudo rm -rf <your dynamo path on the host machine>/target
380380
```
381381

382382
### Volume Corruption Issues
@@ -426,7 +426,8 @@ If you see errors like "container is not running" or "An error occurred setting
426426
# If missing, build the dev image first, then build local-dev
427427
export FRAMEWORK=VLLM # Replace with VLLM, SGLANG, or TRTLLM
428428
./container/build.sh --framework $FRAMEWORK
429-
./container/build.sh --dev-image dynamo:latest-${FRAMEWORK,,} --framework $FRAMEWORK
429+
# change to lower case portable way across shells
430+
./container/build.sh --dev-image dynamo:latest-$(echo "$FRAMEWORK" | tr '[:upper:]' '[:lower:]') --framework "$FRAMEWORK"
430431
# Now you have dynamo:latest-vllm-local-dev
431432
```
432433

.devcontainer/devcontainer.json.j2

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
// Disable automatic copying of .gitconfig to avoid errors
3030
"dev.containers.copyGitConfig": false,
3131
"terminal.integrated.defaultProfile.linux": "bash",
32-
"terminal.integrated.cwd": "/home/ubuntu/dynamo",
32+
"terminal.integrated.cwd": "/workspace",
3333

3434
"python.defaultInterpreterPath": "/opt/dynamo/venv/bin/python",
3535
"python.linting.enabled": true,
@@ -38,7 +38,7 @@
3838
"rust-analyzer.checkOnSave.command": "clippy",
3939
"rust-analyzer.checkOnSave.enable": true,
4040
"rust-analyzer.cargo.buildScripts.enable": true,
41-
"rust-analyzer.cargo.targetDir": "/home/ubuntu/dynamo/.build/target",
41+
"rust-analyzer.cargo.targetDir": "/workspace/target",
4242
"rust-analyzer.procMacro.enable": true,
4343
"rust-analyzer.completion.autoimport.enable": true,
4444

@@ -56,16 +56,10 @@
5656
}
5757
}
5858
},
59-
"workspaceFolder": "/home/ubuntu/dynamo",
60-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/dynamo,type=bind,consistency=cached",
59+
"workspaceFolder": "/workspace",
60+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
6161
"userEnvProbe": "interactiveShell",
62-
"postCreateCommand": "/bin/bash /home/ubuntu/dynamo/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
63-
"containerEnv": {
64-
"DYNAMO_HOME": "/home/ubuntu/dynamo",
65-
"CARGO_HOME": "/home/ubuntu/dynamo/.build/.cargo",
66-
"RUSTUP_HOME": "/home/ubuntu/dynamo/.build/.rustup",
67-
"CARGO_TARGET_DIR": "/home/ubuntu/dynamo/.build/target"
68-
},
62+
"postCreateCommand": "/bin/bash /workspace/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
6963
"remoteEnv": {
7064
// Optional convenience tokens passed from host. SSH agent is forwarded via your IDE setting, not here by default.
7165
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",

.devcontainer/post-create.sh

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
set -eu
66

7-
# Set DYNAMO_HOME if not already set
8-
export DYNAMO_HOME=${DYNAMO_HOME:-/home/ubuntu/dynamo}
7+
# Use WORKSPACE_DIR if set (should be set by Dockerfile.local_dev)
8+
# Otherwise, use /workspace as fallback
9+
WORKSPACE_DIR="${WORKSPACE_DIR:-/workspace}"
910

1011
# Ensure we're not running as root
1112
if [ "$(id -u)" -eq 0 ]; then
@@ -53,11 +54,12 @@ show_and_run() {
5354
set -x
5455

5556
# Pre-commit hooks
56-
cd $DYNAMO_HOME && pre-commit install && retry pre-commit install-hooks
57+
cd $WORKSPACE_DIR && pre-commit install && retry pre-commit install-hooks
5758
pre-commit run --all-files || true # don't fail the build if pre-commit hooks fail
5859

59-
# Set build directory
60-
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-$DYNAMO_HOME/.build/target}
60+
# Use CARGO_TARGET_DIR from environment (should be set by Dockerfile.local_dev)
61+
# Fallback to $WORKSPACE_DIR/target if not set
62+
export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-$WORKSPACE_DIR/target}
6163
mkdir -p $CARGO_TARGET_DIR
6264

6365
uv pip uninstall --yes ai-dynamo ai-dynamo-runtime 2>/dev/null || true
@@ -78,27 +80,16 @@ cargo build --locked --profile dev --features dynamo-llm/block-manager
7880
# fi
7981

8082
# install ai-dynamo-runtime
81-
(cd $DYNAMO_HOME/lib/bindings/python && retry maturin develop)
83+
(cd $WORKSPACE_DIR/lib/bindings/python && retry maturin develop)
8284

8385
# install ai-dynamo
84-
cd $DYNAMO_HOME && retry env DYNAMO_BIN_PATH=$CARGO_TARGET_DIR/debug uv pip install -e .
86+
cd $WORKSPACE_DIR && retry env DYNAMO_BIN_PATH=$CARGO_TARGET_DIR/debug uv pip install -e .
8587

8688
{ set +x; } 2>/dev/null
8789

8890
echo -e "\n" >> ~/.bashrc
8991
echo "# === This section is generated by the post-create.sh script ===" >> ~/.bashrc
9092

91-
# Check if PYTHONPATH is already set in environment
92-
if [ -n "${PYTHONPATH:-}" ]; then
93-
# PYTHONPATH exists, replace /workspace with $DYNAMO_HOME
94-
export PYTHONPATH=$(echo "$PYTHONPATH" | sed "s|/workspace|$DYNAMO_HOME|g")
95-
# Also add to .bashrc for persistence
96-
if ! grep -q "export PYTHONPATH=" ~/.bashrc; then
97-
echo "# PYTHONPATH modified from /workspace to use DYNAMO_HOME" >> ~/.bashrc
98-
show_and_run echo "export PYTHONPATH=\"$PYTHONPATH\"" >> ~/.bashrc
99-
fi
100-
fi
101-
10293
if ! grep -q "export GPG_TTY=" ~/.bashrc; then
10394
show_and_run echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
10495
fi
@@ -123,7 +114,7 @@ else
123114
echo "⚠️ SSH agent forwarding not configured - SSH_AUTH_SOCK is not set"
124115
fi
125116

126-
show_and_run $DYNAMO_HOME/deploy/sanity_check.py
117+
show_and_run $WORKSPACE_DIR/deploy/sanity_check.py
127118

128119
cat <<EOF
129120

.devcontainer/sglang/devcontainer.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Disable automatic copying of .gitconfig to avoid errors
3333
"dev.containers.copyGitConfig": false,
3434
"terminal.integrated.defaultProfile.linux": "bash",
35-
"terminal.integrated.cwd": "/home/ubuntu/dynamo",
35+
"terminal.integrated.cwd": "/workspace",
3636

3737
"python.defaultInterpreterPath": "/opt/dynamo/venv/bin/python",
3838
"python.linting.enabled": true,
@@ -41,7 +41,7 @@
4141
"rust-analyzer.checkOnSave.command": "clippy",
4242
"rust-analyzer.checkOnSave.enable": true,
4343
"rust-analyzer.cargo.buildScripts.enable": true,
44-
"rust-analyzer.cargo.targetDir": "/home/ubuntu/dynamo/.build/target",
44+
"rust-analyzer.cargo.targetDir": "/workspace/target",
4545
"rust-analyzer.procMacro.enable": true,
4646
"rust-analyzer.completion.autoimport.enable": true,
4747

@@ -59,16 +59,10 @@
5959
}
6060
}
6161
},
62-
"workspaceFolder": "/home/ubuntu/dynamo",
63-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/dynamo,type=bind,consistency=cached",
62+
"workspaceFolder": "/workspace",
63+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
6464
"userEnvProbe": "interactiveShell",
65-
"postCreateCommand": "/bin/bash /home/ubuntu/dynamo/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
66-
"containerEnv": {
67-
"DYNAMO_HOME": "/home/ubuntu/dynamo",
68-
"CARGO_HOME": "/home/ubuntu/dynamo/.build/.cargo",
69-
"RUSTUP_HOME": "/home/ubuntu/dynamo/.build/.rustup",
70-
"CARGO_TARGET_DIR": "/home/ubuntu/dynamo/.build/target"
71-
},
65+
"postCreateCommand": "/bin/bash /workspace/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
7266
"remoteEnv": {
7367
// Optional convenience tokens passed from host. SSH agent is forwarded via your IDE setting, not here by default.
7468
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",

.devcontainer/trtllm/devcontainer.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Disable automatic copying of .gitconfig to avoid errors
3333
"dev.containers.copyGitConfig": false,
3434
"terminal.integrated.defaultProfile.linux": "bash",
35-
"terminal.integrated.cwd": "/home/ubuntu/dynamo",
35+
"terminal.integrated.cwd": "/workspace",
3636

3737
"python.defaultInterpreterPath": "/opt/dynamo/venv/bin/python",
3838
"python.linting.enabled": true,
@@ -41,7 +41,7 @@
4141
"rust-analyzer.checkOnSave.command": "clippy",
4242
"rust-analyzer.checkOnSave.enable": true,
4343
"rust-analyzer.cargo.buildScripts.enable": true,
44-
"rust-analyzer.cargo.targetDir": "/home/ubuntu/dynamo/.build/target",
44+
"rust-analyzer.cargo.targetDir": "/workspace/target",
4545
"rust-analyzer.procMacro.enable": true,
4646
"rust-analyzer.completion.autoimport.enable": true,
4747

@@ -59,16 +59,10 @@
5959
}
6060
}
6161
},
62-
"workspaceFolder": "/home/ubuntu/dynamo",
63-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/dynamo,type=bind,consistency=cached",
62+
"workspaceFolder": "/workspace",
63+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
6464
"userEnvProbe": "interactiveShell",
65-
"postCreateCommand": "/bin/bash /home/ubuntu/dynamo/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
66-
"containerEnv": {
67-
"DYNAMO_HOME": "/home/ubuntu/dynamo",
68-
"CARGO_HOME": "/home/ubuntu/dynamo/.build/.cargo",
69-
"RUSTUP_HOME": "/home/ubuntu/dynamo/.build/.rustup",
70-
"CARGO_TARGET_DIR": "/home/ubuntu/dynamo/.build/target"
71-
},
65+
"postCreateCommand": "/bin/bash /workspace/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
7266
"remoteEnv": {
7367
// Optional convenience tokens passed from host. SSH agent is forwarded via your IDE setting, not here by default.
7468
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",

.devcontainer/vllm/devcontainer.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Disable automatic copying of .gitconfig to avoid errors
3333
"dev.containers.copyGitConfig": false,
3434
"terminal.integrated.defaultProfile.linux": "bash",
35-
"terminal.integrated.cwd": "/home/ubuntu/dynamo",
35+
"terminal.integrated.cwd": "/workspace",
3636

3737
"python.defaultInterpreterPath": "/opt/dynamo/venv/bin/python",
3838
"python.linting.enabled": true,
@@ -41,7 +41,7 @@
4141
"rust-analyzer.checkOnSave.command": "clippy",
4242
"rust-analyzer.checkOnSave.enable": true,
4343
"rust-analyzer.cargo.buildScripts.enable": true,
44-
"rust-analyzer.cargo.targetDir": "/home/ubuntu/dynamo/.build/target",
44+
"rust-analyzer.cargo.targetDir": "/workspace/target",
4545
"rust-analyzer.procMacro.enable": true,
4646
"rust-analyzer.completion.autoimport.enable": true,
4747

@@ -59,16 +59,10 @@
5959
}
6060
}
6161
},
62-
"workspaceFolder": "/home/ubuntu/dynamo",
63-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/dynamo,type=bind,consistency=cached",
62+
"workspaceFolder": "/workspace",
63+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
6464
"userEnvProbe": "interactiveShell",
65-
"postCreateCommand": "/bin/bash /home/ubuntu/dynamo/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
66-
"containerEnv": {
67-
"DYNAMO_HOME": "/home/ubuntu/dynamo",
68-
"CARGO_HOME": "/home/ubuntu/dynamo/.build/.cargo",
69-
"RUSTUP_HOME": "/home/ubuntu/dynamo/.build/.rustup",
70-
"CARGO_TARGET_DIR": "/home/ubuntu/dynamo/.build/target"
71-
},
65+
"postCreateCommand": "/bin/bash /workspace/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
7266
"remoteEnv": {
7367
// Optional convenience tokens passed from host. SSH agent is forwarded via your IDE setting, not here by default.
7468
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",

0 commit comments

Comments
 (0)