Skip to content

Commit

Permalink
feat(docker): add a gpu-trainer dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Major-333 committed Aug 2, 2023
1 parent d3df06e commit a7e368e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docker/pytorch/gpu-trainer.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM easydl/easydl:ci as builder

WORKDIR /dlrover
COPY ./ .
RUN sh scripts/build_wheel.sh

FROM nvidia/cuda:10.2-runtime-ubuntu18.04 as base

WORKDIR /dlrover

COPY --from=builder /dlrover/dist/dlrover-*.whl /

RUN sed -i '1s/deb /deb [trusted=yes] /' /etc/apt/sources.list.d/cuda.list && \
sed -i '1s/deb /deb [trusted=yes] /' /etc/apt/sources.list.d/nvidia-ml.list

# Install Python 3.8 and pip
RUN apt-get update && apt-get install -y \
python3.8 python3-pip python3.8-venv python3.8-dev wget vim curl && \
ln -s /usr/bin/python3.8 /usr/bin/python && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py && rm get-pip.py && \
pip install --upgrade pip

RUN pip install urllib3==1.21.1 grpcio==1.34.1 grpcio-tools==1.34.1 protobuf==3.20.3

RUN pip install torch==2.0.1+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 \
-f https://download.pytorch.org/whl/torch_stable.html

RUN pip install /*.whl --extra-index-url=https://pypi.org/simple --no-deps && \
rm -f /*.whl

0 comments on commit a7e368e

Please sign in to comment.