|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -FROM nvcr.io/nvidia/pytorch:21.02-py3 |
| 15 | +FROM nvcr.io/nvidia/cuda:11.1.1-runtime-ubuntu20.04 |
16 | 16 |
|
17 | 17 | MAINTAINER PyTorchLightning <https://github.com/PyTorchLightning>
|
18 | 18 |
|
19 | 19 | ARG LIGHTNING_VERSION=""
|
20 | 20 |
|
21 |
| -COPY ./ ./pytorch-lightning/ |
| 21 | +SHELL ["/bin/bash", "-c"] |
| 22 | +# https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/ |
| 23 | +ENV \ |
| 24 | + DEBIAN_FRONTEND=noninteractive \ |
| 25 | + TZ=Europe/Prague \ |
| 26 | + PATH="$PATH:/root/.local/bin" \ |
| 27 | + CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" \ |
| 28 | + MKL_THREADING_LAYER=GNU |
| 29 | + |
| 30 | +RUN apt-get update -qq && \ |
| 31 | + apt-get install -y --no-install-recommends \ |
| 32 | + build-essential \ |
| 33 | + python3 \ |
| 34 | + python3-distutils \ |
| 35 | + python3-dev \ |
| 36 | + pkg-config \ |
| 37 | + cmake \ |
| 38 | + git \ |
| 39 | + wget \ |
| 40 | + unzip \ |
| 41 | + ca-certificates \ |
| 42 | + && \ |
| 43 | + |
| 44 | +# Cleaning |
| 45 | + apt-get autoremove -y && \ |
| 46 | + apt-get clean && \ |
| 47 | + rm -rf /root/.cache && \ |
| 48 | + rm -rf /var/lib/apt/lists/* && \ |
| 49 | + |
| 50 | +# Setup PIP |
| 51 | + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \ |
| 52 | + wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \ |
| 53 | + python get-pip.py && \ |
| 54 | + rm get-pip.py && \ |
| 55 | + pip --version |
| 56 | + |
| 57 | +COPY ./ /home/pytorch-lightning/ |
22 | 58 |
|
23 |
| -# install dependencies |
24 | 59 | RUN \
|
25 |
| - #conda install "pip>20.1" && \ |
26 |
| - pip list | grep torch && \ |
| 60 | + cd /home && \ |
| 61 | + mv pytorch-lightning/notebooks . && \ |
| 62 | + mv pytorch-lightning/pl_examples . && \ |
| 63 | + # replace by specific version if asked |
27 | 64 | if [ ! -z "$LIGHTNING_VERSION" ] ; then \
|
28 | 65 | rm -rf pytorch-lightning ; \
|
29 | 66 | wget https://github.com/PyTorchLightning/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \
|
30 | 67 | unzip ${LIGHTNING_VERSION}.zip ; \
|
31 | 68 | mv pytorch-lightning-*/ pytorch-lightning ; \
|
32 | 69 | rm *.zip ; \
|
33 | 70 | fi && \
|
34 |
| - pip install ./pytorch-lightning["extra"] --no-cache-dir && \ |
| 71 | + |
| 72 | +# Installations |
| 73 | + python -c "fname = './pytorch-lightning/requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('horovod')] ; open(fname, 'w').writelines(lines)" && \ |
| 74 | + pip install -r ./pytorch-lightning/requirements/extra.txt -U --no-cache-dir && \ |
| 75 | + pip install -r ./pytorch-lightning/requirements/examples.txt -U --no-cache-dir && \ |
| 76 | + pip install ./pytorch-lightning --no-cache-dir && \ |
35 | 77 | rm -rf pytorch-lightning
|
36 | 78 |
|
37 | 79 | RUN python --version && \
|
|
0 commit comments