|
| 1 | +FROM ubuntu:24.04 |
| 2 | + |
| 3 | +ARG DEBIAN_FRONTEND=noninteractive |
| 4 | +ARG GIT_URL_REWRITE_FROM=https://github.com/ |
| 5 | +ARG GIT_URL_REWRITE_TO= |
| 6 | + |
| 7 | +SHELL ["/bin/bash", "-lc"] |
| 8 | + |
| 9 | +ENV PYENV_ROOT=/root/.pyenv |
| 10 | +ENV PATH=${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:/usr/local/cuda/bin:${PATH} |
| 11 | +ENV CUDA_HOME=/usr/local/cuda |
| 12 | +ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH} |
| 13 | +ENV PIP_ROOT_USER_ACTION=ignore |
| 14 | + |
| 15 | + |
| 16 | +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends tzdata && apt-get install -y openssh-server && mkdir -p /run/sshd |
| 17 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 18 | + git \ |
| 19 | + curl \ |
| 20 | + wget \ |
| 21 | + ca-certificates \ |
| 22 | + make \ |
| 23 | + build-essential \ |
| 24 | + libssl-dev \ |
| 25 | + zlib1g-dev \ |
| 26 | + libbz2-dev \ |
| 27 | + libreadline-dev \ |
| 28 | + libsqlite3-dev \ |
| 29 | + libncursesw5-dev \ |
| 30 | + xz-utils \ |
| 31 | + tk-dev \ |
| 32 | + libxml2-dev \ |
| 33 | + libxmlsec1-dev \ |
| 34 | + libffi-dev \ |
| 35 | + liblzma-dev \ |
| 36 | + && rm -rf /var/lib/apt/lists/* |
| 37 | + |
| 38 | +RUN if [ -n "${GIT_URL_REWRITE_TO}" ]; then \ |
| 39 | + git config --global url."${GIT_URL_REWRITE_TO}".insteadOf "${GIT_URL_REWRITE_FROM}"; \ |
| 40 | + fi |
| 41 | + |
| 42 | +# pyenv |
| 43 | +RUN curl -fsSL https://pyenv.run | bash |
| 44 | + |
| 45 | +RUN pyenv install 3.12 && \ |
| 46 | + pyenv global 3.12 && \ |
| 47 | + python --version && \ |
| 48 | + pip --version |
| 49 | + |
| 50 | +# torch |
| 51 | +RUN pip3 install --no-warn-conflicts torch torchvision --index-url https://download.pytorch.org/whl/cu132 |
| 52 | + |
| 53 | +# cuda |
| 54 | +RUN wget https://developer.download.nvidia.com/compute/cuda/13.2.1/local_installers/cuda-repo-debian13-13-2-local_13.2.1-595.58.03-1_amd64.deb && \ |
| 55 | + dpkg -i cuda-repo-debian13-13-2-local_13.2.1-595.58.03-1_amd64.deb && \ |
| 56 | + cp /var/cuda-repo-debian13-13-2-local/cuda-*-keyring.gpg /usr/share/keyrings/ && \ |
| 57 | + apt-get update && \ |
| 58 | + apt-get -y install cuda-toolkit-13-2 && \ |
| 59 | + rm -f cuda-repo-debian13-13-2-local_13.2.1-595.58.03-1_amd64.deb && \ |
| 60 | + rm -rf /var/lib/apt/lists/* |
| 61 | + |
| 62 | +# flagtree |
| 63 | +RUN pip uninstall -y triton || true && \ |
| 64 | + RES="--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple" && \ |
| 65 | + pip install --no-warn-conflicts flagtree===0.5.0 ${RES} |
| 66 | + |
| 67 | +# flagFFT build and test dependencies |
| 68 | +RUN pip install --no-warn-conflicts nanobind ninja cmake pybind11 pytest && \ |
| 69 | + pip install --no-warn-conflicts -U pip "setuptools<82" wheel scikit-build-core |
| 70 | + |
| 71 | +WORKDIR /workspace |
| 72 | + |
| 73 | +CMD ["/bin/bash"] |
0 commit comments