IDEFICS3_ROCOv2 / Dockerfile
none
upgrade
7971fe4
# 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