Skip to content

add Dockerfile for cpu #2515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
53 changes: 53 additions & 0 deletions Dockerfile.cpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ubuntu:24.10

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /workspace

RUN apt-get update && \
apt-get install -y git curl wget build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev llvm libncursesw5-dev \
xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev


RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv

ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"

RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \
echo 'export PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc && \
echo 'eval "$(pyenv init -)"' >> ~/.bashrc

RUN ~/.pyenv/bin/pyenv install 3.10.13 && \
~/.pyenv/bin/pyenv global 3.10.13

RUN python --version && \
pip --version


RUN apt-get install -y ffmpeg libsndfile1 libsm6 libxext6 libgl1 lsb-release numactl

WORKDIR /workspace/ao
COPY dev-requirements.txt /workspace/ao/dev-requirements.txt
COPY . .

ARG GIT_REPO_CHECK=0
RUN --mount=type=bind,source=.git,target=.git \
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi

ENV PIP_NO_BUILD_ISOLATION=0
ENV USE_CPU_KERNELS=1

# Use python3 now that it's set to python3.10 and has pip
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=.git,target=.git \
python3 -m pip install torch torchvision torchaudio pytorch-triton-xpu --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall --no-cache-dir && \
python3 setup.py install

RUN pip install pytest expecttest parameterized accelerate hf_transfer 'modelscope!=1.15.0'

SHELL ["bash", "-c"]

CMD ["bash"]