ai-dock / comfyui

ComfyUI docker images for use in GPU cloud and local environments. Includes AI-Dock base for authentication and improved user experience.
Other
587 stars 206 forks source link

how-to WORKSPACE_SYNC #49

Closed pvp-by closed 2 months ago

pvp-by commented 7 months ago

my step :

use runpod template

ghcr.io/ai-dock/comfyui:latest
without PROVISIONING_SCRIPT
WORKSPACE_SYNC first time true , after true/false result down

result :

my goal install comfyui deps and when run, only extract docker image. save my install deps for custom_nodes.

first time i need use WORKSPACE_SYNC as true or false for everytime save my install deps

PS whether it's important to use any PROVISIONING_SCRIPT or can broken link ?

robballantyne commented 7 months ago

You can ignore the permissions errors they are not serious but I'll handle them in the next build.

To use sync, you'll need to run with WORKSPACE_SYNC=true on every run. Files will only be moved the first time but symlinks are created on subsequent runs.

You need to be aware that syncing to RunPod network volumes can be incredibly slow. It will also consume a great deal more space on the volume than it does in the container.

Provisioning is optional, but recommended. Any models it downloads will persist to the volume and it's useful for installing dependecies

pvp-by commented 7 months ago

@robballantyne Thank you so much for the clarification, you have confirmed the approach I need and that I am correct in my understanding of what is going on. If you ignore the current permissions, then it doesn't seem so bad.

and one more small clarification, is there a mechanism or is it planned some kind of similar PROVISIONING_SCRIPT, but its location is allowed on the network disk (the same workspace), i.e. when I want to apply such a script.

its own and without the extra cost of micro hosting for the script (even github)

it would be convenient to have such an argument (or functionality) that the workspace itself can be the source (even if the order of execution of such a script is the last)

robballantyne commented 7 months ago

You can run without declaring a provisioning script and the container will still look for, and execute the file /opt/ai-dock/bin/provisioning.sh so if you can get the file into that location by whatever alternative means it is possible.

You can also place a non executable file(s) in /opt/ai-dock/bin/preflight.d which will be sourced as part of the init.sh procedure at startup.

I can probably make this easier by having the init procedure test for a file on the workspace volume at container start.

robballantyne commented 2 months ago

Manually run venv-sync comfyui at any time