-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (40 loc) · 1.52 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (40 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Reproduce the measurement environment elsewhere.
#
# docker build -t commprof .
# docker run --gpus all -it commprof commprof check
#
# The base image matches the CUDA version of the wheel index below. That pairing is
# the point of this file: a mismatch between the CUDA runtime and the kernels in the
# PyTorch build is the failure this whole project gates on at startup.
FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
COMMPROF_NO_PROGRESS=1
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
git \
make \
latexmk \
texlive-latex-recommended \
texlive-latex-extra \
texlive-science \
texlive-fonts-recommended \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Dependencies first, so a source change does not re-download three gigabytes of wheels.
COPY requirements.txt requirements-dev.txt ./
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --upgrade pip \
&& pip install -r requirements-dev.txt
COPY . .
RUN pip install -e . --no-deps
# Fails the build if the image cannot see a GPU at runtime, which is the intended
# way to find out that --gpus all was forgotten.
HEALTHCHECK --interval=1m --timeout=30s --retries=1 \
CMD python -c "import torch; raise SystemExit(0 if torch.cuda.is_available() else 1)"
CMD ["commprof", "check"]