Comfy-Org / comfy-cli

Command Line Interface for Managing ComfyUI
https://docs.comfy.org/comfy-cli/getting-started
GNU General Public License v3.0
288 stars 48 forks source link

Containerized execution hangs because of update checks #175

Open jason-weirather opened 2 months ago

jason-weirather commented 2 months ago

Describe the bug While executing comfy-cli in a docker container, execution hangs when the code calls comfy_cli.update's check_for_updates function.

To Reproduce

  1. Install comfy-cli in a docker container
  2. Disable tracking in comfy-cli since its intended to run in a container without phoning out
  3. Use comfy launch to spin up a server in the background (--listen in the args should be set to 0.0.0.0 in docker)

Expected behavior Upon running comfy launch the server should start up and run, indicating a background server is up and return to a prompt.

Additional context I have succeeded to get comfy-cli to work in a container by modifying the code to not check for updates in commands that have nothing to do with updating.

My Dockerfile that does succeed with the modified comfy-cli

https://github.com/jason-weirather/comfyui-image-api/commits/main/Dockerfile

My branch of the fork where I've gotten it working by removing a few calls checking for updates from the comfy launch and comfy env commands.

https://github.com/jason-weirather/comfy-cli/tree/fixhangbug/comfy_cli

robinjhuang commented 2 months ago

Can you share the error message you see? Does it halt the comfy launch?

jason-weirather commented 2 months ago

Can you share the error message you see? Does it halt the comfy launch?

Theres no error message. It just hangs and halts the launch if it cannot reach out to talk to pypi.

robinjhuang commented 2 months ago

How about we make the request timeout 3 seconds

Sent via Superhuman iOS @.***>

On Fri, Sep 13 2024 at 9:39 PM, Jason L Weirather @.***> wrote:

Can you share the error message you see? Does it halt the comfy launch?

Theres no error message. It just hangs and halts the launch if it cannot reach out to talk to pypi.

— Reply to this email directly, view it on GitHub https://github.com/Comfy-Org/comfy-cli/issues/175#issuecomment-2348859436, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLJKASKKAZ2SENDMVRP3F3ZWLMJTAVCNFSM6AAAAABN2YIW3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBYHA2TSNBTGY . You are receiving this because you commented.Message ID: @.***>

jason-weirather commented 2 months ago

How about we make the request timeout 3 seconds

I think it sounds great solution to the hang bug. Should I make a PR request that implements this?

In the future, I think it would be good to add a command line option for an offline mode that could save that time and skip bonking pypi. A few seconds if you are spinning up dockers as like a lambda function thing is still not great, but thats something I could raise in a feature request rather than bug fix.

robinjhuang commented 2 months ago

Please make a PR. Having an offline mode makes sense as well! Please make another issue for that and we will get to it.

Sent via Superhuman iOS @.***>

On Sat, Sep 14 2024 at 12:01 AM, Jason L Weirather @.***> wrote:

How about we make the request timeout 3 seconds

I think it sounds great solution to the hang bug. Should I make a PR request that implements this?

In the future, I think it would be good to add a command line option for an offline mode that could save that time and skip bonking pypi. A few seconds if you are spinning up dockers as like a lambda function thing is still not great, but thats something I could raise in a feature request rather than bug fix.

— Reply to this email directly, view it on GitHub https://github.com/Comfy-Org/comfy-cli/issues/175#issuecomment-2349166144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLJKAX2VEGMK75NCYQ5CKTZWL46NAVCNFSM6AAAAABN2YIW3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBZGE3DMMJUGQ . You are receiving this because you commented.Message ID: @.***>