Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 1 deletion notebooks/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11.11
# create non-root user and set the default user
ARG USERNAME=devuser
ARG USER_UID=1010
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.ruff]
target-version = "py39"
target-version = "py311"
extend-exclude = ["notebooks"]

[tool.ruff.lint]
Expand Down
2 changes: 1 addition & 1 deletion src/sample_cpu_project/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11.11
# create non-root user and set the default user
ARG USERNAME=devuser
ARG USER_UID=1010
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
Expand Down
24 changes: 8 additions & 16 deletions src/sample_pytorch_gpu_project/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
# leverage multi-stage build and copy python binaries to cuda container
FROM python:3.11.11 as python
FROM nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04
COPY --from=python /usr/local/ /usr/local/

RUN apt-get update \
&& apt-get install -y \
wget \
git \
sudo \
&& rm -rf /var/lib/apt/lists/*

FROM python:3.11.11
# install Azure CLI
RUN wget -qO- https://aka.ms/InstallAzureCLIDeb | bash

# create non-root user and set the default user
ARG USERNAME=devuser
# uid=1000 is already used for ubuntu so use 1010 instead
Comment thread
bhavikm marked this conversation as resolved.
ARG USER_UID=1010
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# Add sudo support
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& rm -rf /var/lib/apt/lists/*
USER $USERNAME


# make all python tools installed by pip accesible
ENV PATH=$PATH:/home/$USERNAME/.local/bin

Expand Down
2 changes: 2 additions & 0 deletions src/sample_pytorch_gpu_project/sample_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def main():
print("torch.backends.cudnn.is_available():", torch.backends.cudnn.is_available())
print("torch.backends.cuda.is_built():", torch.backends.cuda.is_built())
print("torch.backends.mkldnn.is_available():", torch.backends.mkldnn.is_available())
print("torch.version.cuda:", torch.version.cuda)
print("torch.backends.cudnn.version():", torch.backends.cudnn.version())


if __name__ == "__main__":
Expand Down