Skip to content

Commit f267e39

Browse files
authored
Merge pull request #61 from seqeralabs/fix/boltz2_refolding
Fixing boltz2 docker image and command.
2 parents 926029b + feb1969 commit f267e39

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

assets/boltz2.Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 1. Use the Runtime image (Approx. 4GB vs 9GB for devel)
2+
# This includes PyTorch 2.3 + CUDA 12.1 drivers but NO compiler (nvcc).
3+
FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
4+
5+
# Set flags to keep things clean and non-interactive
6+
ENV DEBIAN_FRONTEND=noninteractive \
7+
PYTHONUNBUFFERED=1 \
8+
PIP_NO_CACHE_DIR=1
9+
10+
# 2. Install minimal system tools
11+
# We need git for the install, wget for mmseqs2, and build-essential/cmake
12+
# temporarily in case 'dm-tree' or other deps need to compile C++ extensions.
13+
RUN apt-get update && apt-get install -y --no-install-recommends \
14+
git \
15+
wget \
16+
tar \
17+
build-essential \
18+
cmake \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# 3. Install Python Dependencies
22+
# We manually install PyG dependencies from wheels to avoid needing the full CUDA compiler.
23+
# Note: The URL matches the PyTorch (2.3.0) and CUDA (12.1) versions of the base image.
24+
RUN pip install --upgrade pip && \
25+
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv \
26+
-f https://data.pyg.org/whl/torch-2.3.0+cu121.html
27+
28+
# 4. Install Boltz
29+
# We install 'rdkit' specifically to ensure the pip-optimized version is used.
30+
RUN pip install "rdkit>=2022.9.5" && \
31+
pip install "boltz[cuda]"
32+
33+
# 5. Cleanup to save space
34+
# Remove build tools that are no longer needed for running the model.
35+
RUN apt-get purge -y build-essential cmake && \
36+
apt-get autoremove -y && \
37+
rm -rf /var/lib/apt/lists/*
38+
39+
# Setup working directory
40+
WORKDIR /app

conf/test_design_protein.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ params {
3434
run_boltz2_refold = true
3535
run_ipsae = true
3636
run_prodigy = true
37-
run_foldseek = true
37+
run_foldseek = false
3838
run_consolidation = true
3939

4040
// Output

modules/local/boltz2_refold.nf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ process BOLTZ2_REFOLD {
2121
publishDir "${params.outdir}/${meta.parent_id}/boltz2", mode: params.publish_dir_mode
2222

2323
// Build Boltz-2 container using Wave with conda
24-
conda "boltz::boltz=1.0.0"
24+
container 'boltz2:latest'
2525

2626
// GPU acceleration - Boltz-2 benefits from GPU for efficient prediction
2727
accelerator 1, type: 'nvidia-gpu'
@@ -45,6 +45,13 @@ process BOLTZ2_REFOLD {
4545
#!/bin/bash
4646
set -euo pipefail
4747
48+
# Fix for Numba caching error in containers
49+
export NUMBA_CACHE_DIR="\${PWD}/numba_cache"
50+
mkdir -p "\${NUMBA_CACHE_DIR}"
51+
52+
# Fix for Boltz caching error (tries to write to /.boltz)
53+
export HOME="\${PWD}"
54+
4855
echo "============================================"
4956
echo "Boltz-2 Multimer Structure Prediction"
5057
echo "============================================"
@@ -72,7 +79,7 @@ process BOLTZ2_REFOLD {
7279
echo ""
7380
echo "Processing ProteinMPNN sequences..."
7481
75-
python3 <<'PARSE_FASTA'
82+
python3 <<PARSE_FASTA
7683
import sys
7784
import yaml
7885
import os
@@ -81,7 +88,7 @@ import os
8188
fasta_input = "${mpnn_sequences}"
8289
fasta_files = fasta_input.split() if " " in fasta_input else [fasta_input]
8390
84-
target_seq = "\${TARGET_SEQ}"
91+
target_seq = "\$TARGET_SEQ"
8592
output_base = "${meta.id}"
8693
parent_id = "${meta.parent_id}"
8794

0 commit comments

Comments
 (0)