Skip to content

Commit a4dbb2b

Browse files
committed
Add rfdiffusion3, rosettafold3 and protparadelle-1c
1 parent 0bba211 commit a4dbb2b

3 files changed

Lines changed: 148 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM condaforge/miniforge3:25.11.0-0 AS base
3+
4+
LABEL org.opencontainers.image.source https://github.com/Australian-Protein-Design-Initiative/containers
5+
6+
# Build arguments
7+
ARG DOWNLOAD_MODELS=true
8+
ARG GIT_REF=f4c9c14
9+
10+
# Set environment variables
11+
ENV DEBIAN_FRONTEND=noninteractive \
12+
PYTHONUNBUFFERED=1 \
13+
PYTHONDONTWRITEBYTECODE=1 \
14+
CUDA_HOME=/usr/local/cuda \
15+
PATH=/opt/conda/bin:$PATH \
16+
PROTPARDELLE_OUTPUT_DIR=/tmp \
17+
PROJECT_ROOT_DIR=/app/protpardelle-1c \
18+
PROTPARDELLE_MODEL_PARAMS=/app/protpardelle-1c/model_params
19+
20+
# Install system dependencies
21+
RUN apt-get update && apt-get install -y \
22+
build-essential \
23+
wget \
24+
curl \
25+
git \
26+
aria2 \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
# Install huggingface-hub for model downloads
30+
RUN --mount=type=cache,target=/root/.cache/pip \
31+
pip install "huggingface_hub[cli]"
32+
33+
# Install Foldseek
34+
RUN wget https://mmseqs.com/foldseek/foldseek-linux-gpu.tar.gz && \
35+
tar -xzf foldseek-linux-gpu.tar.gz && \
36+
mv foldseek/bin/foldseek /usr/bin/ && \
37+
rm -rf foldseek-linux-gpu.tar.gz foldseek
38+
39+
ENV FOLDSEEK_BIN=/usr/bin/foldseek
40+
41+
WORKDIR /app
42+
43+
# Clone the repository
44+
RUN git clone https://github.com/ProteinDesignLab/protpardelle-1c.git /app/protpardelle-1c && \
45+
cd /app/protpardelle-1c && \
46+
git checkout ${GIT_REF}
47+
48+
# Setup Python environment and install dependencies
49+
RUN --mount=type=cache,target=/root/.cache/pip \
50+
cd /app/protpardelle-1c && \
51+
pip install torch && \
52+
pip install -e .
53+
54+
# Download model weights (conditional)
55+
RUN --mount=type=cache,target=/models \
56+
if [ "$DOWNLOAD_MODELS" = "true" ]; then \
57+
cd /app/protpardelle-1c && \
58+
# Zenodo seems the be blocking aria2c, so we patch to use wget instead
59+
sed -i 's/aria2c \-x16 \-s16 \-o/wget -O/' download_model_params.sh && \
60+
echo "Downloading model weights..." && \
61+
bash download_model_params.sh && \
62+
mkdir -p /models && \
63+
ln -s /app/protpardelle-1c/model_params /models/protpardelle-1c && \
64+
chmod -R a+r /app/protpardelle-1c/model_params && \
65+
find /app/protpardelle-1c/model_params -type d -exec chmod a+x {} \;; \
66+
else \
67+
echo "Skipping model weights download - to use this container please pre-download models to the host and bind them as a volume at /app/protpardelle-1c/model_params"; \
68+
fi
69+
70+
# Create wrapper scripts
71+
RUN printf '#!/bin/sh\nexec python -m protpardelle.sample "$@"\n' > /usr/local/bin/protpardelle-sample && \
72+
printf '#!/bin/sh\nexec python -m protpardelle.train "$@"\n' > /usr/local/bin/protpardelle-train && \
73+
printf '#!/bin/sh\nexec python -m protpardelle.likelihood "$@"\n' > /usr/local/bin/protpardelle-likelihood && \
74+
chmod +x /usr/local/bin/protpardelle-*
75+
76+
# Create non-root user
77+
RUN useradd -m -u 1001 protpardelle && \
78+
mkdir -p /app && \
79+
chown -R protpardelle:protpardelle /app
80+
81+
# Switch back to non-root user for final execution
82+
USER protpardelle
83+
84+
CMD ["protpardelle-sample", "--help"]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.12
2+
3+
LABEL org.opencontainers.image.source https://github.com/Australian-Protein-Design-Initiative/containers
4+
5+
#ARG GIT_REPO=https://github.com/RosettaCommons/modelforge.git
6+
ARG GIT_REF=0.1.9
7+
8+
ARG DOWNLOAD_MODELS=true
9+
10+
ENV FOUNDRY_CHECKPOINT_DIRS=/models/foundry
11+
ENV DEBIAN_FRONTEND=noninteractive \
12+
PIP_NO_CACHE_DIR=1 \
13+
PYTHONUNBUFFERED=1 \
14+
PYTHONDONTWRITEBYTECODE=1
15+
16+
RUN mkdir -p /models/foundry
17+
18+
RUN pip install "rc-foundry[rfd3]==${GIT_REF}"
19+
20+
RUN if [ "$DOWNLOAD_MODELS" = "true" ]; then \
21+
foundry install rfd3 --checkpoint-dir ${FOUNDRY_CHECKPOINT_DIRS}; \
22+
chmod -R a+rx ${FOUNDRY_CHECKPOINT_DIRS}; \
23+
fi
24+
25+
RUN groupadd -g 1000 rfd3user && \
26+
useradd -m -u 1000 -g 1000 -s /bin/bash rfd3user
27+
28+
USER rfd3user
29+
30+
CMD ["rfd3", "--help"]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM python:3.12
2+
3+
LABEL org.opencontainers.image.source https://github.com/Australian-Protein-Design-Initiative/containers
4+
5+
#ARG GIT_REPO=https://github.com/RosettaCommons/modelforge.git
6+
ARG GIT_REF=0.1.9
7+
8+
ARG DOWNLOAD_MODELS=true
9+
10+
ENV FOUNDRY_CHECKPOINT_DIRS=/models/foundry
11+
ENV DEBIAN_FRONTEND=noninteractive \
12+
PIP_NO_CACHE_DIR=1 \
13+
PYTHONUNBUFFERED=1 \
14+
PYTHONDONTWRITEBYTECODE=1
15+
16+
RUN mkdir -p /models/foundry
17+
18+
RUN pip install "rc-foundry[rf3]==${GIT_REF}"
19+
20+
# RUN git clone https://github.com/RosettaCommons/modelforge.git /apps/rosettafold3 \
21+
# && cd /apps/rosettafold3 \
22+
# && pip install -e ".[rf3]"
23+
24+
RUN if [ "$DOWNLOAD_MODELS" = "true" ]; then \
25+
foundry install rf3 --checkpoint-dir ${FOUNDRY_CHECKPOINT_DIRS}; \
26+
chmod -R a+rx ${FOUNDRY_CHECKPOINT_DIRS}; \
27+
fi
28+
29+
RUN groupadd -g 1000 rf3user && \
30+
useradd -m -u 1000 -g 1000 -s /bin/bash rf3user
31+
32+
USER rf3user
33+
34+
CMD ["rfd3", "--help"]

0 commit comments

Comments
 (0)