Skip to content

Commit 46b8c66

Browse files
fix: small qol improvements to devcontainer (#1427)
Signed-off-by: Alec <35311602+alec-flowers@users.noreply.github.com> Co-authored-by: Ryan McCormick <rmccormick@nvidia.com>
1 parent 9281c95 commit 46b8c66

File tree

4 files changed

+48
-12
lines changed

4 files changed

+48
-12
lines changed

.devcontainer/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717

1818
# NVIDIA Dynamo Development Environment
1919

20-
> Warning: devcontainers is an experimental feature and we are not testing in CI. Please submit any feedback using the issues on github.
20+
> Warning: devcontainers is an experimental feature and we are not testing in CI. Please submit any feedback using the issues on GitHub.
2121
2222
## Prerequisites
2323
- [Docker](https://docs.docker.com/get-started/get-docker/) installed and configured on your host system
@@ -51,7 +51,23 @@ Make sure HF_HOME is sourced in your .bashrc or .zshenv and your vscode default
5151
- The container will mount your local code
5252
- `post-create.sh` will build the project and configure the environment
5353

54-
If `post-create.sh` fails, you can try to debug or [submit](https://github.com/ai-dynamo/dynamo/issues) an issue on github.
54+
If `post-create.sh` fails, you can try to debug or [submit](https://github.com/ai-dynamo/dynamo/issues) an issue on GitHub.
55+
56+
## Development Flow
57+
58+
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.
59+
60+
```bash
61+
cd /home/ubuntu/dynamo && cargo build --locked --profile dev
62+
```
63+
64+
Before pushing code to GitHub, remember to run `cargo fmt` and `cargo clippy`
65+
66+
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.
67+
68+
```bash
69+
cd /home/ubuntu/dynamo/lib/bindings/python && maturin develop
70+
```
5571

5672
## What's Inside
5773
Development Environment:
@@ -80,6 +96,15 @@ Edit `.devcontainer/devcontainer.json` to modify:
8096
- Container configuration
8197
- Custom Mounts
8298

99+
## Documentation
100+
101+
To look at the docs run:
102+
```bash
103+
cd ~/dynamo/.build/target/doc && python3 -m http.server 8000
104+
```
105+
106+
VSCode will automatically port-forward and you can check them out in your browser.
107+
83108
## FAQ
84109

85110
### GPG Keys for Signing Git Commits

.devcontainer/devcontainer.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"vscode": {
3333
"extensions": [
3434
"ms-python.python",
35-
"ms-python.pylint",
3635
"ms-python.vscode-pylance",
3736
"rust-lang.rust-analyzer"
3837
],
@@ -42,10 +41,24 @@
4241

4342
"python.defaultInterpreterPath": "/opt/dynamo/venv/bin/python",
4443
"python.linting.enabled": true,
45-
"python.linting.pylintEnabled": true,
4644

45+
"rust-analyzer.memoryLimit": 4096, // larger memory limit to reduce latency
4746
"rust-analyzer.checkOnSave.command": "clippy",
4847
"rust-analyzer.checkOnSave.enable": true,
48+
"rust-analyzer.cargo.buildScripts.enable": true,
49+
"rust-analyzer.cargo.targetDir": "/home/ubuntu/dynamo/.build/target",
50+
"rust-analyzer.procMacro.enable": true,
51+
"rust-analyzer.completion.autoimport.enable": true,
52+
53+
// Enhanced rust-analyzer configuration
54+
"rust-analyzer.linkedProjects": [
55+
"dynamo/Cargo.toml",
56+
"dynamo/lib/runtime/Cargo.toml",
57+
"dynamo/lib/llm/Cargo.toml",
58+
"dynamo/lib/tokens/Cargo.toml",
59+
"dynamo/lib/bindings/python/Cargo.toml",
60+
"dynamo/launch/dynamo-run/Cargo.toml"
61+
],
4962

5063
"files.trimTrailingWhitespace": true,
5164
"files.insertFinalNewline": true

.devcontainer/post-create.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,15 @@ ln -sf $HOME/dynamo/.build/target/debug/dynamo-run $HOME/dynamo/deploy/sdk/src/d
5858
ln -sf $HOME/dynamo/.build/target/debug/http $HOME/dynamo/deploy/sdk/src/dynamo/sdk/cli/bin/http
5959
ln -sf $HOME/dynamo/.build/target/debug/llmctl $HOME/dynamo/deploy/sdk/src/dynamo/sdk/cli/bin/llmctl
6060

61-
# install the python bindings in editable mode
62-
cd $HOME/dynamo/lib/bindings/python && retry uv pip install -e .
61+
# install the python bindings
62+
cd $HOME/dynamo/lib/bindings/python && retry maturin develop
63+
64+
# installs overall python packages, grabs binaries from .build/target/debug
6365
cd $HOME/dynamo && retry env DYNAMO_BIN_PATH=$HOME/dynamo/.build/target/debug uv pip install -e .
6466

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

67-
# Add to bashrc only if not already present
68-
if ! grep -q "source /opt/dynamo/venv/bin/activate" ~/.bashrc; then
69-
echo "source /opt/dynamo/venv/bin/activate" >> ~/.bashrc
70-
fi
71-
69+
# TODO: Deprecated except vLLM v0
7270
if ! grep -q "export VLLM_KV_CAPI_PATH=" ~/.bashrc; then
7371
echo "export VLLM_KV_CAPI_PATH=$HOME/dynamo/.build/target/debug/libdynamo_llm_capi.so" >> ~/.bashrc
7472
fi

container/Dockerfile.vllm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ RUN chown $USERNAME:$USERNAME /opt/dynamo/venv
308308
COPY --from=base --chown=$USERNAME:$USERNAME /usr/local/bin /usr/local/bin
309309

310310
# so we can use maturin develop
311-
RUN uv pip install maturin
311+
RUN uv pip install maturin[patchelf]
312312

313313
USER $USERNAME
314314
ENV HOME=/home/$USERNAME

0 commit comments

Comments
 (0)