devcontainer.json.j2 3.64 KB
Newer Older
1
{
2
    "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
3
    "copyright": [
4
        "SPDX-FileCopyrightText: Copyright (c) {{ current_year }} NVIDIA CORPORATION & AFFILIATES. All rights reserved.",
5
        "SPDX-License-Identifier: Apache-2.0"
6
    ],
7
    "name": "Dynamo {{ framework.upper() }} Dev Container",
8
9
    "remoteUser": "ubuntu", // Matches our container user
    "updateRemoteUserUID": true, // Updates the UID of the remote user to match the host user, avoids permission errors
10
    "image": "dynamo:latest-{{ framework }}-local-dev", // Use the latest {{ framework.upper() }} dev image
11
    "runArgs": [
12
13
14
15
16
17
        "--gpus=all",
        "--network=host",
        "--ipc=host",
        "--cap-add=SYS_PTRACE",
        "--shm-size=10G",
        "--ulimit=memlock=-1",
18
        "--ulimit=stack=67108864",
19
        "--ulimit=nofile=65536:65536"
20
21
22
23
24
    ],
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-python.python",
25
26
                "ms-python.vscode-pylance",
                "rust-lang.rust-analyzer"
27
28
            ],
            "settings": {
29
30
                // Disable automatic copying of .gitconfig to avoid errors
                "dev.containers.copyGitConfig": false,
31
                "terminal.integrated.defaultProfile.linux": "bash",
32
                "terminal.integrated.cwd": "/workspace",
33
34

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

37
                "rust-analyzer.memoryLimit": 4096, // larger memory limit to reduce latency
38
39
                "rust-analyzer.checkOnSave.command": "clippy",
                "rust-analyzer.checkOnSave.enable": true,
40
                "rust-analyzer.cargo.buildScripts.enable": true,
41
                "rust-analyzer.cargo.targetDir": "/workspace/target",
42
43
44
45
46
                "rust-analyzer.procMacro.enable": true,
                "rust-analyzer.completion.autoimport.enable": true,

                // Enhanced rust-analyzer configuration
                "rust-analyzer.linkedProjects": [
47
48
49
50
51
52
                    "Cargo.toml",
                    "lib/runtime/Cargo.toml",
                    "lib/llm/Cargo.toml",
                    "lib/tokens/Cargo.toml",
                    "lib/bindings/python/Cargo.toml",
                    "launch/dynamo-run/Cargo.toml"
53
                ],
54
55
                "files.trimTrailingWhitespace": true,
                "files.insertFinalNewline": true
56
57
58
            }
        }
    },
59
60
    "workspaceFolder": "/workspace",
    "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
61
    "userEnvProbe": "interactiveShell",
62
    "postCreateCommand": "/bin/bash /workspace/.devcontainer/post-create.sh", // Runs cargo build and pip installs packages
63
    "remoteEnv": {
64
        // Optional convenience tokens passed from host. SSH agent is forwarded via your IDE setting, not here by default.
65
66
        "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
        "HF_TOKEN": "${localEnv:HF_TOKEN}"
67
        // "SSH_AUTH_SOCK": "${env:SSH_AUTH_SOCK}" // Optional: only if you also bind-mount the socket path
68
69
    },
    "mounts": [
70
71
72
        // These are for convenience, so that the history and pre-commit cache are persisted between sessions
        "source=dynamo-bashhistory,target=/home/ubuntu/.commandhistory,type=volume",
        "source=dynamo-precommit-cache,target=/home/ubuntu/.cache/pre-commit,type=volume",
73
        // Default mounts
74
75
76
        "source=/tmp/,target=/tmp/,type=bind"
        // Uncomment this to reuse your Hugging Face cache
        //"source=${localEnv:HOME}/.cache/huggingface,target=/home/ubuntu/.cache/huggingface,type=bind"
77
78
    ]
}