FROM pytorch/pytorch:1.7.1-cuda11.0-cudnn8-runtime
I initially started from Ubuntu/Debian base images but quickly found that installing CUDA and the corresponding version of Pytorch can be troublesome, thus I opted to use the official Pytorch images as they come with CUDA, Pytorch and conda installed.
There appear to be a couple of ways to enable a Conda environment in a Dockerfile, for a complete explanation of this approach please see this article.
RUN python -m ipykernel install --user --name=graphein
This simply installs ipykernel and makes the graphein Conda environment available within Jupiter notebooks.
TODO: I believe it would be preferable to install torch-geommetric using RUN conda install pytorch-geometric -c rusty1s -c conda-forge -v but I haven't been able to get it to work due to libc related errors.
Running this Docker image starts a Jupiter notebook server without a password at localhost:8888.
What testing did you do to verify the changes in this PR?
I have verified that most examples from the main Graphein docs work using this setup, however further testing is advised. Especially when it comes to using CUDA.
Details
I initially started from Ubuntu/Debian base images but quickly found that installing CUDA and the corresponding version of Pytorch can be troublesome, thus I opted to use the official Pytorch images as they come with CUDA, Pytorch and conda installed.
These dependencies are required prerequisites.
This is simply sets the
-y
flag by default when installing Conda libs.There appear to be a couple of ways to enable a Conda environment in a Dockerfile, for a complete explanation of this approach please see this article.
This simply installs ipykernel and makes the graphein Conda environment available within Jupiter notebooks.
TODO: I believe it would be preferable to install
torch-geommetric
usingRUN conda install pytorch-geometric -c rusty1s -c conda-forge -v
but I haven't been able to get it to work due to libc related errors.Running this Docker image starts a Jupiter notebook server without a password at localhost:8888.
What testing did you do to verify the changes in this PR?
I have verified that most examples from the main Graphein docs work using this setup, however further testing is advised. Especially when it comes to using CUDA.