ersilia-os / ersilia

The Ersilia Model Hub, a repository of AI/ML models for infectious and neglected disease research.
https://ersilia.io
GNU General Public License v3.0
219 stars 147 forks source link

Creating Dockerfile for the ersillia repo #494

Closed honeyankit closed 1 year ago

honeyankit commented 1 year ago

Context

Create a Dockerfile to build ersillia Docker image. You can reference the digital ocean Dockerfile

Exit Criteria

To have a Dockerfile to build ersillia Docker image

Contact

honeyankit commented 1 year ago

The dockerfile is throwing the below. The issue is setuptools package is not found. We need to install it.

#9 51.03 Collecting numpy>=1.14.5
#9 51.04   Downloading numpy-1.23.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
#9 51.48 Collecting python-dotenv>=0.10.4
#9 51.49   Downloading python_dotenv-0.21.0-py3-none-any.whl (18 kB)
#9 51.52 Requirement already satisfied: six>=1.5 in /root/miniconda3/lib/python3.9/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.30.0,>=1.29.30->boto3<2.0.0,>=1.26.8->isaura==0.17.0) (1.16.0)
#9 51.75 Installing collected packages: python-dateutil, jmespath, typing-extensions, botocore, s3transfer, python-dotenv, pydantic, numpy, aws-lambda-powertools, xdg, sqlalchemy, loguru, h5py, boto3, isaura
#9 56.74   Running setup.py develop for isaura
#9 56.76     ERROR: Command errored out with exit status 1:
#9 56.76      command: /root/miniconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/isaura/setup.py'"'"'; __file__='"'"'/isaura/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
#9 56.76          cwd: /isaura/
#9 56.76     Complete output (3 lines):
#9 56.76     Traceback (most recent call last):
#9 56.76       File "<string>", line 1, in <module>
#9 56.76     ModuleNotFoundError: No module named 'setuptools'
#9 56.76     ----------------------------------------
#9 56.76 ERROR: Command errored out with exit status 1: /root/miniconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/isaura/setup.py'"'"'; __file__='"'"'/isaura/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
------
executor failed running [/bin/bash -c /usr/bin/setup-ersilia]: exit code: 1
honeyankit commented 1 year ago

Draft PR: https://github.com/ersilia-os/ersilia/pull/506

honeyankit commented 1 year ago

ModuleNotFoundError: No module named 'setuptools'

The reason for the above issue is "Activating a Conda environment in your Dockerfile".

Few reference on how to solve it: https://pythonspeed.com/articles/activate-conda-dockerfile/ https://stackoverflow.com/questions/62797234/commandnotfounderror-when-activate-conda-with-docker https://stackoverflow.com/questions/56510575/activate-and-switch-anaconda-environment-in-dockerfile-during-build

GemmaTuron commented 1 year ago

@honeyankit Can you shortly update us on this issue?

honeyankit commented 1 year ago

@GemmaTuron : I was on PTO, there is no update on this issue since https://github.com/ersilia-os/ersilia/issues/494#issuecomment-1353525978

D1M1TR10S commented 1 year ago

Needs link to the new Dockerfile from @miquelduranfrigola. Should solve this error.

GemmaTuron commented 1 year ago

-hi @honeyankit Everything about docker is in the /dockerfiles folder on the ersilia repo. In this case, i think you need to have a look at the dockerfile on /easyinstallimage: https://github.com/ersilia-os/ersilia/tree/master/dockerfiles/easyinstallimage

GemmaTuron commented 1 year ago

This is completed: https://github.com/ersilia-os/ersilia/tree/master/dockerfiles/model-deploy/base