|
| 1 | +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: |
| 2 | +// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3 |
| 3 | +{ |
| 4 | + "name": "Python 3 (litgpt)", |
| 5 | + "build": { |
| 6 | + "dockerfile": "Dockerfile", |
| 7 | + "context": "..", |
| 8 | + "args": { |
| 9 | + "VARIANT": "3.11-bookworm" |
| 10 | + } |
| 11 | + }, |
| 12 | + "runArgs": [ |
| 13 | + // Enable GPU passthrough, requires WSL2 on Windows |
| 14 | + //"--gpus=all", |
| 15 | + // One of the following options is required for torch multiprocessing |
| 16 | + //"--ipc=host", |
| 17 | + //"--shm-size=4gb", |
| 18 | + ], |
| 19 | + // Features to add to the dev container. More info: https://containers.dev/features. |
| 20 | + "features": { |
| 21 | + "ghcr.io/devcontainers/features/git:1": {}, |
| 22 | + "ghcr.io/devcontainers/features/git-lfs:1": {}, |
| 23 | + //"ghcr.io/devcontainers/features/nvidia-cuda:1": {}, |
| 24 | + "ghcr.io/devcontainers-extra/features/actionlint:1": {}, |
| 25 | + "ghcr.io/devcontainers-extra/features/pre-commit:2": {}, |
| 26 | + "ghcr.io/dhoeric/features/act:1": {}, |
| 27 | + "ghcr.io/devcontainers/features/docker-in-docker:2": { |
| 28 | + "version": "latest", |
| 29 | + "moby": true |
| 30 | + } |
| 31 | + }, |
| 32 | + // Set *default* container specific settings.json values on container create. |
| 33 | + "customizations": { |
| 34 | + "vscode": { |
| 35 | + "settings": { |
| 36 | + "editor.tabSize": 4, |
| 37 | + "editor.renderWhitespace": "all", |
| 38 | + "editor.formatOnSave": true, |
| 39 | + "editor.rulers": [120], |
| 40 | + "files.exclude": { |
| 41 | + "**/__pycache__": true |
| 42 | + }, |
| 43 | + "python.pythonPath": "/usr/local/bin/python", |
| 44 | + "python.defaultInterpreterPath": "/usr/local/bin/python", |
| 45 | + "python.languageServer": "Pylance", |
| 46 | + "python.analysis.autoImportCompletions": true, |
| 47 | + "python.analysis.completeFunctionParens": true, |
| 48 | + "python.analysis.autoSearchPaths": true, |
| 49 | + "python.testing.pytestArgs": ["tests"], |
| 50 | + "python.testing.unittestEnabled": false, |
| 51 | + "python.testing.pytestEnabled": true, |
| 52 | + "code-eol.highlightNonDefault": true, |
| 53 | + "code-eol.highlightExtraWhitespace": true, |
| 54 | + "autoDocstring.docstringFormat": "google-notypes", |
| 55 | + "autoDocstring.guessTypes": true, |
| 56 | + "autoDocstring.generateDocstringOnEnter": true, |
| 57 | + "autoDocstring.startOnNewLine": true, |
| 58 | + "telemetry.telemetryLevel": "off", |
| 59 | + "[python]": { |
| 60 | + "editor.formatOnSave": true, |
| 61 | + "editor.defaultFormatter": "charliermarsh.ruff", |
| 62 | + "editor.codeActionsOnSave": { |
| 63 | + "source.organizeImports": "always", |
| 64 | + "source.fixAll": "always" |
| 65 | + } |
| 66 | + } |
| 67 | + }, |
| 68 | + // Add the IDs of extensions you want installed when the container is created. |
| 69 | + "extensions": [ |
| 70 | + "ms-python.python", |
| 71 | + "ms-python.vscode-pylance", |
| 72 | + "ms-toolsai.jupyter", |
| 73 | + "GitHub.copilot", |
| 74 | + "GitHub.copilot-chat", |
| 75 | + "github.vscode-github-actions", |
| 76 | + "SanjulaGanepola.github-local-actions", |
| 77 | + "charliermarsh.ruff", |
| 78 | + "esbenp.prettier-vscode", |
| 79 | + "ms-vscode.test-adapter-converter", |
| 80 | + "njqdev.vscode-python-typehint", |
| 81 | + "KevinRose.vsc-python-indent", |
| 82 | + "medo64.render-crlf", |
| 83 | + "shardulm94.trailing-spaces", |
| 84 | + "nhoizey.gremlins", |
| 85 | + "wayou.vscode-todo-highlight", |
| 86 | + "Gruntfuggly.todo-tree", |
| 87 | + "njpwerner.autodocstring", |
| 88 | + "rodolphebarbanneau.python-docstring-highlighter", |
| 89 | + "mechatroner.rainbow-csv", |
| 90 | + "uctakeoff.vscode-counter", |
| 91 | + "bierner.github-markdown-preview", |
| 92 | + "yahyabatulu.vscode-markdown-alert", |
| 93 | + "ms-vscode-remote.vscode-remote-extensionpack", |
| 94 | + "ms-azuretools.vscode-docker", |
| 95 | + "redhat.vscode-yaml" |
| 96 | + ] |
| 97 | + } |
| 98 | + }, |
| 99 | + // Use 'forwardPorts' to make a list of ports inside the container available locally. |
| 100 | + // "forwardPorts": [], |
| 101 | + // Use 'postCreateCommand' to run commands after the container is created. |
| 102 | + "postCreateCommand": "pre-commit install && pip install '.[extra,compiler,test]' -U", |
| 103 | + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
| 104 | + "remoteUser": "vscode" |
| 105 | +} |
0 commit comments