none commited on
Commit
500cbfa
·
1 Parent(s): 7971fe4
Files changed (4) hide show
  1. .gitignore +1 -0
  2. Dockerfile +12 -4
  3. apps.json.enc +4 -0
  4. start.sh +9 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ apps.json
Dockerfile CHANGED
@@ -1,7 +1,8 @@
1
- # build with: docker build . --tag sctg/roco-idefics3:0.0.9 --tag sctg/roco-idefics3:latest --push
2
  # run with
3
- # 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
4
- # 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_...
 
5
  FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
6
  ARG NODE_MAJOR="20"
7
  RUN /usr/sbin/addgroup --gid 42420 ovh
@@ -17,6 +18,7 @@ COPY learn.py /learn.py
17
  # Mandatory to run the jobs in rootless mode
18
  USER root
19
  RUN chown -R 42420:42420 /workspace
 
20
  USER 42420
21
  RUN curl -L https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > /workspace/miniconda.sh
22
  RUN /bin/bash /workspace/miniconda.sh -b -p /workspace/.miniconda3
@@ -24,19 +26,25 @@ RUN . /workspace/.miniconda3/bin/activate && conda init --all
24
  RUN . /workspace/.miniconda3/bin/activate \
25
  && pip install -U "safetensors>=0.4.5" \
26
  && pip install -U tensorflow \
27
- && 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" \
28
  && pip install -U git+https://github.com/huggingface/transformers.git\
29
  && pip install huggingface_hub[cli] accelerate datasets peft\
30
  && pip install -U Pillow \
31
  && pip install -U torchvision torchaudio \
32
  && pip install jupyter_copilot \
 
 
 
33
  && pip install unsloth\
 
34
  && pip uninstall unsloth -y \
35
  && pip install --upgrade --no-cache-dir --no-deps git+https://github.com/unslothai/unsloth.git
36
 
37
 
38
  RUN . /workspace/.miniconda3/bin/activate && conda install -y jupyter
39
  RUN rm -f /workspace/miniconda.sh
 
 
40
  # Mandatory to run the jobs in rootless mode
41
  # USER root
42
  # RUN chown -R 42420:42420 /workspace
 
1
+ # build with: docker build . --tag sctg/roco-idefics3:0.0.13 --tag sctg/roco-idefics3:latest --push
2
  # run with
3
+ # docker run --gpus all --user=42420:42420 -p 7000-8000:7000-8000 -p 8080:8080 -e HF_TOKEN=hf_TOKEN -it sctg/roco-idefics3:0.0.13 bash -i /start.sh sleep infinity
4
+ # docker run --gpus all --user=42420:42420 -p 7000-8000:7000-8000 -p 8080:8080 -it sctg/roco-idefics3:0.0.13 bash -i /start.sh python /learn.py hf_...
5
+ FROM cloudflare/cloudflared:latest as cloudflared
6
  FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
7
  ARG NODE_MAJOR="20"
8
  RUN /usr/sbin/addgroup --gid 42420 ovh
 
18
  # Mandatory to run the jobs in rootless mode
19
  USER root
20
  RUN chown -R 42420:42420 /workspace
21
+ COPY --from=cloudflared /usr/local/bin/cloudflared /usr/local/bin/cloudflared
22
  USER 42420
23
  RUN curl -L https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > /workspace/miniconda.sh
24
  RUN /bin/bash /workspace/miniconda.sh -b -p /workspace/.miniconda3
 
26
  RUN . /workspace/.miniconda3/bin/activate \
27
  && pip install -U "safetensors>=0.4.5" \
28
  && pip install -U tensorflow \
29
+ && pip install -U 'https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_multi-backend-refactor/bitsandbytes-0.44.1.dev0-py3-none-manylinux_2_24_x86_64.whl' \
30
  && pip install -U git+https://github.com/huggingface/transformers.git\
31
  && pip install huggingface_hub[cli] accelerate datasets peft\
32
  && pip install -U Pillow \
33
  && pip install -U torchvision torchaudio \
34
  && pip install jupyter_copilot \
35
+ && pip install -U jupyterlab-git \
36
+ && pip install -U jupyterlab-code-formatter \
37
+ && pip install -U black isort \
38
  && pip install unsloth\
39
+ && pip install gradio \
40
  && pip uninstall unsloth -y \
41
  && pip install --upgrade --no-cache-dir --no-deps git+https://github.com/unslothai/unsloth.git
42
 
43
 
44
  RUN . /workspace/.miniconda3/bin/activate && conda install -y jupyter
45
  RUN rm -f /workspace/miniconda.sh
46
+ RUN mkdir -p /workspace/.config/github-copilot/
47
+ COPY apps.json.enc /workspace/.config/github-copilot/apps.json.enc
48
  # Mandatory to run the jobs in rootless mode
49
  # USER root
50
  # RUN chown -R 42420:42420 /workspace
apps.json.enc ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ U2FsdGVkX18pDFgIQVRqC/ZSJxpyLeGB707YOM7dl1eBnl7o+kgaX/S0oMTopAqS
2
+ H5O0rln4ex/xZO4XPUyNQRtJpM5GmIHyZd+WMyz1VGuk5pyTHYm0OQ5hckI9zjxM
3
+ l655wf03Mxwbqdn0tMH/a/QkX5hExexNiRR5Fcb75pSNLVEZBwNTrulJgK1x+yrd
4
+ l17aFX/eHe/cx65ODBFv6Ao6tofqUsG9LfNu3fgxKmg=
start.sh CHANGED
@@ -4,6 +4,8 @@ JOB_ID=${JOB_ID:-'localhost'}
4
  JOB_HOST=${JOB_HOST:-'local'}
5
  export HOME=/workspace
6
  cd /workspace
 
 
7
  git lfs install
8
  if [[ -z "$HF_TOKEN" || ! "$HF_TOKEN" =~ ^hf_ ]]; then
9
  export HF_TOKEN=${!#}
@@ -15,6 +17,13 @@ echo "HF_TOKEN: $HF_TOKEN"
15
  . /workspace/.miniconda3/bin/activate
16
  export SHELL=/bin/bash
17
 
 
 
 
 
 
 
 
18
  git clone https://huggingface.co/eltorio/IDEFICS3_ROCOv2
19
  git config --global user.email "[email protected]"
20
  git config --global user.name "[email protected]"
 
4
  JOB_HOST=${JOB_HOST:-'local'}
5
  export HOME=/workspace
6
  cd /workspace
7
+
8
+ # Install git lfs
9
  git lfs install
10
  if [[ -z "$HF_TOKEN" || ! "$HF_TOKEN" =~ ^hf_ ]]; then
11
  export HF_TOKEN=${!#}
 
17
  . /workspace/.miniconda3/bin/activate
18
  export SHELL=/bin/bash
19
 
20
+ # Decode apps.json.enc file
21
+ # encoded with: openssl aes-256-cbc -base64 -md sha256 -pass pass:"$HF_TOKEN" -in apps.json -out apps.json.enc
22
+ # decode with: openssl aes-256-cbc -a -d -md sha256 -pass pass:"$HF_TOKEN" -in apps.json.enc -out apps.json
23
+ if [ -f /workspace/.config/github-copilot/apps.json.enc ]; then
24
+ openssl aes-256-cbc -a -d -md sha256 -pass pass:"$HF_TOKEN" -in /workspace/.config/github-copilot/apps.json.enc -out /workspace/.config/github-copilot/apps.json
25
+ fi
26
+
27
  git clone https://huggingface.co/eltorio/IDEFICS3_ROCOv2
28
  git config --global user.email "[email protected]"
29
  git config --global user.name "[email protected]"