Skip to content
Merged
12 changes: 10 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ jobs:
contents: read

steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
with:
tool-cache: false
android: true
Comment thread
Abdelsalam-Abbas marked this conversation as resolved.
dotnet: true
haskell: true
large-packages: true
swap-storage: true

- name: Checkout code
uses: actions/checkout@v6

Expand Down Expand Up @@ -57,8 +67,6 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false

- name: Image digest
Expand Down
25 changes: 11 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,20 @@ COPY run_grid_search.py ./
COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

# ============================================================================
# Bake in model checkpoints from pre-built base image on Docker Hub
# ============================================================================
# Checkpoints (~10 GB) rarely change, so this layer is placed before pixi
# installs to stay cached even when dependencies update.
COPY --from=diffuseproject/sampleworks-checkpoints:latest /checkpoints/ /checkpoints/

# ============================================================================
# Install all three environments: boltz, protenix, rf3
# ============================================================================
RUN pixi install -e boltz --frozen && \
pixi install -e protenix --frozen && \
pixi install -e rf3 --frozen
# Split into separate layers so changing one env doesn't invalidate the others
RUN pixi install -e boltz --frozen
RUN pixi install -e protenix --frozen
RUN pixi install -e rf3 --frozen

# ============================================================================
# Pre-compile CUDA extensions to avoid JIT compilation at runtime
Expand All @@ -118,17 +126,6 @@ RUN pixi run -e boltz python -c "\
from sampleworks.core.forward_models.xray.real_space_density_deps.ops import dilate_atom_centric; \
print('CUDA extensions compiled successfully')" || echo "CUDA extension pre-compilation skipped (no GPU during build)"

# ============================================================================
# Bake in model checkpoints from pre-built base image on Docker Hub
# ============================================================================
# All checkpoints (Boltz1, Boltz2, CCD, mols, RF3, Protenix) are pre-built
# into diffuseproject/sampleworks-checkpoints:latest on Docker Hub.
# This avoids downloading ~6GB from HuggingFace during build and removes the
# need to have RF3/Protenix checkpoints in the build context.
# Rebuild with: docker build -t diffuseproject/sampleworks-checkpoints:latest
# docker push diffuseproject/sampleworks-checkpoints:latest
COPY --from=diffuseproject/sampleworks-checkpoints:latest /checkpoints/ /checkpoints/

# Set default checkpoint paths via environment variables
ENV BOLTZ1_CHECKPOINT=/checkpoints/boltz1_conf.ckpt \
BOLTZ2_CHECKPOINT=/checkpoints/boltz2_conf.ckpt \
Expand Down