-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
49 lines (42 loc) · 2.27 KB
/
Copy pathDockerfile.gpu
File metadata and controls
49 lines (42 loc) · 2.27 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
49
# syntax=docker/dockerfile:1
#
# GPU image for REAL ColabFold inference. The default `Dockerfile` stays slim +
# GPU-free for dev/CI; this one is used on a rented GPU box. See docs/GPU-DEPLOY.md.
#
# Build (on the GPU box, with the proto submodule populated):
# docker build -f Dockerfile.gpu -t foldforge/af2:gpu .
# Run (NVIDIA Container Toolkit required on the host):
# docker run --gpus all -e FOLDFORGE_SIDECAR_MOCK=0 -p 50064:50064 foldforge/af2:gpu
#
# NOTE: the proto/ submodule must be populated before build (the slim image's
# gen_proto.sh needs the .proto files). If `proto/` is empty, run:
# git submodule update --init --recursive
# or copy a sibling checkout in (same content-pinned commit), as in the Rust repos.
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3-pip python3.11-venv git curl wget ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/bin/python3.11 /usr/bin/python
# --- LocalColabFold: puts colabfold_batch / colabfold_search on PATH ----------
# This is the ONLY real GPU dependency; ColabFold is intentionally NOT a pip dep.
# Pin the installer to a release rather than main once it's confirmed working
# (same reproducibility lesson as pinning toolchain versions elsewhere).
RUN wget -qO /tmp/install_colabbatch_linux.sh \
https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_linux.sh && \
bash /tmp/install_colabbatch_linux.sh && \
rm /tmp/install_colabbatch_linux.sh
ENV PATH="/localcolabfold/colabfold-conda/bin:${PATH}"
WORKDIR /app
# Python deps: the gRPC layer + model parsing + storage backend. grpcio-tools is
# needed by gen_proto.sh (it uses `python -m grpc_tools.protoc`, NOT system protoc).
COPY pyproject.toml .
RUN pip install --no-cache-dir grpcio grpcio-tools protobuf pydantic structlog && \
pip install --no-cache-dir -e ".[model,storage]"
COPY . .
RUN ./scripts/gen_proto.sh
EXPOSE 50064
# Real model is selected at RUN time via FOLDFORGE_SIDECAR_MOCK=0 (default in the
# image is unset = mock, so a misconfigured run fails safe to mock rather than
# erroring; set =0 explicitly to fold for real).
ENTRYPOINT ["python", "-m", "foldforge_af2.server"]