{
    "name": "MemCache Dev Container",
    "build": {
        "dockerfile": "Dockerfile",
        "context": "..",
        "options": [
            "--network=host"
        ]
    },
    "mounts": [
        "source=memcache-pip-cache-${localEnv:USER:unknown},target=/root/.cache/pip,type=volume",
        "source=memcache-ccache-${localEnv:USER:unknown},target=/root/.ccache,type=volume",
        "source=/usr/local/dcmi,target=/usr/local/dcmi,type=bind",
        "source=/usr/local/Ascend/driver/tools/hccn_tool,target=/usr/local/Ascend/driver/tools/hccn_tool,type=bind",
        "source=/usr/local/bin/npu-smi,target=/usr/local/bin/npu-smi,type=bind",
        "source=/usr/local/Ascend/driver/lib64/,target=/usr/local/Ascend/driver/lib64/,type=bind",
        "source=/usr/local/Ascend/driver/version.info,target=/usr/local/Ascend/driver/version.info,type=bind",
        "source=/etc/ascend_install.info,target=/etc/ascend_install.info,type=bind",
        "source=/etc/hccn.conf,target=/etc/hccn.conf,type=bind",
        "source=memcache-precommit-cache-${localEnv:USER:unknown},target=/root/.cache/pre-commit,type=volume",
        "source=/mnt,target=/mnt,type=bind,consistency=cached",
        "source=/home,target=/home,type=bind,consistency=cached",
        "source=/root,target=/root,type=bind,consistency=cached"
    ],
    "runArgs": [
        "--network=host",
        "--privileged",
        "--shm-size=2g",
        "--device",
        "/dev/davinci_manager",
        "--device",
        "/dev/devmm_svm",
        "--device",
        "/dev/hisi_hdc"
    ],
    "containerEnv": {
        "PYTHONUNBUFFERED": "1",
        "CMAKE_BUILD_PARALLEL_LEVEL": "${localEnv:NPROCS}",
        "MMC_BUILD_JOBS": "${localEnv:NPROCS}",
        "PIP_INDEX_URL": "https://mirrors.aliyun.com/pypi/simple/",
        "PIP_TRUSTED_HOST": "mirrors.aliyun.com",
        "PRE_COMMIT_HOME": "/root/.cache/pre-commit",
        "PIP_SYSTEM_SITE_PACKAGES": "1",
        "GOPROXY": "https://goproxy.cn,direct",
        "GOTOOLCHAIN": "local"
    },
    "postCreateCommand": "bash .devcontainer/post_create.sh",
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-python.python",
                "ms-python.vscode-pylance",
                "ms-python.debugpy",
                "charliermarsh.ruff",
                "ms-vscode.cpptools",
                "ms-vscode.cpptools-extension-pack",
                "twxs.cmake",
                "ms-vscode.cmake-tools",
                "ms-vscode-remote.remote-containers",
                "ms-vscode.docker",
                "esbenp.prettier-vscode",
                "editorconfig.editorconfig",
                "eamodio.gitlens",
                "redhat.vscode-yaml",
                "tamasfe.even-better-toml",
                "yzhang.markdown-all-in-one"
            ],
            "settings": {
                "python.defaultInterpreterPath": "/usr/local/python3.11.15/bin/python",
                "python.terminal.activateEnvironment": false,
                "cmake.configureOnOpen": true,
                "cmake.buildDirectory": "${workspaceFolder}/build",
                "cmake.options.statusBarVisibility": "compact",
                "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
                "editor.formatOnSave": true,
                "editor.rulers": [
                    100,
                    120
                ],
                "files.trimTrailingWhitespace": true,
                "files.insertFinalNewline": true,
                "terminal.integrated.defaultProfile.linux": "bash"
            }
        }
    },
    "postStartCommand": "git submodule update --init 3rdparty/",
    "remoteUser": "root"
}