-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
58 lines (51 loc) · 2.86 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ARG PyTorch_Version
ARG CUDA_Major
ARG CUDA_Minor
ARG PyTorch_Tag
ARG PyTorch_Variants
FROM pytorch/pytorch:${PyTorch_Tag}${PyTorch_Variants}
MAINTAINER Kevin Pedro "pedrok@fnal.gov"
# repeat args after from
ARG PyTorch_Version
ARG CUDA_Major
ARG CUDA_Minor
ARG PyTorch_Tag
ARG PyTorch_Variants
RUN apt-get update --fix-missing && \
apt-get install -y wget git less nano g++ libssl-dev uuid-dev cmake imagemagick python3-dev && \
apt-get clean
# Unable to install libopencv, opencv, or py-opencv using either conda or mamba
# nor from either the anaconda or the conda-forge channels
RUN echo "\n\nInstalling mamba ..." && \
conda install mamba -n base -c conda-forge && \
conda install libarchive==3.5.2 -n base -c conda-forge && \
echo "\n\nInstalling packages from conda-forge using mamba ..." && \
mamba install -y -c pytorch -c conda-forge torchvision=0.15.0 'awkward<2' cudatoolkit=11.1 dask distributed gpyopt hist ipympl ipywidgets jax jupyterlab \
matplotlib mlflow nodejs notebook numba pandas pydot pygpu PyHamcrest pytables pytest \
scikit-image scikit-learn tensorboardx 'uproot<5' widgetsnbextension vector xrootd && \
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
echo "\n\nCleaning the conda cache ..." && \
/opt/conda/bin/conda clean -ya
# Graphviz moved to pip install because the conda installation is unbearably slow
# and mamba can't install the needed dependencies correctly
ARG CUDA_Version=cu${CUDA_Major}${CUDA_Minor}
RUN echo "\n\nInstalling packages from pip ..." && \
pip install --no-cache-dir energyflow graphviz && \
pip install --no-cache-dir torch-scatter -f https://pytorch-geometric.com/whl/torch-${PyTorch_Version}+${CUDA_Version}.html && \
pip install --no-cache-dir torch-sparse -f https://pytorch-geometric.com/whl/torch-${PyTorch_Version}+${CUDA_Version}.html && \
pip install --no-cache-dir torch-cluster -f https://pytorch-geometric.com/whl/torch-${PyTorch_Version}+${CUDA_Version}.html && \
pip install --no-cache-dir torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${PyTorch_Version}+${CUDA_Version}.html && \
pip install --no-cache-dir torch-geometric
# Install the LorentzGroupNetwork package
# The source code is on GitHub and is installable with pip, but it is not hosted on PyPi.org
# GitHub: https://github.com/fizisist/LorentzGroupNetwork
RUN cd /opt/ && \
git clone https://github.com/fizisist/LorentzGroupNetwork.git && \
cd LorentzGroupNetwork/ && \
pip install --no-cache-dir . && \
cd /workspace
# Conda pycuda by lukepfister and powerai don't install in python 3.7
# If we want pycuda we should install with 'apt-get install python3-pycuda'
RUN if [[ "${PyTorch_Variants}" == *"devel"* ]]; then apt-get install -y python3-pycuda && apt-get clean; else echo "building without pycuda" ; fi
# Set the entrypoint
ENTRYPOINT [ "/bin/bash" ]