Skip to content

Commit

Permalink
syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
KuuCi committed Jan 23, 2024
1 parent 37d3b67 commit 3515141
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ RUN if [ -n "$CUDA_VERSION" ] ; then \
mkdir -p /tmp/cuda-keyring && \
wget -P /tmp/cuda-keyring https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb && \
dpkg -i /tmp/cuda-keyring/cuda-keyring_1.0-1_all.deb && \
rm -rf /tmp/cuda-keyring \
rm -rf /tmp/cuda-keyring ; \
fi

RUN set -eux; \
Expand Down Expand Up @@ -181,17 +181,14 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \
python${PYTHON_VERSION}-venv && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*

RUN set -eux; \
du -h --max-depth=3

RUN curl -fsSL https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} - && \
pip${PYTHON_VERSION} install --no-cache-dir --upgrade 'pip<23' setuptools

RUN set -eux; \
du -h --max-depth=3

#####################
# Install pillow-simd
#####################
Expand Down Expand Up @@ -226,11 +223,11 @@ RUN if [ -z "$PYTORCH_NIGHTLY_URL" ] ; then \
CUDA_VERSION_TAG=$(python${PYTHON_VERSION} -c "print('cu' + ''.join('${CUDA_VERSION}'.split('.')[:2]) if '${CUDA_VERSION}' else 'cpu')") && \
pip${PYTHON_VERSION} install --no-cache-dir --find-links https://download.pytorch.org/whl/torch_stable.html \
torch==${PYTORCH_VERSION}+${CUDA_VERSION_TAG} \
torchvision==${TORCHVISION_VERSION}+${CUDA_VERSION_TAG} \
torchvision==${TORCHVISION_VERSION}+${CUDA_VERSION_TAG} ; \
else \
pip${PYTHON_VERSION} install --no-cache-dir --pre --index-url ${PYTORCH_NIGHTLY_URL} \
torch==${PYTORCH_VERSION}.${PYTORCH_NIGHTLY_VERSION} \
torchvision==${TORCHVISION_VERSION}.${PYTORCH_NIGHTLY_VERSION} \
torchvision==${TORCHVISION_VERSION}.${PYTORCH_NIGHTLY_VERSION} ; \
fi

RUN set -eux; \
Expand Down Expand Up @@ -300,7 +297,7 @@ RUN if [ -n "$MOFED_VERSION" ] ; then \
wget -nv -P /tmp/mofed http://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VERSION}/MLNX_OFED_LINUX-${MOFED_VERSION}-ubuntu20.04-x86_64.tgz && \
tar -zxvf /tmp/mofed/MLNX_OFED_LINUX-${MOFED_VERSION}-ubuntu20.04-x86_64.tgz -C /tmp/mofed && \
/tmp/mofed/MLNX_OFED_LINUX-${MOFED_VERSION}-ubuntu20.04-x86_64/mlnxofedinstall --user-space-only --without-fw-update --force && \
rm -rf /tmp/mofed && ; \
rm -rf /tmp/mofed ; \
fi

RUN set -eux; \
Expand All @@ -322,7 +319,7 @@ RUN if [[ -n "$CUDA_VERSION" ]] && [[ -z "${PYTORCH_NIGHTLY_URL}" ]]; then \
--global-option="--cuda_ext" \
--target /usr/local/lib/python${PYTHON_VERSION}/dist-packages \
./ && \
rm -rf /tmp/apex && ; \
rm -rf /tmp/apex ; \
fi

RUN set -eux; \
Expand All @@ -346,14 +343,18 @@ RUN set -eux; \
###############
# Install cmake
###############
RUN pip${PYTHON_VERSION} install --no-cache-dir cmake==3.26.3 && \
RUN pip${PYTHON_VERSION} install --no-cache-dir cmake==3.26.3

RUN set -eux; \
du -h --max-depth=3

###########################
# Install Pandoc Dependency
###########################
RUN pip${PYTHON_VERSION} install --no-cache-dir pandoc==2.3 && \
du -h --max-depth=3 /
RUN pip${PYTHON_VERSION} install --no-cache-dir pandoc==2.3

RUN set -eux; \
du -h --max-depth=3

################################
# Use the correct python version
Expand All @@ -374,7 +375,9 @@ RUN mkdir -p ${COMPOSER_PYTHON_BIN} && \
# Include this folder, and the local bin folder, on the path
echo "export PATH=~/.local/bin:$COMPOSER_PYTHON_BIN:$PATH" >> /etc/profile && \
echo "export PATH=~/.local/bin:$COMPOSER_PYTHON_BIN:$PATH" >> /etc/bash.bashrc && \
echo "export PATH=~/.local/bin:$COMPOSER_PYTHON_BIN:$PATH" >> /etc/zshenv && \
echo "export PATH=~/.local/bin:$COMPOSER_PYTHON_BIN:$PATH" >> /etc/zshenv

RUN set -eux; \
du -h --max-depth=3

# Ensure that non-interactive shells load /etc/profile
Expand All @@ -385,7 +388,7 @@ ENV BASH_ENV=/etc/profile
#########################
RUN useradd -rm -d /home/mosaicml -s /bin/bash -u 1000 -U -s /bin/bash mosaicml && \
usermod -a -G sudo mosaicml && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

RUN set -eux; \
du -h --max-depth=3
Expand All @@ -410,7 +413,7 @@ RUN pip install --no-cache-dir --upgrade \
ipython${IPYTHON_VERSION} \
urllib3${URLLIB3_VERSION} \
python-snappy

RUN set -eux; \
du -h --max-depth=3

Expand All @@ -434,4 +437,4 @@ ARG DEBIAN_FRONTEND=noninteractive

ARG COMPOSER_INSTALL_COMMAND

RUN pip install "${COMPOSER_INSTALL_COMMAND}"
RUN pip install "${COMPOSER_INSTALL_COMMAND}"

0 comments on commit 3515141

Please sign in to comment.