Skip to content

Commit

Permalink
Docker: Install CMake via pip
Browse files Browse the repository at this point in the history
Version 3.13 seems to be unavailable via Kitware's apt repo and
the pip command line is easier anyway.

Signed-off-by: Max H. Gerlach <git@maxgerlach.de>
  • Loading branch information
maxhgerlach committed Jan 15, 2022
1 parent 97c8825 commit 9f42442
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 58 deletions.
13 changes: 3 additions & 10 deletions Dockerfile.test.cpu
Expand Up @@ -40,16 +40,6 @@ RUN apt-get update -qq && apt-get install -y --no-install-recommends \
g++-${GPP_VERSION} \
moreutils

# Install recent CMake.
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor \
> /etc/apt/trusted.gpg.d/kitware.gpg \
&& . /etc/lsb-release \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $DISTRIB_CODENAME main" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake=3.13.* \
cmake-data=3.13.*

# setup ssh service
RUN ssh-keygen -f /root/.ssh/id_rsa -q -N ''
RUN cp -v /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
Expand All @@ -61,6 +51,9 @@ RUN ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python${PYTHON_VERSION/%.
RUN wget --progress=dot:mega https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm get-pip.py
RUN pip install --no-cache-dir -U --force pip setuptools requests pytest mock pytest-forked parameterized

# Install recent CMake.
RUN pip install --no-cache-dir -U cmake~=3.13.0

# Add launch helper scripts
RUN echo "env SPARK_HOME=/spark SPARK_DRIVER_MEM=512m PYSPARK_PYTHON=/usr/bin/python${PYTHON_VERSION} PYSPARK_DRIVER_PYTHON=/usr/bin/python${PYTHON_VERSION} \"\$@\"" > /spark_env.sh
RUN echo /spark_env.sh pytest -v --capture=no --continue-on-collection-errors --junit-xml=/artifacts/junit.\$1.\${HOROVOD_RANK:-\${OMPI_COMM_WORLD_RANK:-\${PMI_RANK}}}.\$2.xml \${@:2} > /pytest.sh
Expand Down
13 changes: 3 additions & 10 deletions Dockerfile.test.gpu
Expand Up @@ -45,16 +45,6 @@ RUN CUDNN_MAJOR=$(cut -d '.' -f 1 <<< "${CUDNN_VERSION}"); \
libnccl2=${NCCL_VERSION_OVERRIDE} \
libnccl-dev=${NCCL_VERSION_OVERRIDE}

# Install recent CMake.
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor \
> /etc/apt/trusted.gpg.d/kitware.gpg \
&& . /etc/lsb-release \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $DISTRIB_CODENAME main" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake=3.13.* \
cmake-data=3.13.*

# setup ssh service
RUN ssh-keygen -f /root/.ssh/id_rsa -q -N ''
RUN cp -v /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
Expand All @@ -66,6 +56,9 @@ RUN ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python${PYTHON_VERSION/%.
RUN wget --progress=dot:mega https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm get-pip.py
RUN pip install --no-cache-dir -U --force pip "setuptools<60.1.0" requests pytest mock pytest-forked parameterized

# Install recent CMake.
RUN pip install --no-cache-dir -U cmake~=3.13.0

# Add launch helper scripts
RUN echo "env SPARK_HOME=/spark SPARK_DRIVER_MEM=512m PYSPARK_PYTHON=/usr/bin/python${PYTHON_VERSION} PYSPARK_DRIVER_PYTHON=/usr/bin/python${PYTHON_VERSION} \"\$@\"" > /spark_env.sh
RUN echo /spark_env.sh pytest -v --capture=no --continue-on-collection-errors --junit-xml=/artifacts/junit.\$1.\${HOROVOD_RANK:-\${OMPI_COMM_WORLD_RANK:-\${PMI_RANK}}}.\$2.xml \${@:2} > /pytest.sh
Expand Down
16 changes: 3 additions & 13 deletions docker/horovod-cpu/Dockerfile
Expand Up @@ -38,19 +38,6 @@ RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-
openssh-server \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install recent CMake.
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor \
> /etc/apt/trusted.gpg.d/kitware.gpg \
&& . /etc/lsb-release \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $DISTRIB_CODENAME main" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake=3.13.* \
cmake-data=3.13.* \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install Open MPI
RUN wget --progress=dot:mega -O /tmp/openmpi-3.0.0-bin.tar.gz https://github.com/horovod/horovod/files/1596799/openmpi-3.0.0-bin.tar.gz && \
cd /usr/local && \
Expand All @@ -70,6 +57,9 @@ RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
rm get-pip.py

# Install recent CMake.
RUN pip install --no-cache-dir -U cmake~=3.13.0

# Install PyTorch, TensorFlow, Keras and MXNet
RUN pip install --no-cache-dir torch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION}
RUN pip install --no-cache-dir pytorch_lightning==${PYTORCH_LIGHTNING_VERSION}
Expand Down
13 changes: 1 addition & 12 deletions docker/horovod-ray/Dockerfile
Expand Up @@ -24,18 +24,7 @@ RUN sudo apt-get update && DEBIAN_FRONTEND="noninteractive" sudo apt-get install
&& sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/*

# Install recent CMake.
RUN sudo bash -c 'wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor \
> /etc/apt/trusted.gpg.d/kitware.gpg \
&& . /etc/lsb-release \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $DISTRIB_CODENAME main" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake=3.13.* \
cmake-data=3.13.* \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
'
RUN pip install --no-cache-dir -U cmake~=3.13.0

# Install PyTorch
RUN pip install --no-cache-dir \
Expand Down
16 changes: 3 additions & 13 deletions docker/horovod/Dockerfile
Expand Up @@ -47,19 +47,6 @@ RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-
openssh-server \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install recent CMake.
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor \
> /etc/apt/trusted.gpg.d/kitware.gpg \
&& . /etc/lsb-release \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $DISTRIB_CODENAME main" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake=3.13.* \
cmake-data=3.13.* \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install Open MPI
RUN wget --progress=dot:mega -O /tmp/openmpi-3.0.0-bin.tar.gz https://github.com/horovod/horovod/files/1596799/openmpi-3.0.0-bin.tar.gz && \
cd /usr/local && \
Expand All @@ -79,6 +66,9 @@ RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
rm get-pip.py

# Install recent CMake.
RUN pip install --no-cache-dir -U cmake~=3.13.0

# Install PyTorch, TensorFlow, Keras and MXNet
RUN pip install --no-cache-dir \
torch==${PYTORCH_VERSION} \
Expand Down

0 comments on commit 9f42442

Please sign in to comment.