fix: Use local dirname
Use local dirname for devcontainer mounting
This commit is contained in:
parent
cb5a6fbd87
commit
ff462d867a
2 changed files with 16 additions and 13 deletions
|
|
@ -17,13 +17,14 @@ ENV LD_LIBRARY_PATH=/usr/lib/nvidia
|
|||
ENV NVIDIA_VISIBLE_DEVICES=all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
|
||||
|
||||
# Set the standardized workspace path
|
||||
ENV WORKSPACE_PATH=/workspaces/project
|
||||
# Set the workspace path (defaults to /workspaces/project but can be overridden)
|
||||
ARG WORKSPACE_PATH=/workspaces/project
|
||||
ENV WORKSPACE_PATH=$WORKSPACE_PATH
|
||||
ENV PATH="$WORKSPACE_PATH/.venv/bin:$PATH"
|
||||
|
||||
# Ensure the workspace directory exists and is owned by the vscode user
|
||||
# Ensure the workspace and .venv directories exist and are owned by the vscode user
|
||||
# This prevents permission errors when the postCreateCommand runs uv sync
|
||||
RUN mkdir -p $WORKSPACE_PATH && chown vscode:vscode $WORKSPACE_PATH
|
||||
RUN mkdir -p $WORKSPACE_PATH/.venv && chown -R vscode:vscode $WORKSPACE_PATH
|
||||
|
||||
USER vscode
|
||||
WORKDIR $WORKSPACE_PATH
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
"name": "Brittle Star JAX/CUDA",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"context": ".."
|
||||
"context": "..",
|
||||
"args": {
|
||||
"WORKSPACE_PATH": "/workspaces/${localWorkspaceFolderBasename}"
|
||||
}
|
||||
},
|
||||
// Standardize workspace folder to /workspaces/project for IDE parity
|
||||
"workspaceFolder": "/workspaces/project",
|
||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
|
|
@ -15,10 +17,10 @@
|
|||
"ms-toolsai.jupyter"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/workspaces/project/.venv/bin/python",
|
||||
"python.analysis.localRoot": "/workspaces/project",
|
||||
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python",
|
||||
"python.analysis.localRoot": "${containerWorkspaceFolder}",
|
||||
"python.analysis.extraPaths": [
|
||||
"/workspaces/project/.venv/lib/python3.12/site-packages"
|
||||
"${containerWorkspaceFolder}/.venv/lib/python3.12/site-packages"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
@ -37,11 +39,11 @@
|
|||
],
|
||||
// Ensure the .venv persists using a named volume for performance and parity
|
||||
"mounts": [
|
||||
"source=brittle_star-venv,target=/workspaces/project/.venv,type=volume"
|
||||
"source=${localWorkspaceFolderBasename}-venv,target=${containerWorkspaceFolder}/.venv,type=volume"
|
||||
],
|
||||
// Invoke the hardware-aware sync script
|
||||
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
||||
"postCreateCommand": "bash ./.devcontainer/post-create.sh",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/common-utils:1": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in a new issue