{
    "$schema": "https://json-schema.org/draft-07/schema#",
    "copyright": [
        "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."
    ],
    "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
    "runArgs": [
        "--gpus=all",
        "--network=host",
        "--ipc=host",
        "--cap-add=SYS_PTRACE",
        "--shm-size=10G",
        "--ulimit=memlock=-1",
        "--ulimit=stack=67108864",
        "--ulimit=nofile=65536:65536"
    ],
    "service": "dynamo",
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-python.python",
                "ms-python.vscode-pylance",
                "rust-lang.rust-analyzer"
            ],
            "settings": {
                "terminal.integrated.defaultProfile.linux": "bash",
                "terminal.integrated.cwd": "/home/ubuntu/dynamo",

                "python.defaultInterpreterPath": "/opt/dynamo/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.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"
                ],

                "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
    "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"
    },
    "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
    ]
}
