mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Devcontainer: Fix context path and workspace mount (#152880)
## Summary - Changed the devcontainer context path from '../..' to './' for both CPU and CUDA configurations - Added workspace mount configuration to properly mount the repository in the container - Added containerEnv to disable implicit --user pip flag ## Test plan Test by building and running the devcontainer in VS Code Pull Request resolved: https://github.com/pytorch/pytorch/pull/152880 Approved by: https://github.com/atalman
This commit is contained in:
committed by
PyTorch MergeBot
parent
08f5371571
commit
200df50c05
@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "PyTorch - CPU",
|
||||
"build": {
|
||||
"context": "../..",
|
||||
"context": "./",
|
||||
"dockerfile": "../Dockerfile",
|
||||
"args": {
|
||||
"USERNAME": "vscode",
|
||||
@ -11,6 +11,12 @@
|
||||
"CLANG_VERSION": ""
|
||||
}
|
||||
},
|
||||
// Mount the full repo only after the container starts
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/pytorch,type=bind,consistency=cached",
|
||||
"workspaceFolder": "/workspace/pytorch",
|
||||
"containerEnv": {
|
||||
"PIP_USER": "0" // <‑‑ disable implicit --user
|
||||
},
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
|
@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "PyTorch - CUDA",
|
||||
"build": {
|
||||
"context": "../..",
|
||||
"context": "./",
|
||||
"dockerfile": "../Dockerfile",
|
||||
"args": {
|
||||
"USERNAME": "vscode",
|
||||
@ -12,7 +12,13 @@
|
||||
"CLANG_VERSION": ""
|
||||
}
|
||||
},
|
||||
"runArgs": ["--gpus", "all"],
|
||||
"runArgs": ["--runtime", "nvidia", "--gpus", "all"],
|
||||
// Mount the full repo only after the container starts
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/pytorch,type=bind,consistency=cached",
|
||||
"workspaceFolder": "/workspace/pytorch",
|
||||
"containerEnv": {
|
||||
"PIP_USER": "0" // <‑‑ disable implicit --user
|
||||
},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
|
Reference in New Issue
Block a user