-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into notebooks-mpc
- Loading branch information
Showing
49 changed files
with
3,912 additions
and
1,255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM nvidia/cuda:12.6.3-devel-ubuntu22.04 | ||
|
||
# Prevent interactive prompts during package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
python3.11 \ | ||
python3-pip \ | ||
python3.11-venv \ | ||
build-essential \ | ||
git \ | ||
curl \ | ||
ssh \ | ||
mesa-utils \ | ||
&& rm -rf /var/lib/apt/lists/* && apt-get clean | ||
|
||
# Create symbolic links for python | ||
RUN ln -sf /usr/bin/python3.11 /usr/bin/python \ | ||
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 | ||
|
||
# Create non-root user | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
# Set environment variables for CUDA | ||
ENV PATH="/usr/local/cuda-12.0/bin:${PATH}" | ||
ENV LD_LIBRARY_PATH="/usr/local/cuda-12.0/lib64:${LD_LIBRARY_PATH}" | ||
|
||
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all} | ||
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics | ||
|
||
# Create and set proper permissions for workspace directory | ||
RUN mkdir -p /workspace && chown -R $USERNAME:$USERNAME /workspace && sudo chmod -R 777 /workspace | ||
|
||
# Create virtual environment with proper permissions | ||
ENV VIRTUAL_ENV=/home/vscode/venv | ||
RUN python -m venv $VIRTUAL_ENV && \ | ||
chown -R $USERNAME:$USERNAME $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
# Switch to non-root user | ||
USER $USERNAME | ||
|
||
# Install development tools | ||
RUN pip install --no-cache-dir ruff | ||
|
||
# Create a temporary directory for installation with proper permissions | ||
WORKDIR /tmp/install | ||
|
||
# Copy pyproject.toml with correct ownership | ||
COPY --chown=$USERNAME:$USERNAME pyproject.toml . | ||
|
||
# Install dependencies as non-root user | ||
RUN pip install --no-cache-dir -e ".[test,gpu]" | ||
|
||
# Set final working directory and ensure proper permissions | ||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"name": "Crazyflow Development", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.pylance", | ||
"charliermarsh.ruff", | ||
"ms-vscode.test-adapter-converter", | ||
"ms-python.pytest-adapter", | ||
"nvidia.nsight-vscode-edition", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.jupyter-keymap" | ||
], | ||
"settings": { | ||
"python.defaultInterpreterPath": "/home/vscode/venv/bin/python", | ||
"python.testing.pytestEnabled": true, // test framework | ||
"python.testing.pytestArgs": [ | ||
"-m", | ||
"not render" | ||
], | ||
"python.testing.unittestEnabled": false, // test framework | ||
"python.testing.nosetestsEnabled": false, // test framework | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.ruff": true, | ||
"source.organizeImports.ruff": true | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true, | ||
"editor.rulers": [ | ||
100 | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"containerEnv": { | ||
"DISPLAY": "${localEnv:DISPLAY}", | ||
"XAUTHORITY": "${localEnv:XAUTHORITY}" | ||
}, | ||
"runArgs": [ | ||
"--interactive", | ||
"--net=host", | ||
"--ipc=host", | ||
// "--gpus=all", //use only with GPU | ||
// "--runtime=nvidia" //use only with GPU | ||
], | ||
"postCreateCommand": "python -m pip install -e '.[test,gpu]'", | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "Crazyflow Development", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.pylance", | ||
"charliermarsh.ruff", | ||
"ms-vscode.test-adapter-converter", | ||
"ms-python.pytest-adapter", | ||
"nvidia.nsight-vscode-edition", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.jupyter-keymap" | ||
], | ||
"settings": { | ||
"python.defaultInterpreterPath": "/home/vscode/venv/bin/python", | ||
"python.testing.pytestEnabled": true, // test framework | ||
"python.testing.pytestArgs": [ | ||
"-m", | ||
"not render" | ||
], | ||
"python.testing.unittestEnabled": false, // test framework | ||
"python.testing.nosetestsEnabled": false, // test framework | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.ruff": true, | ||
"source.organizeImports.ruff": true | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true, | ||
"editor.rulers": [ | ||
100 | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
// mounts required for WSL2 X11 | ||
"mounts": [ | ||
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind", | ||
"source=/mnt/wslg,target=/mnt/wslg,type=bind", | ||
"source=/usr/lib/wsl,target=/usr/lib/wsl,type=bind" | ||
],"containerEnv": { | ||
"DISPLAY": "${localEnv:DISPLAY}", | ||
"XAUTHORITY": "${localEnv:XAUTHORITY}", | ||
"WAYLAND_DISPLAY": "${localEnv:WAYLAND_DISPLAY}", // WSL2 | ||
"XDG_RUNTIME_DIR": "${localEnv:XDG_RUNTIME_DIR}", // WSL2 | ||
"PULSE_SERVER": "${localEnv:PULSE_SERVER}" // WSL2 | ||
}, | ||
"runArgs": [ | ||
"--interactive", | ||
"--net=host", | ||
"--ipc=host" | ||
// "--gpus=all", //use only with GPU | ||
// "--runtime=nvidia" //use only with GPU | ||
], | ||
"postCreateCommand": "python -m pip install -e '.[test,gpu]'", | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
.vscode/ | ||
**.egg-info/ | ||
**/__pycache__/ | ||
logs | ||
secrets | ||
**/*.secret | ||
saves | ||
.pytest_cache | ||
**/*.json | ||
*.json | ||
**/*.csv | ||
build | ||
.venv | ||
!/.devcontainer/devcontainer.json | ||
!/.devcontainer/devcontainer.linux.json | ||
!/.devcontainer/devcontainer.wsl2.json | ||
!/.vscode/launch.json | ||
c_generated_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: Current File", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": false | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.