Skip to content

[AlphaFold] [package list]

AlphaFold/69afc4d-rocm-5.5.1-python-3.9-singularity-20231108 (AlphaFold-69afc4d-rocm-5.5.1-python-3.9-singularity-20231108.eb)

Install with the EasyBuild-user module in partition/container:

module load LUMI partition/container EasyBuild-user
eb AlphaFold-69afc4d-rocm-5.5.1-python-3.9-singularity-20231108.eb
The module will be available in all versions of the LUMI stack and in the CrayEnv stack.

To access module help after installation use module spider AlphaFold/69afc4d-rocm-5.5.1-python-3.9-singularity-20231108.

EasyConfig:

easyblock = 'MakeCp'

name =          'AlphaFold'
version =       '69afc4d'
versionsuffix = '-rocm-5.5.1-python-3.9-singularity-20231108'

local_sif =    'lumi-alphafold-rocm-5.5.3-python-3.9-alphafold-69afc4d-dockerhash-b52a3dc67cad.sif'
local_docker = 'lumi-alphafold-rocm-5.5.3-python-3.9-alphafold-69afc4d.docker'

homepage = 'https://github.com/google-deepmind/alphafold'

whatis = [
    'Description: AlphaFold can predict protein structures with atomic accuracy even where no similar structure is known.'
]

description = """
This module provides a container with AlphaFold github commit %(version)s. 

The module defines a number of environment variables:
*   SIF and SIFALPHAFOLD: The full path and name of the Singularity SIF file 
    to use with singularity exec etc.
*   SINGULAIRTY_BINDPATH: Mounts the necessary directories from the system,
    including /users, /project, /scratch and /flash so that you should be
    able to use your regular directories in the container.
*   RUNSCRIPTS and RUNSCRIPTSALPHAFOLD: The directory with some sample
    runscripts.

Note that this container uses a Conda environment internally. When in
the container, the command to activate the container is contained in the
environment variable WITH_CONDA.

The container includes AlphaFold and its dependencies, including TensorFlow 
2.11.1.550, JAX, aria2 and OpenMM with HIP support.
"""

toolchain = SYSTEM

sources = [
    {
        'filename':    local_sif,
        'extract_cmd': '/bin/cp %s .'
    },
    {
        'filename':    local_docker,
        'extract_cmd': '/bin/cp %s .'
    },
]

skipsteps = ['build']

files_to_copy = [
    ([local_sif],    '.'),
    ([local_docker], 'share/docker-defs/')    
]

local_runscript_python_simple="""
#!/bin/bash -e

# Start conda environment inside the container
\$WITH_CONDA

# Run application
python "\$@"

"""

postinstallcmds = [
    'mkdir -p %(installdir)s/runscripts',
    f'cat >%(installdir)s/runscripts/python-conda-simple <<EOF {local_runscript_python_simple}EOF',
    'chmod a+x %(installdir)s/runscripts/python-conda-simple'
]

sanity_check_paths = {
    # We deliberately don't check for local_sif as the user is allowed to remove that file
    # but may still want to regenerate the module which would then fail in the sanity check.
    'files': [f'share/docker-defs/{local_docker}'],
    'dirs':  [],
}

modextravars = {
    # SIF variables currently set by a function via modluafooter.
    #'SIF':                '%(installdir)s/' + local_sif,
    #'SIFALPHAFOLD':       '%(installdir)s/' + local_sif,
    'RUNSCRIPTS':          '%(installdir)s/runscripts',
    'RUNSCRIPTSALPHAFOLD': '%(installdir)s/runscripts',
    'SINGULARITY_BIND':    '/var/spool/slurmd,/opt/cray,/usr/lib64/libcxi.so.1,/usr/lib64/libjansson.so.4,' +
                           '%(installdir)s/runscripts:/runscripts,' + 
                           '/pfs,/scratch,/projappl,/project,/flash,/appl'
}

modluafooter = f"""
-- Call a routine to set the various environment variables.
create_container_vars( '{local_sif}', 'AlphaFold', '%(installdir)s' )
"""

moduleclass = 'devel'

[AlphaFold] [package list]