mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-05 06:01:26 +00:00
Templatize Dockerfiles & update workflows (#223)
Now build images by a script with a shared Dockerfile template --------- Co-authored-by: Binyang Li <binyli@microsoft.com> Co-authored-by: Saeed Maleki <saemal@microsoft.com>
This commit is contained in:
38
docker/base-dev-x.dockerfile
Normal file
38
docker/base-dev-x.dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
ARG BASE_IMAGE=ghcr.io/microsoft/mscclpp/mscclpp:base-cuda12.1
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
LABEL maintainer="MSCCL++"
|
||||
LABEL org.opencontainers.image.source https://github.com/microsoft/mscclpp
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
htop \
|
||||
lcov \
|
||||
vim \
|
||||
&& \
|
||||
apt-get autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/*
|
||||
|
||||
# Install cmake 3.26.4
|
||||
ENV CMAKE_VERSION="3.26.4"
|
||||
ENV CMAKE_HOME="/tmp/cmake-${CMAKE_VERSION}-linux-x86_64" \
|
||||
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz"
|
||||
RUN curl -L ${CMAKE_URL} -o ${CMAKE_HOME}.tar.gz && \
|
||||
tar xzf ${CMAKE_HOME}.tar.gz -C /usr/local && \
|
||||
rm -rf ${CMAKE_HOME}.tar.gz
|
||||
ENV PATH="/usr/local/cmake-${CMAKE_VERSION}-linux-x86_64/bin:${PATH}"
|
||||
|
||||
# Install Python dependencies
|
||||
ADD . /tmp/mscclpp
|
||||
WORKDIR /tmp/mscclpp
|
||||
ARG TARGET="cuda12.1"
|
||||
RUN cuda_major_version=$(echo ${TARGET} | grep -oP 'cuda\K[0-9]+') && \
|
||||
python3 -m pip install --no-cache-dir -r python/requirements_cu${cuda_major_version}.txt
|
||||
|
||||
# Set PATH
|
||||
RUN echo PATH="${PATH}" > /etc/environment
|
||||
|
||||
# Cleanup
|
||||
RUN rm -rf /tmp/mscclpp
|
||||
WORKDIR /
|
||||
Reference in New Issue
Block a user