# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

# Use the same python version with ray
FROM vault.habana.ai/gaudi-docker/1.18.0/ubuntu22.04/habanalabs/pytorch-installer-2.4.0 AS hpu

ENV DEVICE="hpu"

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 -r /home/user/comps/finetuning/requirements.txt && \
    python -m pip install --no-cache-dir optimum-habana

ENV PYTHONPATH=$PYTHONPATH:/home/user

WORKDIR /home/user/comps/finetuning

ENTRYPOINT ["/bin/bash", "launch.sh"]
