Skip to content

Commit f21f0fb

Browse files
committed
docs: update README and Dockerfiles to include pytest as a build dependency
1 parent 82647fa commit f21f0fb

3 files changed

Lines changed: 81 additions & 8 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ package in this repository; CMake builds and installs the native library
178178
separately.
179179

180180
The build environment must provide CMake, Ninja, a CUDA toolkit, SQLite3,
181-
Python 3.10+ development files, PyTorch, and pybind11. Runtime JIT generation
182-
and Python tests additionally require a preconfigured Triton/TLE-enabled
183-
Python environment and `pytest`. Install the codegen package into the Python
184-
environment that will execute JIT generation:
181+
Python 3.10+ development files, PyTorch, pybind11, and `pytest`. Runtime JIT
182+
generation and Python tests additionally require a preconfigured
183+
Triton/TLE-enabled Python environment. Install the codegen package into the
184+
Python environment that will execute JIT generation:
185185

186186
```sh
187187
python3 -m pip install .
@@ -196,8 +196,8 @@ cmake --install build --prefix /path/to/flagfft-install
196196

197197
`docker/Dockerfile` builds a base Ubuntu 24.04 environment with Python 3.12,
198198
PyTorch CUDA wheels, CUDA toolkit 13.2, FlagTree, CMake, Ninja, pybind11, and
199-
other native build dependencies. The image only contains the environment; it
200-
does not compile this repository during `docker build`.
199+
`pytest`, plus other native build dependencies. The image only contains the
200+
environment; it does not compile this repository during `docker build`.
201201

202202
```sh
203203
docker build -f docker/Dockerfile -t flagfft-ubuntu2404:latest .

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ RUN pip uninstall -y triton || true && \
6262
RES="--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple" && \
6363
pip install --no-warn-conflicts flagtree===0.5.0 ${RES}
6464

65-
# flagFFT build dependencies
66-
RUN pip install --no-warn-conflicts nanobind ninja cmake pybind11 && \
65+
# flagFFT build and test dependencies
66+
RUN pip install --no-warn-conflicts nanobind ninja cmake pybind11 pytest && \
6767
pip install --no-warn-conflicts -U pip "setuptools<82" wheel scikit-build-core
6868

6969
WORKDIR /workspace

docker/Dockerfile.ci

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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

Comments
 (0)