Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Mar 29, 2024
1 parent 39b1dd5 commit 4966a1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
47 changes: 21 additions & 26 deletions docker/cpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
ARG UBUNTU_VERSION=20.04
ARG UBUNTU_VERSION=22.04

FROM ubuntu:${UBUNTU_VERSION}

# Ignore interactive questions during `docker build`
# Install necessary packages
ENV PATH="/home/user/.local/bin:${PATH}"
ENV DEBIAN_FRONTEND noninteractive

# Run as non-root user
ARG USER_ID
ARG GROUP_ID

RUN addgroup --gid $GROUP_ID user
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user

# Install python
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
python3.10 \
python3.10-dev \
python3-pip \
git && \
python3.10-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
pip install --no-cache-dir --upgrade pip setuptools wheel

# Add local bin to PATH
ENV PATH="/home/user/.local/bin:${PATH}"
# Create a non-root user
ARG GROUP_ID
ARG USER_ID

# Add user to sudoers
RUN adduser user sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
RUN addgroup --gid $GROUP_ID group
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user

# Change user
USER user
WORKDIR /home/user

# Update pip
RUN pip install --upgrade pip

# Install PyTorch
RUN if [ "${TORCH_PRE_RELEASE}" = "1" ]; \
then pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu ; \
else pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu ; \
fi
ARG TORCH_VERSION="stable"

RUN if [ "${TORCH_VERSION}" = "stable" ]; then \
pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu ; \
elif [ "${TORCH_VERSION}" = "nighly" ]; then \
pip install --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu ; \
else \
pip install --no-cache-dir torch==${TORCH_VERSION} torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu ; \
fi
5 changes: 0 additions & 5 deletions tests/configs/_torch_compile_.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
backend:
torch_compile: true
torch_compile_config:
backend: "inductor"
fullgraph: false
dynamic: false
disable: false

0 comments on commit 4966a1a

Please sign in to comment.