-
Notifications
You must be signed in to change notification settings - Fork 136
/
Dockerfile
40 lines (27 loc) · 1.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Use the same python version with ray
FROM python:3.10.14
ARG HF_TOKEN
ENV HF_TOKEN=$HF_TOKEN
RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/
COPY comps /home/user/comps
RUN chown -R user /home/user/comps/finetuning
USER user
ENV PATH=$PATH:/home/user/.local/bin
RUN python -m pip install --no-cache-dir --upgrade pip && \
python -m pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
python -m pip install --no-cache-dir intel-extension-for-pytorch && \
python -m pip install --no-cache-dir oneccl_bind_pt --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/ && \
python -m pip install --no-cache-dir -r /home/user/comps/finetuning/requirements.txt
ENV PYTHONPATH=$PYTHONPATH:/home/user
WORKDIR /home/user/comps/finetuning
RUN echo PKGPATH=$(python3 -c "import pkg_resources; print(pkg_resources.get_distribution('oneccl-bind-pt').location)") >> run.sh && \
echo 'export LD_LIBRARY_PATH=$PKGPATH/oneccl_bindings_for_pytorch/opt/mpi/lib/:$LD_LIBRARY_PATH' >> run.sh && \
echo 'source $PKGPATH/oneccl_bindings_for_pytorch/env/setvars.sh' >> run.sh && \
echo ray start --head --dashboard-host=0.0.0.0 >> run.sh && \
echo export RAY_ADDRESS=http://localhost:8265 >> run.sh && \
echo python finetuning_service.py >> run.sh
CMD bash run.sh