-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add docker files #1418
Add docker files #1418
Conversation
relates to #1154 |
docker-compose.yml
Outdated
- default_model=juggernautXL_version6Rundiffusion.safetensors | ||
- default_performance=Speed | ||
volumes: | ||
- ./data:/content/data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a virtual volume here will increase the loading speed of models in Fooocus. Please test and adjust accordingly. See https://docs.docker.com/storage/volumes/#use-a-volume-with-docker-compose
Please also consider using a mount for the outputs directory as well as the python cache dir (most likely /home/user/.cache) as keeping cache non-persistent will lead to the container having to download many models on container start after destruction again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment.
- Unfortunately, I can't find the word, "virtual volume" in the URL. What is the "virtual volume"?
- "models" directory is in the persistent volume. So you don't need to download them after the second boot.
- "outputs" directory is also in the persistent volume. So you can see your previous outputs after the second boot.
- Generate python precompiled cache dir
__pycache__
in Dockefile. (5b30983). However, even without this cache, the .pyc files will be generated with a very short time.
Maybe "virtual volume" was a bit misleading, what i meant was as non-disk-mounted volume with definition in the docker-compose's volume section (not external), see example in the provided link. Some external models, not checkpoints, will be downloaded to /home/user/.cache, such as the CompVis safety checker (which arguably hasn't been merged yet and has 1GB). This would have to be downloaded on every container start or on usage of specific features, which would delay the process. |
@whitehara one addition: did you use |
@mashb1t Thank you for your comments again.
If so, "myapp" is created in the "/var/lib/docker/volumes"(default linux docker setting) and the performance of the volume depends on the location's storage(ssd, hdd, etc.)
Using other places are also OK. It depends on their needs, and users can modify docker-compose.yml easily.
|
Thank you for the explanation. I totally get your points, but still have my doubts concerning default speed and privacy.
|
Thank you for your comments again. |
Volume mounts are the standard for appdata such as models, regardless of the speed limitations. It would be better if this is the default and if anyone has any concerns about speed, they can switch to volume without mount. |
OK. Now 'docker-compose.yml' is changed not to use the bind mount. |
- default_model env var isn't necessary as model is included in default preset, same for speed - ENV CMDARGS --listen is now synched with docker-compose.yml file - remove
@whitehara Currently doing a re-review of this great PR as I'm now permitted to merge this feature.
What do you think? |
@mashb1t Thank you for your review again.
I'm using LF in my environment. So I can not reproduce this problem and don't know how to fix. But I modified CMD in Dockerfile to suspect to change the behavior.
I modified entrypoint.sh to launch launch.py and also modified docker.md
I added import function to import files from models, outputs folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whitehara great to still have you on board! Sadly i don't have full access to this repository and can't set up secrets for the actions, which is why we'd have to either remove the action or set up a new Dockerhub account and mirror Fooocus somehow. I'd propose to go for route 1(not yet merging the action), but keep the rest.
@mashb1t No problem. You can omit the GitHub Actions for building and releasing the container image. I (and maybe others, too) will keep doing that in our own repo. |
@lllyasviel @mashb1t, setting up a couple of secrets can't be that hard, right? |
@whitehara we have two possibilities now:
As there is no feedback from @lllyasviel yet I'd propose to go for the 1st route and remove the github action for now, which also doesn't build for multi-arch arm64 + amd64, so M1/M2 mac users can't use it in the current state. What do you think? |
@mashb1t Thank you for your checking again.
I recommend to keep "Run
I modified module requirements for building the linux/arm64 image, and I just start to provide the image on my dockerhub repo "whitehara/fooocus". But, unfortunately, I don't have any test environment about arm64. If you have the environment, please try it. |
@whitehara thank you for the adjustments. Torch Error
Atinoda/text-generation-webui-docker#22 (comment) I don't think there will be support for MPS with docker any time soon... After adding Process Kill Error
After increasing from 10GB => 20GB memory as well as 1GB => 4GB swap in Docker Desktop generation still doesn't start due to an issue after loading the model: Error after model load
This is also when i gave up to make it work on the Macbook. It seems to be working with neither MPS nor |
@mashb1t Thank you for your testing.
I think so, too. The "linux/arm64" image has a binary compatibility, but it still needs some tweaks for running on M1 Mac. |
Thank you for providing nice application.
I added docker related files.
Key features:
Please also see docker.md for details.
I also removed 'realpath' from 'generate_temp_filename'.
If the real path is not under the application folder but is symlinked under the application folder, it shows "Not allowed" error because the symlinked path is not used.
EDIT @mashb1t: closes #98