diff --git a/Dockerfile.cpu b/Dockerfile.cpu new file mode 100644 index 0000000000..1692ae2ca4 --- /dev/null +++ b/Dockerfile.cpu @@ -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"]