Image size: 3.3 GB

For more on pulling from the registry, see the ilifu documentation.

First, once: add the registry and make it your default

singularity remote add --no-login idia-registry https://sregistry.idia.ac.za
singularity remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

singularity remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

singularity pull library://bioinformatics/alphafold:2.3.2-c77e5d2

Shell into the container

singularity shell library://bioinformatics/alphafold:2.3.2-c77e5d2

Run the container

singularity run library://bioinformatics/alphafold:2.3.2-c77e5d2

First, once: add the registry and make it your default

apptainer remote add --no-login idia-registry https://sregistry.idia.ac.za
apptainer remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

apptainer remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

apptainer pull library://bioinformatics/alphafold:2.3.2-c77e5d2

Shell into the container

apptainer shell library://bioinformatics/alphafold:2.3.2-c77e5d2

Run the container

apptainer run library://bioinformatics/alphafold:2.3.2-c77e5d2
AlphaFold 2 protein structure prediction, built from DeepMind's source at commit c77e5d2
(2026-04-22). v2.3.2 is the last tagged release; this commit adds three years of fixes on
top of it, including the move to CUDA 12 and Python 3.11.

Needs an NVIDIA GPU (run with --nv) and the genetic databases (~2.6 TB), which aren't in
the image.

Usage:
  singularity run --nv alphafold_2.3.2-c77e5d2.sif \
    --fasta_paths=protein.fasta --max_template_date=2023-01-01 \
    --model_preset=monomer --data_dir=/path/to/databases --output_dir=./output \
    --uniref90_database_path=... (see run_alphafold.py --helpfull for the database flags)

Documentation: https://github.com/google-deepmind/alphafold
Bootstrap: docker
From: nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu20.04

%labels
  Maintainer IDIA <support@ilifu.ac.za>
  Version 2.3.2-c77e5d2
  Commit c77e5d2a8961d1a353632c462914ff0a32a950f6
  CUDA_Version 12.2.2
  Source https://github.com/google-deepmind/alphafold

%help
  AlphaFold 2 protein structure prediction, built from DeepMind's source at commit c77e5d2
  (2026-04-22). v2.3.2 is the last tagged release; this commit adds three years of fixes on
  top of it, including the move to CUDA 12 and Python 3.11.

  Needs an NVIDIA GPU (run with --nv) and the genetic databases (~2.6 TB), which aren't in
  the image.

  Usage:
    singularity run --nv alphafold_2.3.2-c77e5d2.sif \
      --fasta_paths=protein.fasta --max_template_date=2023-01-01 \
      --model_preset=monomer --data_dir=/path/to/databases --output_dir=./output \
      --uniref90_database_path=... (see run_alphafold.py --helpfull for the database flags)

  Documentation: https://github.com/google-deepmind/alphafold

%environment
  export PATH=/opt/conda/bin:/opt/hhsuite/bin:/app/alphafold:${PATH}
  export LD_LIBRARY_PATH=/opt/conda/lib:${LD_LIBRARY_PATH}
  export TF_FORCE_UNIFIED_MEMORY=1
  export XLA_PYTHON_CLIENT_MEM_FRACTION=4.0

%post
  # Follows docker/Dockerfile at this commit, except as noted.
  ALPHAFOLD_COMMIT=c77e5d2a8961d1a353632c462914ff0a32a950f6
  MINICONDA_INSTALLER=Miniconda3-py311_26.9.4-0-Linux-x86_64.sh
  export DEBIAN_FRONTEND=noninteractive

  apt-get update --quiet
  apt-get install --no-install-recommends --yes --quiet \
    build-essential \
    ca-certificates \
    cmake \
    cuda-command-line-tools-12-2 \
    git \
    hmmer \
    kalign \
    tzdata \
    wget
  rm -rf /var/lib/apt/lists/*
  apt-get autoremove --yes
  apt-get clean

  git clone --branch v3.3.0 --single-branch https://github.com/soedinglab/hh-suite.git /tmp/hh-suite
  mkdir /tmp/hh-suite/build
  cd /tmp/hh-suite/build || exit 1
  cmake -DCMAKE_INSTALL_PREFIX=/opt/hhsuite ..
  make -j"$(nproc)"
  make install
  ln -s /opt/hhsuite/bin/* /usr/bin
  cd / || exit 1
  rm -rf /tmp/hh-suite

  # Cloned before conda is on the PATH: conda's libffi breaks git-remote-https.
  git clone https://github.com/google-deepmind/alphafold.git /app/alphafold
  git -C /app/alphafold checkout "${ALPHAFOLD_COMMIT}"
  rm -rf /app/alphafold/.git

  # NOTE: upstream fetches this from OpenStructure's GitLab (git.scicore.unibas.ch), which
  #   answers scripted downloads with 403. Uni-Fold vendors the same file; its copy is
  #   byte-identical to gget's and PaddleHelix's, and the checksum pins it.
  wget -q -P /app/alphafold/alphafold/common/ \
    https://raw.githubusercontent.com/dptech-corp/Uni-Fold/2c48ac2a4cdbd93d392938dc9f8c784f65c2bd52/unifold/data/stereo_chemical_props.txt
  echo "24510899eeb49167cffedec8fa45363a4d08279c0c637a403b452f7d0ac09451  /app/alphafold/alphafold/common/stereo_chemical_props.txt" \
    | sha256sum -c -

  # NOTE: a pinned installer rather than upstream's Miniconda3-latest, so a rebuild gets the
  #   same conda. It pins conda and brings Python 3.11 and pip, which is what upstream's
  #   `conda install conda==24.11.1 pip python=3.11` is for; that downgrade conflicts with
  #   this installer's packages, so it's left out.
  wget -q -P /tmp "https://repo.anaconda.com/miniconda/${MINICONDA_INSTALLER}"
  bash "/tmp/${MINICONDA_INSTALLER}" -b -p /opt/conda
  rm "/tmp/${MINICONDA_INSTALLER}"

  export PATH=/opt/conda/bin:${PATH}
  export LD_LIBRARY_PATH=/opt/conda/lib:${LD_LIBRARY_PATH}
  export CONDA_PLUGINS_AUTO_ACCEPT_TOS=yes
  # NOTE: upstream also installs CUDA from the nvidia conda channel. The base image already
  #   has the CUDA 12.2 runtime and cuDNN 8.9 that jaxlib below is built for, and skipping it
  #   saves several GB, which matters on the CI runner's disk.
  python --version | grep -q 'Python 3\.11\.'
  conda clean --all --force-pkgs-dirs --yes

  pip3 install --upgrade pip --no-cache-dir
  pip3 install -r /app/alphafold/requirements.txt --no-cache-dir
  pip3 install --upgrade --no-cache-dir \
    jax==0.4.26 \
    jaxlib==0.4.26+cuda12.cudnn89 \
    -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

  # Workaround for an undefined_symbol error from conda's libffi.
  ln -sf /usr/lib/x86_64-linux-gnu/libffi.so.7 /opt/conda/lib/libffi.so.7

  # NOTE: upstream's entrypoint runs ldconfig first, with ldconfig made setuid, so Docker
  #   finds the host's GPU libraries. Neither works in a read-only SIF run as the user, and
  #   isn't needed: --nv binds the host's driver libraries in and puts them on the path.

%runscript
  exec python /app/alphafold/run_alphafold.py "$@"

%test
  python -c "import sys; print(f'Python {sys.version}')"
  python -c "import jax; print(f'JAX {jax.__version__}')"
  python -c "import openmm, pdbfixer, haiku, tensorflow; print('imports OK')"
  # Imports the whole pipeline without running it (absl's --help exits non-zero).
  PYTHONPATH=/app/alphafold python -c "import run_alphafold"
  command -v hhblits hhsearch jackhmmer kalign
Download bioinformatics-alphafold_2.3.2-c77e5d2.def
#!/bin/sh

  exec python /app/alphafold/run_alphafold.py "$@"
#!/bin/sh

  python -c "import sys; print(f'Python {sys.version}')"
  python -c "import jax; print(f'JAX {jax.__version__}')"
  python -c "import openmm, pdbfixer, haiku, tensorflow; print('imports OK')"
  # Imports the whole pipeline without running it (absl's --help exits non-zero).
  PYTHONPATH=/app/alphafold python -c "import run_alphafold"
  command -v hhblits hhsearch jackhmmer kalign
# /.singularity.d/env/10-docker2singularity.sh
#!/bin/sh
export PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export NVARCH="${NVARCH:-"x86_64"}"
export NVIDIA_REQUIRE_CUDA="${NVIDIA_REQUIRE_CUDA:-"cuda>=12.2 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526"}"
export NV_CUDA_CUDART_VERSION="${NV_CUDA_CUDART_VERSION:-"12.2.140-1"}"
export NV_CUDA_COMPAT_PACKAGE="${NV_CUDA_COMPAT_PACKAGE:-"cuda-compat-12-2"}"
export CUDA_VERSION="${CUDA_VERSION:-"12.2.2"}"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-"/usr/local/nvidia/lib:/usr/local/nvidia/lib64"}"
export NVIDIA_VISIBLE_DEVICES="${NVIDIA_VISIBLE_DEVICES:-"all"}"
export NVIDIA_DRIVER_CAPABILITIES="${NVIDIA_DRIVER_CAPABILITIES:-"compute,utility"}"
export NV_CUDA_LIB_VERSION="${NV_CUDA_LIB_VERSION:-"12.2.2-1"}"
export NV_NVTX_VERSION="${NV_NVTX_VERSION:-"12.2.140-1"}"
export NV_LIBNPP_VERSION="${NV_LIBNPP_VERSION:-"12.2.1.4-1"}"
export NV_LIBNPP_PACKAGE="${NV_LIBNPP_PACKAGE:-"libnpp-12-2=12.2.1.4-1"}"
export NV_LIBCUSPARSE_VERSION="${NV_LIBCUSPARSE_VERSION:-"12.1.2.141-1"}"
export NV_LIBCUBLAS_PACKAGE_NAME="${NV_LIBCUBLAS_PACKAGE_NAME:-"libcublas-12-2"}"
export NV_LIBCUBLAS_VERSION="${NV_LIBCUBLAS_VERSION:-"12.2.5.6-1"}"
export NV_LIBCUBLAS_PACKAGE="${NV_LIBCUBLAS_PACKAGE:-"libcublas-12-2=12.2.5.6-1"}"
export NV_LIBNCCL_PACKAGE_NAME="${NV_LIBNCCL_PACKAGE_NAME:-"libnccl2"}"
export NV_LIBNCCL_PACKAGE_VERSION="${NV_LIBNCCL_PACKAGE_VERSION:-"2.19.3-1"}"
export NCCL_VERSION="${NCCL_VERSION:-"2.19.3-1"}"
export NV_LIBNCCL_PACKAGE="${NV_LIBNCCL_PACKAGE:-"libnccl2=2.19.3-1+cuda12.2"}"
export NVIDIA_PRODUCT_NAME="${NVIDIA_PRODUCT_NAME:-"CUDA"}"
export NV_CUDNN_VERSION="${NV_CUDNN_VERSION:-"8.9.6.50"}"
export NV_CUDNN_PACKAGE_NAME="${NV_CUDNN_PACKAGE_NAME:-"libcudnn8"}"
export NV_CUDNN_PACKAGE="${NV_CUDNN_PACKAGE:-"libcudnn8=8.9.6.50-1+cuda12.2"}"
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow


  export PATH=/opt/conda/bin:/opt/hhsuite/bin:/app/alphafold:${PATH}
  export LD_LIBRARY_PATH=/opt/conda/lib:${LD_LIBRARY_PATH}
  export TF_FORCE_UNIFIED_MEMORY=1
  export XLA_PYTHON_CLIENT_MEM_FRACTION=4.0