File size: 2,533 Bytes
7971fe4
44fc622
7971fe4
 
44fc622
21d1d68
44fc622
 
21d1d68
 
 
 
 
 
44fc622
 
 
 
 
 
 
 
 
 
 
7971fe4
44fc622
 
 
 
f0a6209
7971fe4
 
 
 
 
 
44fc622
e235434
44fc622
 
 
 
 
 
 
 
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
41
42
43
44
45
46
47
48
# build with: docker build . --tag sctg/roco-idefics3:0.0.9 --tag sctg/roco-idefics3:latest --push
# run with 
# docker run --gpus all --user=42420:42420 -p 8080:8080 -e HF_TOKEN=hf_TOKEN -it sctg/roco-idefics3:0.0.9 bash -i /start.sh sleep infinity
# docker run --gpus all --user=42420:42420 -p 8080:8080 -it sctg/roco-idefics3:0.0.9 bash -i /start.sh python /learn.py hf_...
FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
ARG NODE_MAJOR="20"
RUN /usr/sbin/addgroup --gid 42420 ovh
RUN /usr/sbin/useradd -u 42420 --gid 42420 -m -d /workspace -s /bin/bash ovh
RUN apt update -y && apt-get install -y curl git git-lfs screen \
      && mkdir -p /etc/apt/keyrings \
      && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
      && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
      && apt-get update \
      && apt-get install nodejs -y
COPY --chmod=777 start.sh /start.sh
COPY learn.py /learn.py
# Mandatory to run the jobs in rootless mode
USER root
RUN chown -R 42420:42420 /workspace
USER 42420
RUN curl -L https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > /workspace/miniconda.sh
RUN /bin/bash /workspace/miniconda.sh -b -p /workspace/.miniconda3
RUN . /workspace/.miniconda3/bin/activate && conda init --all
RUN . /workspace/.miniconda3/bin/activate \
    && pip install -U "safetensors>=0.4.5" \
    && pip install -U tensorflow \
    && pip install -U "https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-0.44.2.dev0-py3-none-manylinux_2_24_x86_64.whl" \
    && pip install -U git+https://github.com/huggingface/transformers.git\
    && pip install huggingface_hub[cli] accelerate datasets peft\
    && pip install -U Pillow \
    && pip install -U torchvision torchaudio \
    && pip install jupyter_copilot \
    && pip install unsloth\
    && pip uninstall unsloth -y \
    && pip install --upgrade --no-cache-dir --no-deps git+https://github.com/unslothai/unsloth.git


RUN . /workspace/.miniconda3/bin/activate && conda install -y jupyter
RUN rm -f /workspace/miniconda.sh
# Mandatory to run the jobs in rootless mode
# USER root
# RUN chown -R 42420:42420 /workspace
USER 42420
WORKDIR /workspace
# RUN export HOME=/workspace && cd /workspace && . /workspace/.miniconda3/bin/activate \
#     && mkdir -p /workspace/data \
#     && python /preload.py