-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
creating a layer with Docker/docker-compose #633
Conversation
|
1.) as far as i know only docker and docker-compose are in the ubuntu/debian repos. buildkit should be part of docker since version 18.09 ( it is a separate package in manjaro ).
2.) Due to ram limits i so far only tested 4bit I've followed that link and noticed that im seeing the same errors. I ve now updated the Dockerfile to use the nvidia/cuda image in the second stage too, which provides the required files. logs from execution of 4bit/8bit: https://gist.github.com/loeken/a9c2141adee41a6181c9bbde509a75fe |
I need better instructions on how to run this before I can merge. The average Linux user uses Ubuntu, so the README must contain all the necessary steps to get this running on Ubuntu. |
…ubuntu22.04 to delay deprecation of base image
alright i ll test on ubuntu 22.04 and get back to you with instructions |
@oobabooga added a docs/README_docker.md with instructions for ubuntu |
THe following lines in the Dockerfile would clobber any work-in-progress that would be intended for test:
|
valid point @deece the branches/shas have changed around a lot lately. I've removed setting values in the Dockerfile and since it switched from being a sha - to now being the cuda branch - i ve changed them to _VERSION. I ll leave the WEBUI_VERSION on head for now, but I think this should be changed to a tag/release. Right now everybody installs from the last version of this repo @oobabooga if you are fine with switching to a tag release flow i can provide a github action to build a docker image |
The cuda branch of GPTQ introduces some breaking changes that need to be addressed. In the meantime, this is the commit before the breaking change: GPTQ_SHA=608f3ba71e40596c75f8864d73506eaf57323c6e |
I'd suggest that the the git reset line be changed to something like: This would allow uncommitted changes to be tested in the Docker environment. |
The args in docker-compose.yml and Dockerfile don't align, eg, GPTQ_SHA vs GPTQ_VERSION |
@deece as for the breaking change what are you refering to? i can build for both cuda and 608f3ba71e40596c75f8864d73506eaf57323c6e for GPTQ |
The docker image builds without problems. I've put
I thought once the models are present, everything should be offline? The |
@deece tested only the build which passed earlier, I now started it up and im seeing errors - the gptq hash you provided does solve it. probably better to have fixed versions anyways. |
@rklasen you are using the "updated" models? compare checksums in those comments with your files |
Apologies, the WEBUI line I provided earlier fails the build if WEBUI_VERSION is not set, here's a version that will always exit with 0:
|
@loeken thanks for the hashes. I've got:
So at least those seem to be correct. I've just checked out the lastest changes of this PR after @deece 's latest commit, still the same error. What's confusing me is that the model files are found at least:
But there still seems to be some reference to |
...
You have to have the following files too:
I'd actually prefer it if the 4 bit checkpoints were alongside the the matching tokenizer files |
Works great for me, thanks for doing this! IMO should be merged! |
The Dockerfile provided in #174 only provides an interactive environment to play with, it doesn't really provide a service that could be started at boot (for example). Models would be stored within the Docker image, rather than volumes, so the many-gb of models would be lost if the image was rebuilt. It's also missing many of the pre-reqs and workarounds required for various features. As someone with some Docker experience, I've reviewed this and I'm happy to +1 this PR. I don't think there is anything here that cannot be justified. |
@loeken To get past the sentencepiece issue, I had to add this:
|
@oobabooga I do have a theory on your error, what docker-compose --version are you on? from the changelog of docker-compose it seems it was added in version 1.28.0 can you confirm you run >= 1.28.0 ? 1.28.0(https://docs.docker.com/compose/release-notes/#1280) Features so your version of docker-compose does not know how to handle this part of your docker-compose:
|
@deece yeah it's not at a pinned version https://github.com/oobabooga/text-generation-webui/blob/main/requirements.txt shouldnt "hot fix" this in this PR but rather have a seperate PR pinning all dependencies to specific versions in that file so its not just solved for docker. |
if you installed the docker-compose-plugin you might have ended up with a newer version ( you can try a docker compose up ) without the "-" tested in focal based ubuntu docker container with your repo: |
@loeken indeed, I have an older version
Let me see if I can find a way to install the newer version |
try the "docker compose up" first you might already have it installed in a new version via the plugin |
It was easier to just install the plugin manually with
Now I'm trying to build the image. |
It worked perfectly. This was pretty neat =) @loeken Some questions/comments before I merge:
For reference, these parameters were useful to me to launch an interactive shell inside the image:
|
@oobabooga Those directories are brought in as volumes instead (so they don't take extra space). The 2 files aren't used within the image, and updating them will invalidate the image unnescessarily. |
|
you can also use
to get an interactive terminal after you started up via docker-compose up |
I see @deece @loeken. Wouldn't it make sense to add all of the mounted folders to the .dockerignore?
|
@loeken here's a patch that reorders the COPYs so that pre-requisites aren't invalidated from the cache just because a source file has been updated.
|
if you want to be able to edit the files in these folders while the container is running then i would add them to the dockerignore ( but also create similar volume: entries in the docker-compose ). I basically excluded the lora/models folder because the files in there are big and i wanted to exclude them from the image itself, to reduce size/build time |
i havent edited files in the other folders a lot, but might be a good idea if others do |
want me to add those in as volumes and add to dockerignore too? |
I don't get it. Aren't those folders already mounted when the image is started, so that I can for instance drop a new yaml character in my characters folder and it will appear inside the image? |
oh sorry sleepy brain, yes we already have those folders mapped as volumes in the docker-compose. ignore my last statements on this. adding those other files to the .dockerignore wont change much. we only need the entries for the folders containing large files so they dont get added to the image |
Thanks for the PR, @loeken! And for the patience in convincing me of the relevance of docker compose. Also thanks @deece for the feedback. I will work on improving the documentation in the coming days. If you want to make any further chances to the docker compose files, feel free to submit a new PR. Just one more question: is it possible to get this running on WSL? |
@oobabooga I don't see any reason why it shouldn't work on WSL |
@oobabooga yeah does work on windows. #874 i ve also raised a separate issue on introducing dependency pinning, which is sort of related to this. pinning all versions would improve stability/experience for the users here. |
cleaned up version from #547