-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Switch from SSH tunneling to FRP #2509
Conversation
* FRP Poc * Gracefully handle exceptions in thread tunneling * comments * Fix share error message when files are built locally (#2502) * fix share error message * changelog * formatting * tunneling rename * version * formatting * remove test * changelog * version Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: Wauplin <lucainp@gmail.com>
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2509-all-demos |
This works pretty well on the demos I've tried! The one thing I noticed that's weird is that the frp client seems to drop the connection to the gradio demo after a couple of minutes of inactivity. I have this demo running on a jupyter notebook: It worked great the first times I tried it locally and with the share link. However, I left it alone for a couple of minutes and then when I went back to the share link url I got a "Connection Error" and then the "not found" page even though the demo was still running on my machine. Refreshing the page seems to fix it but might be confusing to users. I'm wondering what would happen if the prediction takes a couple of minutes to run? |
@Wauplin do you have any ideas of what could be causing the behavior @freddyaboulton is describing? |
Thanks to @XciD, this is now working with http://*.testing.gradiodash.com/! |
@abidlabs I've made a small PR to generate the privilege key dynamically based on timestamp: #2519 (including also some cosmetic changes). It generates exactly the same privilege key for the example that was previously hard-coded. I've tested it locally and the tunnel works fine. But when I was talking about encryption I was referring encrypting the json payloads. @XciD haven't you talked about something like that in your presentation ? Something about the fact that you created a special docker image where encryption is skipped just to do the tests but that we should set it back once we have a working version ? Or have I hallucinated this ? 😄 (related internal slack thread) |
I'm sorry, I haven't been able to reproduce this error. I left a tunnel opened (from script in terminal) with a pending google chrome tab connected to it. Tried it again 1 hour later and haven't got any connection issue 😕 |
Nan you did not hallucinated: Coming from: https://github.com/fatedier/golib/tree/dev/crypto |
I created a few colab notebooks to do some load testing. This was the setup:
I varied the sleep duration between sending requests (note: requests are sent in parallel in separate threads, but there is a sleep in between each thread launch) in the LOAD TEST notebooks. The success rate indicates how often the POST requests came back successfully. When I ran both LOAD TEST notebooks simultaneously with the following sleep durations:
I believe the drop in success rate is not due to the infrastructure, but because the INTERFACE GENERATION colab notebooks cannot handle the load. The interfaces that failed cannot accept POST requests anymore, even at slower rates. I'm not sure if this setup is the ideal way to load test, open to suggestions. |
Great thanks @aliabid94! This is very helpful and I think generally looks promising. Would it be possible to investigate two additional things:
|
|
Following @abidlabs's message on slack (internal link) about issues to run FRP server in a notebook due to asyncio, I investigated it and decided to completely remove the async stuff as it was more painful that anything. Pushed the fix in c0b6801. Changes are:
|
Amazing @Wauplin! Testing right now |
Thank you so much @Wauplin, tested and looks awesome! I just made a beta release |
Testing has gone quite well! @aliabid94 is going to do some load-testing -- assuming that goes well, we should be good to merge tomorrow. |
Is the source for the frpc binary available? https://github.com/fatedier/frp seems to be incompatible with the gradio.live server and it looks like https://github.com/huggingface/frp is private, why? |
As a security precaution, we haven't released the full configuration of our FPRS server. We may consider doing so in the future |
hi @abidlabs , is it possible to use my own FRPS server for the shared link? for example, instead of using |
Hi @speaknowpotato this is something we might consider in the future, but right now, this isn't really on our roadmap |
Continuing from: #2396
Remaining TODOs:
Also:
share=True
#2260share=True
#2180