-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): add a gpu-trainer dockerfile
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |