diff --git a/MANIFEST.in b/MANIFEST.in index 53029704..bae6726c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -42,3 +42,5 @@ prune notebook* prune temp* prune test* prune benchmark* +prune docker + diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..f6720e1f --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,42 @@ +ARG CUDA_VERSION=10.1 +FROM nvidia/cuda:${CUDA_VERSION}-base + +# install versions +ARG PYTHON_VERSION=3.7 +ARG PYTORCH_VERSION=1.4 +ARG LIGHTNING_VERSION=master + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + git \ + curl \ + ca-certificates + +# add non-root user +RUN useradd --create-home --shell /bin/bash containeruser +USER containeruser +WORKDIR /home/containeruser + + +# install conda and python +RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + chmod +x ~/miniconda.sh && \ + ~/miniconda.sh -b -p /home/containeruser/conda && \ + rm ~/miniconda.sh && \ + /home/containeruser/conda/bin/conda clean -ya && \ + /home/containeruser/conda/bin/conda install -y python=$PYTHON_VERSION + +# add conda to path +ENV PATH /home/containeruser/conda/bin:$PATH + +# install dependencies +RUN pip install torch==$PYTORCH_VERSION +RUN git clone https://github.com/PyTorchLightning/pytorch-lightning.git --single-branch --branch $LIGHTNING_VERSION && \ + pip install ./pytorch-lightning && \ + pip install -r pytorch-lightning/requirements-extra.txt && \ + rm -rf pytorch-lightning + +RUN python -c "import pytorch_lightning as pl; print(pl.__version__)" + +CMD ["/bin/bash"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..9844cd5b --- /dev/null +++ b/docker/README.md @@ -0,0 +1,13 @@ +## Builds + +You can build it on your own, note it takes lots of time, be prepared. +```bash +git clone +docker image build -t pytorch-lightning:py36 -f docker/Dockerfile --build-arg PYTHON_VERSION=3.6 . +``` +To build other versions, select different Dockerfile. +```bash +docker image list +docker run --rm -it pytorch-lightning:py36 bash +docker image rm pytorch-lightning:py36 +``` \ No newline at end of file