a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
994 stars 125 forks source link

docker compose fails to build due to jupyter nbextension #371

Closed avivko closed 3 months ago

avivko commented 3 months ago

Describe the bug When I ran docker compose up -d --build, 'jupyter-nbextension' seems to break it.

To Reproduce

Steps to reproduce the behavior: 1) clone & cd repo 2) run: comp@usr:~/repos/graphein$ docker compose up -d --build [+] Building 1842.7s (26/26) FINISHED docker:default => [graphein-gpu internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.68kB 0.0s => [graphein-gpu internal] load metadata for docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime 1.2s => [graphein-gpu internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [graphein-gpu 1/22] FROM docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime@sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe 168.4s => => resolve docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime@sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe 0.0s => => sha256:a404e54162968593b8d92b571f3cdd673e4c9eab5d9be28d7c494595c0aa6682 26.71MB / 26.71MB 0.6s => => sha256:d70bbcbd9fa5ac5613648594bc56c2c1c74c0dfcbe4ff22f0f20b79b2a49b591 9.92MB / 9.92MB 0.9s => => sha256:2f8d87f6e9b576cc8aafb6a58c866a9516611d549be360361c2126d91ab6a3e6 5.64GB / 5.64GB 86.4s => => sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe 1.16kB / 1.16kB 0.0s => => sha256:1c9fb6f6f844dd852801691b87755ec1ee1693c6c28c70fc93106b2f49c97971 2.83kB / 2.83kB 0.0s => => extracting sha256:a404e54162968593b8d92b571f3cdd673e4c9eab5d9be28d7c494595c0aa6682 0.8s => => sha256:f0869fc5825082f7a44b0c9973d3d977f89a1589fe12881e53900346ba3e4863 98B / 98B 0.8s => => extracting sha256:d70bbcbd9fa5ac5613648594bc56c2c1c74c0dfcbe4ff22f0f20b79b2a49b591 0.7s => => extracting sha256:2f8d87f6e9b576cc8aafb6a58c866a9516611d549be360361c2126d91ab6a3e6 80.8s => => extracting sha256:f0869fc5825082f7a44b0c9973d3d977f89a1589fe12881e53900346ba3e4863 0.0s => [graphein-gpu internal] load build context 0.0s => => transferring context: 1.08kB 0.0s => [graphein-gpu 2/22] RUN apt-get update && apt-get -y install build-essential ffmpeg libsm6 libxext6 wget git && rm -rf /var/lib/apt/lists/ 66.0s => [graphein-gpu 3/22] RUN apt-get update && apt-get install -y iputils-ping && apt-get clean && rm -rf /var/lib/apt/lists/ 6.5s => [graphein-gpu 4/22] RUN apt-get update && apt-get install -y ncbi-blast+ && apt-get clean && rm -rf /var/lib/apt/lists/ 11.9s => [graphein-gpu 5/22] RUN apt-get update && apt-get install -y dssp && apt-get clean && rm -rf /var/lib/apt/lists/ 5.6s => [graphein-gpu 6/22] RUN mkdir -p graphein/requirements 0.6s => [graphein-gpu 7/22] WORKDIR /graphein 0.0s => [graphein-gpu 8/22] COPY .requirements /graphein/requirements 0.0s => [graphein-gpu 9/22] RUN echo "$(cat requirements/base.in)" >> requirements.txt && echo "$(cat requirements/dev.in)" >> requirements.txt && echo "$(cat requirements/extras.in)" >> requirements.txt 0.7s => [graphein-gpu 10/22] RUN pip install -r requirements.txt --no-cache-dir 63.6s => [graphein-gpu 11/22] RUN conda install -c conda-forge libgcc-ng 22.2s => [graphein-gpu 12/22] RUN conda install scipy scikit-learn matplotlib pandas cython ipykernel 74.4s => [graphein-gpu 13/22] RUN pip install ticc==0.1.4 --no-cache-dir 1.6s => [graphein-gpu 14/22] RUN conda install -c conda-forge vmd-python 633.1s => [graphein-gpu 15/22] RUN git clone https://github.com/getcontacts/getcontacts.git 3.6s => [graphein-gpu 16/22] RUN conda install -c fvcore -c iopath -c conda-forge fvcore iopath 50.4s => [graphein-gpu 17/22] RUN conda install -c pytorch3d pytorch3d 14.6s => [graphein-gpu 18/22] RUN conda install -c dglteam dgl 15.1s => [graphein-gpu 19/22] RUN conda install -c conda-forge ipywidgets 49.5s => [graphein-gpu 20/22] RUN export CUDA=$(python -c "import torch; print('cu'+torch.version.cuda.replace('.',''))") && export TORCH=$(python -c "import torch; print(torch.version)") && pip install torch-scatter -f https://pytorch-geometric.com/whl/to 640.4s => [graphein-gpu 21/22] RUN pip install jupyter_contrib_nbextensions 12.9s => ERROR [graphein-gpu 22/22] RUN jupyter nbextension enable --py widgetsnbextension 0.5s


[graphein-gpu 22/22] RUN jupyter nbextension enable --py widgetsnbextension:
0.433 usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
0.433 [--paths] [--json] [--debug]
0.433 [subcommand]
0.433
0.433 Jupyter: Interactive Computing 0.433 0.433 positional arguments: 0.433 subcommand the subcommand to launch 0.433 0.433 optional arguments: 0.433 -h, --help show this help message and exit 0.433 --version show the versions of core jupyter packages and exit 0.433 --config-dir show Jupyter config dir 0.433 --data-dir show Jupyter data dir 0.433 --runtime-dir show Jupyter runtime dir 0.433 --paths show all Jupyter paths. Add --json for machine-readable 0.433 format. 0.433 --json output paths as machine-readable json 0.433 --debug output debug information about paths 0.433 0.433 Available subcommands: contrib dejavu events execute kernel kernelspec lab 0.433 labextension labhub migrate nbconvert nbextensions_configurator notebook run 0.433 server troubleshoot trust 0.433 0.433 Jupyter command jupyter-nbextension not found.

failed to solve: process "/bin/sh -c jupyter nbextension enable --py widgetsnbextension" did not complete successfully: exit code: 1

Desktop (please complete the following information):

Additional context It also looks like you should be able to upgrade torch to 2.2.0 now and set python=3.10 (#290 ), so in case you make a new Dockerfile to fix this bug, it might be a good time to include this too.

a-r-j commented 3 months ago

Thanks for flagging @avivko!

Looks like Jupyter Notebook 7+ doesn't support jupyter-nbextension. Any preferences on how to resolve? I suppose pinning the notebook version to <7 seems simplest.

avivko commented 3 months ago

@a-r-j Yeah, looks like it is the easiest solution. Another solution could be using nbclassic with a newer server-backend. But I think you can go with setting Jupyter Notebook < 6.5 and revisit this in case there are incompatibilities with this in future releases of Graphein

a-r-j commented 3 months ago

Have merged the PR as tests pass. Feel free to re-open if it doesn't work :)