diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a3cb0065..a0c9921acc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -198,6 +198,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed a race condition in `ModelCheckpoint` when checking if a checkpoint file exists ([#5144](https://github.com/PyTorchLightning/pytorch-lightning/pull/5144)) +- Remove unnecessary intermediate layers in Dockerfiles ([#5697](https://github.com/PyTorchLightning/pytorch-lightning/pull/5697)) + ## [1.1.6] - 2021-01-26 diff --git a/dockers/base-conda/Dockerfile b/dockers/base-conda/Dockerfile index 27ac96f96e..857104c26b 100644 --- a/dockers/base-conda/Dockerfile +++ b/dockers/base-conda/Dockerfile @@ -58,21 +58,21 @@ RUN apt-get update -qq && \ rm -rf /root/.cache && \ rm -rf /var/lib/apt/lists/* -ENV PATH="/root/miniconda3/bin:$PATH" -ENV LD_LIBRARY_PATH="/root/miniconda3/lib:$LD_LIBRARY_PATH" -ENV CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" +ENV \ + PATH="/root/miniconda3/bin:$PATH" \ + LD_LIBRARY_PATH="/root/miniconda3/lib:$LD_LIBRARY_PATH" \ + CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" \ + HOROVOD_GPU_OPERATIONS=NCCL \ + HOROVOD_WITH_PYTORCH=1 \ + HOROVOD_WITHOUT_TENSORFLOW=1 \ + HOROVOD_WITHOUT_MXNET=1 \ + HOROVOD_WITH_GLOO=1 \ + HOROVOD_WITHOUT_MPI=1 \ + # MAKEFLAGS="-j$(nproc)" \ + MAKEFLAGS="-j1" \ + TORCH_CUDA_ARCH_LIST="3.7;5.0;6.0;7.0;7.5" \ + CONDA_ENV=lightning -ENV HOROVOD_GPU_OPERATIONS=NCCL -ENV HOROVOD_WITH_PYTORCH=1 -ENV HOROVOD_WITHOUT_TENSORFLOW=1 -ENV HOROVOD_WITHOUT_MXNET=1 -ENV HOROVOD_WITH_GLOO=1 -ENV HOROVOD_WITHOUT_MPI=1 -#ENV MAKEFLAGS="-j$(nproc)" -ENV MAKEFLAGS="-j1" -ENV TORCH_CUDA_ARCH_LIST="3.7;5.0;6.0;7.0;7.5" - -ENV CONDA_ENV=lightning COPY environment.yml environment.yml # conda init @@ -89,10 +89,11 @@ RUN conda create -y --name $CONDA_ENV python=${PYTHON_VERSION} pytorch=${PYTORCH conda clean -ya && \ rm environment.yml -ENV PATH /root/miniconda3/envs/${CONDA_ENV}/bin:$PATH -ENV LD_LIBRARY_PATH="/root/miniconda3/envs/${CONDA_ENV}/lib:$LD_LIBRARY_PATH" -# if you want this environment to be the default one, uncomment the following line: -ENV CONDA_DEFAULT_ENV=${CONDA_ENV} +ENV \ + PATH /root/miniconda3/envs/${CONDA_ENV}/bin:$PATH \ + LD_LIBRARY_PATH="/root/miniconda3/envs/${CONDA_ENV}/lib:$LD_LIBRARY_PATH" \ + # if you want this environment to be the default one, uncomment the following line: + CONDA_DEFAULT_ENV=${CONDA_ENV} COPY ./requirements/extra.txt requirements-extra.txt COPY ./requirements/test.txt requirements-test.txt diff --git a/dockers/base-cuda/Dockerfile b/dockers/base-cuda/Dockerfile index d84cba8b4c..1166bcd3aa 100644 --- a/dockers/base-cuda/Dockerfile +++ b/dockers/base-cuda/Dockerfile @@ -31,11 +31,11 @@ ARG CMAKE_VERSION=3.18.4 SHELL ["/bin/bash", "-c"] # https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/ -ENV DEBIAN_FRONTEND=noninteractive -ENV TZ=Europe/Prague - -ENV PATH="$PATH:/root/.local/bin" -ENV CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" +ENV \ + DEBIAN_FRONTEND=noninteractive \ + TZ=Europe/Prague \ + PATH="$PATH:/root/.local/bin" \ + CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" RUN apt-get update -qq && \ apt-get install -y --no-install-recommends \ @@ -67,15 +67,16 @@ RUN apt-get update -qq && \ rm -rf /root/.cache && \ rm -rf /var/lib/apt/lists/* -ENV HOROVOD_GPU_OPERATIONS=NCCL -ENV HOROVOD_WITH_PYTORCH=1 -ENV HOROVOD_WITHOUT_TENSORFLOW=1 -ENV HOROVOD_WITHOUT_MXNET=1 -ENV HOROVOD_WITH_GLOO=1 -ENV HOROVOD_WITHOUT_MPI=1 -#ENV MAKEFLAGS="-j$(nproc)" -ENV MAKEFLAGS="-j1" -ENV TORCH_CUDA_ARCH_LIST="3.7;5.0;6.0;7.0;7.5" +ENV \ + HOROVOD_GPU_OPERATIONS=NCCL \ + HOROVOD_WITH_PYTORCH=1 \ + HOROVOD_WITHOUT_TENSORFLOW=1 \ + HOROVOD_WITHOUT_MXNET=1 \ + HOROVOD_WITH_GLOO=1 \ + HOROVOD_WITHOUT_MPI=1 \ + # MAKEFLAGS="-j$(nproc)" \ + MAKEFLAGS="-j1" \ + TORCH_CUDA_ARCH_LIST="3.7;5.0;6.0;7.0;7.5" COPY ./requirements.txt requirements.txt COPY ./requirements/ ./requirements/ diff --git a/dockers/base-xla/Dockerfile b/dockers/base-xla/Dockerfile index 61f94d7bb4..6cd6c87623 100644 --- a/dockers/base-xla/Dockerfile +++ b/dockers/base-xla/Dockerfile @@ -25,8 +25,9 @@ SHELL ["/bin/bash", "-c"] ARG CONDA_VERSION=4.7.12 # for skipping configurations -ENV DEBIAN_FRONTEND=noninteractive -ENV CONDA_ENV=lightning +ENV \ + DEBIAN_FRONTEND=noninteractive \ + CONDA_ENV=lightning # show system inforation RUN lsb_release -a && cat /etc/*-release @@ -53,8 +54,9 @@ RUN apt-get update -qq && \ rm -rf /root/.cache && \ rm -rf /var/lib/apt/lists/* -ENV PATH="/root/miniconda3/bin:$PATH" -ENV LD_LIBRARY_PATH="/root/miniconda3/lib:$LD_LIBRARY_PATH" +ENV \ + PATH="/root/miniconda3/bin:$PATH" \ + LD_LIBRARY_PATH="/root/miniconda3/lib:$LD_LIBRARY_PATH" COPY environment.yml environment.yml RUN conda create -y --name $CONDA_ENV && \ @@ -67,10 +69,11 @@ RUN conda create -y --name $CONDA_ENV && \ conda clean -ya && \ rm environment.yml -ENV PATH /root/miniconda3/envs/${CONDA_ENV}/bin:$PATH -ENV LD_LIBRARY_PATH="/root/miniconda3/envs/${CONDA_ENV}/lib:$LD_LIBRARY_PATH" -# if you want this environment to be the default one, uncomment the following line: -ENV CONDA_DEFAULT_ENV=${CONDA_ENV} +ENV \ + PATH=/root/miniconda3/envs/${CONDA_ENV}/bin:$PATH \ + LD_LIBRARY_PATH="/root/miniconda3/envs/${CONDA_ENV}/lib:$LD_LIBRARY_PATH" \ + # if you want this environment to be the default one, uncomment the following line: + CONDA_DEFAULT_ENV=${CONDA_ENV} # Disable cache RUN pip --version && \