Skip to content

singularity/apptainer compatibility #139

@seanrjohnson

Description

@seanrjohnson

It would be great to be able to run protenix from a singularity/apptainer image. I tried the one below, but it didn't work. It seems to be trying to write cache database files to a directory that isn't writable in the apptainer file system. Maybe it would be possible to make the cache directory specifiable on the command line?

protenix.def

Bootstrap: docker
From: condaforge/miniforge3:24.9.2-0

%environment
export PATH="/opt/conda/bin:$PATH"

%post

conda install -c pytorch -c nvidia -c conda-forge  compilers python=3.11 pytorch pytorch-cuda=12.4 cuda-nvcc
pip install protenix -U

 apptainer build protenix.sif protenix.def
apptainer exec --nv protenix.sif protenix predict --input protenix_config.json --out_dir protenix_prediction

output:

Try to find the ccd cache data in the code directory for inference.
[2025-06-02 16:55:49,344] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cuda (auto detect)
2025-06-02 16:55:52,518 [/opt/conda/lib/python3.11/site-packages/runner/batch_inference.py:255] INFO runner.batch_inference: run infer with input=protenix_config2.json, out_dir=protenix_2_oligo_2_prots, cycle=10, step=200, sample=5, use_msa_server=False
2025-06-02 16:55:52,519 [/opt/conda/lib/python3.11/site-packages/runner/batch_inference.py:212] INFO runner.batch_inference: will infer with 1 jsons
Traceback (most recent call last):
  File "/opt/conda/bin/protenix", line 8, in <module>
    sys.exit(protenix_cli())
             ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/runner/batch_inference.py", line 259, in predict
    inference_jsons(
  File "/opt/conda/lib/python3.11/site-packages/runner/batch_inference.py", line 219, in inference_jsons
    runner = get_default_runner(seeds, n_cycle, n_step, n_sample)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/runner/batch_inference.py", line 181, in get_default_runner
    download_infercence_cache(configs, model_version="v0.5.0")
  File "/opt/conda/lib/python3.11/site-packages/runner/inference.py", line 170, in download_infercence_cache
    os.makedirs(os.path.dirname(cur_cache_fpath), exist_ok=True)
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 225, in makedirs
OSError: [Errno 30] Read-only file system: '/opt/conda/lib/python3.11/site-packages/release_data'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions