Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"/app/alphafold/docker/openmm.patch: No such file or directory" or "can't open file '/app/alphafold/run_alphafold.py': [Errno 2] No such file or directory" #371

Closed
MaKangYao opened this issue Feb 16, 2022 · 3 comments
Labels
docker An issue with Docker setup Issue setting up AlphaFold

Comments

@MaKangYao
Copy link

when i build docker image in the docker folder "docker build -t alphafold ."
and then
report error
Step 14/18 : RUN patch -p0 < /app/alphafold/docker/openmm.patch
---> Running in f507715f75d9
/bin/bash: /app/alphafold/docker/openmm.patch: No such file or directory
The command '/bin/bash -c patch -p0 < /app/alphafold/docker/openmm.patch' returned a non-zero code: 1

then i modify the dockerfile
#73 RUN patch -p0 < /app/alphafold/openmm.patch

then the docker image successful build
Step 14/18 : RUN patch -p0 < /app/alphafold/openmm.patch
---> Running in e17ea0d47b4d
patching file simtk/openmm/app/topology.py
Hunk #1 succeeded at 353 (offset -3 lines).
Removing intermediate container e17ea0d47b4d
---> ce77a4895544
Step 15/18 : RUN chmod u+s /sbin/ldconfig.real
---> Running in 71924dd71397
Removing intermediate container 71924dd71397
---> e1c43b3cc4fc
Step 16/18 : WORKDIR /app/alphafold
---> Running in 0d81f85886dc
Removing intermediate container 0d81f85886dc
---> 4c16bc524dd8
Step 17/18 : RUN echo $'#!/bin/bash\nldconfig\npython /app/alphafold/run_alphafold.py "$@"' > /app/run_alphafold.sh && chmod +x /app/run_alphafold.sh
---> Running in dce02456db5b
Removing intermediate container dce02456db5b
---> 4ce1b8b476b5
Step 18/18 : ENTRYPOINT ["/app/run_alphafold.sh"]
---> Running in ca2af0632d71
Removing intermediate container ca2af0632d71
---> ca5a3d381436
Successfully built ca5a3d381436
Successfully tagged alphafold:latest

but when i run the docker

❯ python3 docker/run_docker.py
--fasta_paths=s.fas
--max_template_date=2020-05-14
--data_dir=/home/mky/Data/alphafold_data/
I0216 09:40:52.541118 140714467206976 run_docker.py:107] Mounting /home/mky/Videos/alphafold-main -> /mnt/fasta_path_0
I0216 09:40:52.541209 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/uniref90 -> /mnt/uniref90_database_path
I0216 09:40:52.541244 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/mgnify -> /mnt/mgnify_database_path
I0216 09:40:52.541273 140714467206976 run_docker.py:107] Mounting /home/mky/Data -> /mnt/data_dir
I0216 09:40:52.541300 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/pdb_mmcif -> /mnt/template_mmcif_dir
I0216 09:40:52.541326 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/pdb_mmcif -> /mnt/obsolete_pdbs_path
I0216 09:40:52.541353 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/pdb70 -> /mnt/pdb70_database_path
I0216 09:40:52.541379 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/uniclust30/uniclust30_2018_08 -> /mnt/uniclust30_database_path
I0216 09:40:52.541405 140714467206976 run_docker.py:107] Mounting /home/mky/Data/alphafold_data/bfd -> /mnt/bfd_database_path
I0216 09:40:54.052704 140714467206976 run_docker.py:247] python: can't open file '/app/alphafold/run_alphafold.py': [Errno 2] No such file or directory

it report this error

I'm looking for a way to solve my problem
Want to know if you can give the official docker image
thank you very much!!!

@MaKangYao
Copy link
Author

and it give me warning in step 12
Step 12/18 : RUN pip3 install --upgrade pip && pip3 install -r /app/alphafold/requirements.txt && pip3 install --upgrade jax==0.2.14 jaxlib==0.1.69+cuda${CUDA/./} -f https://storage.googleapis.com/jax-releases/jax_releases.html
---> Running in c3a9bc845ac9
Requirement already satisfied: pip in /opt/conda/lib/python3.7/site-packages (22.0.3)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Collecting absl-py==0.13.0
Downloading absl_py-0.13.0-py3-none-any.whl (132 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.1/132.1 KB 10.4 kB/s eta 0:00:00
Collecting docker==5.0.0
Downloading docker-5.0.0-py2.py3-none-any.whl (146 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 147.0/147.0 KB 6.9 kB/s eta 0:00:00
Requirement already satisfied: six in /opt/conda/lib/python3.7/site-packages (from absl-py==0.13.0->-r /app/alphafold/requirements.txt (line 2)) (1.16.0)
Collecting websocket-client>=0.32.0
Downloading websocket_client-1.2.3-py3-none-any.whl (53 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.5/53.5 KB 14.7 kB/s eta 0:00:00
Requirement already satisfied: requests!=2.18.0,>=2.14.2 in /opt/conda/lib/python3.7/site-packages (from docker==5.0.0->-r /app/alphafold/requirements.txt (line 3)) (2.27.1)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker==5.0.0->-r /app/alphafold/requirements.txt (line 3)) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /opt/conda/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker==5.0.0->-r /app/alphafold/requirements.txt (line 3)) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker==5.0.0->-r /app/alphafold/requirements.txt (line 3)) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker==5.0.0->-r /app/alphafold/requirements.txt (line 3)) (1.26.8)
Installing collected packages: websocket-client, absl-py, docker
Successfully installed absl-py-0.13.0 docker-5.0.0 websocket-client-1.2.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Looking in links: https://storage.googleapis.com/jax-releases/jax_releases.html
warning: missing-index-doctype

× The package index page being used does not have a proper HTML doctype declaration.
╰─> Problematic URL: https://storage.googleapis.com/jax-releases/jax_releases.html

note: This is an issue with the page at the URL mentioned above.
hint: You might need to reach out to the owner of that package index, to get this fixed. See pypa/pip#10825 for context.
Collecting jax==0.2.14
Downloading jax-0.2.14.tar.gz (669 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 669.2/669.2 KB 15.4 kB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting jaxlib==0.1.69+cuda111
Downloading https://storage.googleapis.com/jax-releases/cuda111/jaxlib-0.1.69%2Bcuda111-cp37-none-manylinux2010_x86_64.whl (196.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 196.5/196.5 MB 8.6 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.12 in /opt/conda/lib/python3.7/site-packages (from jax==0.2.14) (1.21.1)
Requirement already satisfied: absl-py in /opt/conda/lib/python3.7/site-packages (from jax==0.2.14) (0.13.0)
Collecting opt_einsum
Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.5/65.5 KB 17.3 kB/s eta 0:00:00
Collecting flatbuffers<3.0,>=1.12
Downloading flatbuffers-2.0-py2.py3-none-any.whl (26 kB)
Collecting scipy
Downloading scipy-1.7.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (38.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.1/38.1 MB 176.2 kB/s eta 0:00:00
Requirement already satisfied: six in /opt/conda/lib/python3.7/site-packages (from absl-py->jax==0.2.14) (1.16.0)
Building wheels for collected packages: jax
Building wheel for jax (setup.py): started
Building wheel for jax (setup.py): finished with status 'done'
Created wheel for jax: filename=jax-0.2.14-py3-none-any.whl size=771352 sha256=58bfb994bf2d5491280383e2162cbd5b64fb251165b1361e115ba3a09539195a
Stored in directory: /root/.cache/pip/wheels/ec/bd/25/923906d87d262ee0be5c68b248d1a8249d028603582a256266
Successfully built jax
Installing collected packages: flatbuffers, scipy, opt_einsum, jaxlib, jax
Successfully installed flatbuffers-2.0 jax-0.2.14 jaxlib-0.1.69+cuda111 opt_einsum-3.3.0 scipy-1.7.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container c3a9bc845ac9
---> 5f460eb181f9

@Augustin-Zidek Augustin-Zidek added docker An issue with Docker setup Issue setting up AlphaFold labels Feb 17, 2022
@Wolf-Z
Copy link

Wolf-Z commented Mar 9, 2022

Edit:
Nevermind - My problem happens, when running docker under a different docker group, and having a docker user (with this legitimate docker group) running your container - but not, when running the container as root. Because the permissions underneath /app/alphafold/* are mostly zero for "others/World". No problem when running as root, but when running as user, this is not enough. I'll rebuild the image with an extra permission setting step for /app/alphafold/*
I leave this here in case someone else stumbles across this.

Original text:

I didn't observe problems with building the image - however, when starting it by running this on RHEL7.9 / latest docker-ce with python3 coming from a venv (python 3.6) with all the things from docker/requirements.txt inside like this:

 python3 /somewhere/alphafold/docker/run_docker.py --fasta_paths=T1050.fasta \
--max_template_date=2020-05-14 --data_dir=/somewhere/db/alphafold2/alldata

I get almost the same error:

[...]
I0309 13:52:36.921424 139926426507072 run_docker.py:107] Mounting /somewhere/db/alphafold2/alldata/bfd -> /mnt/bfd_database_path
I0309 13:52:37.488527 139926426507072 run_docker.py:247] python: can't open file '/app/alphafold/run_alphafold.py': [Errno 13] Permission denied

Note, that /somewhere is a NFS mount on the host, however "root" as well as docker users can access i.e. /somewhere/alphafold/run_alphafold.py but I doubt it is mounted this way but part of the image itself, right?
Also it's a proxy environment, do I need proxy-credentials within the container (i.e I could setup my ~/.docker/config.json) ?

If my bug is something different I'm sorry for polluting this issue and would open another issue instead. Thanks

@tomwardio
Copy link
Member

Hello!

I think the original issue is todo with where you run docker build from: it looks like this was being run from the docker/ sub-directory, rather than from the root of the repository. As @Wolf-Z mentioned, Docker will need to have access to this root directory in order to build the image correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker An issue with Docker setup Issue setting up AlphaFold
Projects
None yet
Development

No branches or pull requests

4 participants