SillyTavern / SillyTavern-Extras

Extensions API for SillyTavern.
GNU Affero General Public License v3.0
563 stars 133 forks source link

Docker compose issues #210

Closed rigbyb closed 10 months ago

rigbyb commented 10 months ago

There were some issues during the docker container setup on my machine that I managed to circumvent, so I'm posting some details here.

System Info

docker-compose.yml

parsing ~/Docker/sillytavern-github/SillyTavern-Extras/docker/docker-compose.yml: yaml: line 2: did not find expected key

docker compose up seems to fail due to indentation. Despite the message, this was caused by line 5 (deploy:):

1 version: "3"
2 services: 
3   sillytavern-extras:
4 #    runtime: nvidia
5      deploy:
6       resources:
7         reservations:

This was fixed by removing the single extra space before "deploy:".

version: "3"
services:
  sillytavern-extras:
#    runtime: nvidia
    deploy:
      resources:
        reservations:

Another issue came from mounting api_key.txt.

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "~/Docker/sillytavern-github/SillyTavern-Extras/docker/api_key.txt" to rootfs at "/sillytavern-extras/api_key.txt": mount ~/Docker/sillytavern-github/SillyTavern-Extras/docker/api_key.txt:/sillytavern-extras/api_key.txt (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

The mount location for api_key.txt assumes the current directory (line 26):

 23     volumes:
 24       #- "./chromadb:/chromadb"
 25       - "./cache:/root/.cache"
 26       - "./api_key.txt:/sillytavern-extras/api_key.txt:rw"

Based off the cloned repo, api_key.txt is located in the parent directory, and thus should be:

    volumes:
      #- "./chromadb:/chromadb"
      - "./cache:/root/.cache"
      - "../api_key.txt:/sillytavern-extras/api_key.txt:rw"

Dockerfile

The Dockerfile build process gets stuck at stage 8/11 (conda install) due to the confirmation "([y]/n)?" dialogue.

=> => # Proceed ([y]/n)?

Adding -y to the conda install step on line 26 seems to solve this issue. RUN conda install -y pytorch torchvision torchaudio pytorch-cuda=11.7 git -c pytorch -c nvidia -c conda-forge

rigbyb commented 10 months ago

These changes seemed to have solved my issues, and so hopefully will apply to others (without causing anything to break). I can also add these changes to a commit, if necessary (and possible).

Cohee1207 commented 10 months ago

I tried to fix, but idk if it worked. I never tried running it with Docker

rigbyb commented 10 months ago

It's okay. The updates seem to have fixed the issues I mentioned. Thanks :)