Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/.dockerfilelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rules:
sudo_usage: off
26 changes: 26 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use Python:3.12-slim image as the base image as the PyTorch image
# https://hub.docker.com/r/pytorch/pytorch is too big (>3GB).
Comment thread
jbcoe marked this conversation as resolved.
Outdated
FROM python:3.12-slim

# Install essential packages and create non-root user
RUN apt-get update && apt-get install -y --no-install-recommends git curl sudo bash-completion vim \
Comment thread
jbcoe marked this conversation as resolved.
&& useradd -m -s /bin/bash vscode \
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& mkdir -p /workspace \
&& chown vscode:vscode /workspace \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

# Switch to non-root user
USER vscode

# Set up shell completions
RUN echo 'source /usr/share/bash-completion/completions/git' >> ~/.bashrc \
&& echo 'source /etc/bash_completion' >> ~/.bashrc

# Set up uv and Python environment
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
Comment thread
jbcoe marked this conversation as resolved.

# Set up environment variables
ENV PATH="/home/vscode/.local/bin:${PATH}"
52 changes: 52 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "py_cppmodel Dev Container",
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The container name uses an underscore ("py_cppmodel Dev Container") while the project name in pyproject.toml uses a hyphen ("py-cppmodel"). For consistency with the project naming conventions, consider using "py-cppmodel Dev Container" instead.

Suggested change
"name": "py_cppmodel Dev Container",
"name": "py-cppmodel Dev Container",

Copilot uses AI. Check for mistakes.
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow",
"tamasfe.even-better-toml"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml",
"editor.formatOnSave": true
},
"evenBetterToml.schema.enabled": true,
"evenBetterToml.schema.associations": {
"pyproject.toml": "https://json.schemastore.org/pyproject.json"
}
}
}
},
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SSH mount attempts to support both Unix (HOME) and Windows (USERPROFILE) by concatenating environment variables. However, if both variables are set (which can happen on Windows with Git Bash or WSL), this will concatenate both paths creating an invalid path. A more robust approach would be to use conditional mounting or test this configuration on both platforms to ensure it works as intended.

Suggested change
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just use the UNIX-compliant path.

],
"remoteUser": "vscode",
"updateRemoteUserUID": true,
"remoteEnv": {
"UV_LINK_MODE": "copy"
}
}